20.04.2015, 11:36
is there any solution to make it just type /cuff ?i still trying it,but not working
Код:
COMMAND:cuff(playerid, params[]) { if(playerData[playerid][playerLoggedIn]) { if(playerData[playerid][playerClass] == CLASS_POLICE || playerData[playerid][playerClass] == CLASS_ARMY || playerData[playerid][playerClass] == CLASS_CIA || playerData[playerid][playerClass] == CLASS_FBI || playerData[playerid][playerClass] == CLASS_SECRETSERVICE) { // Command for police to cuff new otherPlayer, cuffedBy[24], Name[24], pCuff[250], lCuff[250]; if(sscanf(params, "u", otherPlayer)) { // Invalid command syntax SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}Usage: \"cuff <playerID>\""); } else { if(IsPlayerConnected(otherPlayer)) { if(playerData[otherPlayer][playerLoggedIn]) { if(playerData[otherPlayer][playerClass] == CLASS_CIVILIAN || playerData[otherPlayer][playerClass] == CLASS_MEDIC) { // Check if the other player has a wanted level if(playerData[otherPlayer][playerWantedLevel] >= 6) { // Check if the player is in jail if (playerData[playerid][playerJailTime] == 0 && playerData[otherPlayer][playerJailTime] == 0) { if(isPlayerInRangeOfPlayer(playerid, otherPlayer, 4.0)) { // If the player is not performing administrative duties if (!playerData[otherPlayer][playerAdminDuty]) { // If OTHER player is in a vehicle if(!IsPlayerInAnyVehicle(otherPlayer)) { // If POLICEMAN is in a vehicle if(!IsPlayerInAnyVehicle(playerid)) { // Check if the player is already cuffed if(!playerData[otherPlayer][playerIsCuffed]) { // Check if the player can cuff someone if(playerData[playerid][playerCanCuff]) { if(!playerData[playerid][playerIsTied]) { ClearAnimations(otherPlayer); GetPlayerName(playerid, cuffedBy, sizeof(Name)); GetPlayerName(otherPlayer, Name, sizeof(Name)); // Cuff player format(pCuff, sizeof(pCuff), "{FFDC2E}[CUFFED] {FFFFFF}You have been cuffed by %s(%i)", cuffedBy, playerid); SendClientMessage(otherPlayer, COLOR_WHITE, pCuff); format(lCuff, sizeof(lCuff), "{FFDC2E}[CUFFED] {FFFFFF}You have placed cuffs on %s(%i)", Name, otherPlayer); SendClientMessage(playerid, COLOR_WHITE, lCuff); SetPlayerSpecialAction(otherPlayer, SPECIAL_ACTION_CUFFED); // Set timer to expire and uncuff player (10 seconds) playerData[otherPlayer][uncuffTimer] = SetTimerEx("uncuff", 60000, false, "i", otherPlayer); playerData[playerid][recuffTimer] = SetTimerEx("recuff", 5000, false, "i", playerid); // Police cannot cuff for 5 seconds playerData[playerid][playerCanCuff] = false; // Set the otherPlayer's isCuffed to 1 playerData[otherPlayer][playerIsCuffed] = true; if (playerData[otherPlayer][playerIsTied]) { playerData[otherPlayer][playerIsTied] = false; KillTimer(playerData[otherPlayer][untieTimer]); } } else { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot do this whilst tied."); } } else { // Cannot cuff again yet... SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}Please wait before cuffing a player again."); } } else { // The player is already cuffed SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is already cuffed."); } } else { // Player is in vehicle SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot cuff people while you are in a vehicle."); } } else { // Other player is in a vehicle SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}The player you're trying to cuff is in a vehicle."); } } else { // Cannot cuff an admin on duty SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is currently performing admin duties and cannot be cuffed!"); } } else { // Not in range of player SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You are not close enough to that player."); } } else { // Player is in jail SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot cuff people when they're jailed or when you are jailed."); } } else { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}This player does not have a high enough wanted level."); } } else { // Cannot cuff a cop/cia/fbi SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot cuff law enforcement players."); } } else { // Cannot cuff players who are not logged in. SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You cannot cuff players who are not logged in."); } } else { // Cannot cuff players who are not connected. SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}That player is not connected."); } } } else { // Player is not police SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}This command can only be used by the LEO classes."); } } else { SendClientMessage(playerid, COLOR_WHITE, "{B7B7B7}[SERVER] {FFFFFF}You must be logged in to use commands."); } return 1; }