09.05.2012, 19:03
Quote:
Код:
} if(strcmp(cmd, "/uncuff", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pFaction] == 1|| PlayerInfo[playerid][pFaction] == 0) { if(CopOnDuty[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "You are not on duty"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /uncuff [playerid]"); return 1; } giveplayerid = ReturnUser(tmp); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(PlayerCuffed[giveplayerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "That player is not cuffed"); return 1; } if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You can not uncuff yourself"); return 1; } if(ProxDetectorS(8.0, playerid, giveplayerid)) { format(string, sizeof(string), "You have been uncuffed by %s", GetPlayerNameEx(playerid)); SendClientMessage(giveplayerid, COLOR_WHITE, string); format(string, sizeof(string), "You have uncuffed %s", GetPlayerNameEx(giveplayerid)); SendClientMessage(playerid, COLOR_WHITE, string); PlayerCuffed[giveplayerid] = 0; SetPlayerSpecialAction(giveplayerid,SPECIAL_ACTION_NONE); RemovePlayerAttachedObject(giveplayerid,0); PlayerPlayerActionMessage(playerid,giveplayerid,15.0,"uncuffs"); } else { SendClientMessage(playerid, COLOR_GREY, "That player is not in range"); return 1; } } } else { SendClientMessage(playerid, COLOR_LIGHTRED, "Playerid is not an active playerid"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, "Invalid faction"); } } return 1; |