- เครดิต
- 773
- ความรู้
-
- เงิน $
-
- ความดี
-
|
มี 3 แบบนะครับ
1.แบบต้องใส่กุญแจมือก่อนและไม่สามารถดึงรัฐได้
2.แบบไม่ต้องใส่กุญแจมือไม่สามารถดึงรัฐได้
3.แบบไม่ต้องกุญแจมือสามารถดึงรัฐได้
แบบที่ 1
- if(strcmp(cmd, "/drag", true) == 0)
- {
- new suspect = GetClosestPlayer(playerid);
-
-
- if(!IsPlayerInAnyVehicle(playerid))
-
-
- {
-
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèä´éÍÂÙ躹ö !");
-
- return 1;
-
- }
-
- if(gTeam[playerid] == 2 || PlayerInfo[playerid][pAdmin] >= 4)
- tmp = strtok(cmdtext, idx);
-
- if(!strlen(tmp))
-
- {
- SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /drag [Playerid/PartOfName]");
-
- return 1;
-
- }
- if(IsPlayerConnected(suspect))
- {
-
- suspect = ReturnUser(tmp);
-
- new vehid = GetPlayerVehicleID(playerid);
-
-
- new seat = 4;
-
- if(PlayerCuffed[suspect] == 0)
-
- {
-
- SendClientMessage(playerid, COLOR_GREY, " ¼ÙéµéͧËÒÂѧäÁèä´éãÊè¡Øá¨Á×Í !");
-
- return 1;
-
- }
-
- if (ProxDetectorS(100000.0, playerid, suspect))
-
- {
-
- if(IsACop(suspect))
-
- {
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèÊÒÁÒö´Ö§ µÓÃǨ/FBI/¹ÒÇÔ¡â¸Թ ä´é !");
- return 1;
- }
-
- new Float:pos[6];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- GetPlayerPos(suspect, pos[3], pos[4], pos[5]);
- if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 &&
- floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 &&
- floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false;
-
- GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
-
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s ä´é´Ö§µÑÇ %s ¢Öé¹Ã¶", sendername ,giveplayer);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- TogglePlayerControllable(suspect, 0);
-
- PutPlayerInVehicle(suspect,vehid,seat);
-
- }
-
- else
-
- {
-
-
- SendClientMessage(playerid, COLOR_GREY, " ¼ÙéµéͧËÒÍÂÙèËèÒ§¨Ò¡¤Ø³ÁÒ¡à¡Ô¹ä» !");
-
-
- return 1;
-
- }
-
- }
-
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด
แบบที่ 2 ครับ
- if(strcmp(cmd, "/drag", true) == 0)
- {
- new suspect = GetClosestPlayer(playerid);
-
-
- if(!IsPlayerInAnyVehicle(playerid))
-
-
- {
-
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèä´éÍÂÙ躹ö !");
-
- return 1;
-
- }
-
- if(gTeam[playerid] == 2 || PlayerInfo[playerid][pAdmin] >= 4)
- tmp = strtok(cmdtext, idx);
-
- if(!strlen(tmp))
-
- {
- SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /drag [Playerid/PartOfName]");
-
- return 1;
-
- }
- if(IsPlayerConnected(suspect))
- {
-
- suspect = ReturnUser(tmp);
-
- new vehid = GetPlayerVehicleID(playerid);
-
-
- new seat = 4;
-
- if (ProxDetectorS(100000.0, playerid, suspect))
-
- {
-
- if(IsACop(suspect))
-
- {
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèÊÒÁÒö´Ö§ µÓÃǨ/FBI/¹ÒÇÔ¡â¸Թ ä´é !");
- return 1;
- }
-
- new Float:pos[6];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- GetPlayerPos(suspect, pos[3], pos[4], pos[5]);
- if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 &&
- floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 &&
- floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false;
-
- GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
-
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s ä´é´Ö§µÑÇ %s ¢Öé¹Ã¶", sendername ,giveplayer);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- TogglePlayerControllable(suspect, 0);
-
- PutPlayerInVehicle(suspect,vehid,seat);
-
- }
-
- else
-
- {
-
-
- SendClientMessage(playerid, COLOR_GREY, " ¼ÙéµéͧËÒÍÂÙèËèÒ§¨Ò¡¤Ø³ÁÒ¡à¡Ô¹ä» !");
-
-
- return 1;
-
- }
-
- }
-
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด
แบบที่ 3 ครับ
- if(strcmp(cmd, "/drag", true) == 0)
- {
- new suspect = GetClosestPlayer(playerid);
-
-
- if(!IsPlayerInAnyVehicle(playerid))
-
-
- {
-
- SendClientMessage(playerid, COLOR_GREY, " ¤Ø³äÁèä´éÍÂÙ躹ö !");
-
- return 1;
-
- }
-
- if(gTeam[playerid] == 2 || PlayerInfo[playerid][pAdmin] >= 4)
- tmp = strtok(cmdtext, idx);
-
- if(!strlen(tmp))
-
- {
- SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /drag [Playerid/PartOfName]");
-
- return 1;
-
- }
- if(IsPlayerConnected(suspect))
- {
-
- suspect = ReturnUser(tmp);
-
- new vehid = GetPlayerVehicleID(playerid);
-
-
- new seat = 4;
-
- if (ProxDetectorS(100000.0, playerid, suspect))
-
- {
-
- new Float:pos[6];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- GetPlayerPos(suspect, pos[3], pos[4], pos[5]);
- if (floatcmp(floatabs(floatsub(pos[0], pos[3])), 10.0) != -1 &&
- floatcmp(floatabs(floatsub(pos[1], pos[4])), 10.0) != -1 &&
- floatcmp(floatabs(floatsub(pos[2], pos[5])), 10.0) != -1) return false;
-
- GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
-
- GetPlayerName(playerid, sendername, sizeof(sendername));
- format(string, sizeof(string), "* %s ä´é´Ö§µÑÇ %s ¢Öé¹Ã¶", sendername ,giveplayer);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- TogglePlayerControllable(suspect, 0);
-
- PutPlayerInVehicle(suspect,vehid,seat);
-
- }
-
- else
-
- {
-
-
- SendClientMessage(playerid, COLOR_GREY, " ¼ÙéµéͧËÒÍÂÙèËèÒ§¨Ò¡¤Ø³ÁÒ¡à¡Ô¹ä» !");
-
-
- return 1;
-
- }
-
- }
-
- return 1;
- }
คัดลอกไปที่คลิปบอร์ด
|
|