22.01.2017, 19:35
see here
https://sampforum.blast.hk/showthread.php?tid=618127
and add it in gm
https://sampforum.blast.hk/showthread.php?tid=618127
and add it in gm
Код:
#include <a_samp> #include <zcmd> #include <sscanf2>
Код:
CMD:cuff(playerid, params[]) { if(gTeam[playerid] == LSPD) { new targetid; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFF00FF, "USAGE: /cuff (PlayerID)"); if(IsPlayerConnected(targetid)) { new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) { if(gTeam[playerid] != LSPD) { if(IsCuffed[targetid] == false) { new string[64+MAX_PLAYER_NAME] new targetname[MAX_PLAYER_NAME] new playername[MAX_PLAYER_NAME] GetPlayerName(playerid, playername, sizeof(playername) format(string, sizeof(string), "You have been cuffed by officer %s",playername)); SendClientMessage(targetid, 0x0000FF, string); GetPlayerName(targetid, targetname, sizeof(targetname)) format(string, sizeof(string), "You have cuffed %s ", targetname)) SendClientMessage(playerid, 0xCCFF00, string)); SetPlayerAttachedObject(targetid,8,19418,6,-0.031999,0.024000,-0.024000,-7.900000,-32.000011,-72.299987,1.115998,1.322000,1.406000); SetPlayerSpecialAction(targetid, SPECIAL_ACTION_CUFFED); IsCuffed = true; return 1; } else if(IsCuffed == true) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: This player is already cuffed!"); return 1; } return 1; } else if(gTeam[playerid] == LSPD) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: you can't cuff a law enforcer!"); return 1; { return 1; } else if(!IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: That player is too far away from you!"); return 1; } return 1; } else if(!IsPlayerConnected(targetid)) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: Invalid ID!"); return 1! } return 1; } else if(gTeam[playerid] != LSPD) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: Only cops and use this command!"); return 1; } return 1; }
Код:
CMD:uncuff(playerid, params[]) { if(gTeam[playerid] == LSPD) { new targetid; if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, 0xFF00FF, "USAGE: /uncuff (PlayerID)"); if(IsPlayerConnected(targetid)) { new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) { if(gTeam[playerid] != LSPD) { if(IsCuffed[targetid] == true) { new string[64+MAX_PLAYER_NAME] new targetname[MAX_PLAYER_NAME] new playername[MAX_PLAYER_NAME] GetPlayerName(playerid, playername, sizeof(playername) format(string, sizeof(string), "You have been uncuffed by officer %s",playername)); SendClientMessage(targetid, 0x0000FF, string); GetPlayerName(targetid, targetname, sizeof(targetname)) format(string, sizeof(string), "You have uncuffed %s ", targetname)) SendClientMessage(playerid, 0xCCFF00, string)); if(IsPlayerAttachedObjectSlotUsed(targetid, 8)) { RemovePlayerAttachedObject(targetid, 8); return 1; } SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE); IsCuffed = false; return 1; } else if(IsCuffed == true) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: This player is not cuffed!"); return 1; } return 1; } else if(gTeam[playerid] == LSPD) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: you can't use this on a law enforcer!"); return 1; { return 1; } else if(!IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: That player is too far away from you!"); return 1; } return 1; } else if(!IsPlayerConnected(targetid)) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: Invalid ID!"); return 1! } return 1; } else if(gTeam[playerid] != LSPD) { SendClientMessage(playerid, 0xFF0000, "[ERROR]: Only cops and use this command!"); return 1; } return 1; }