Arrest Command!
#1

Hi guys! I have a problem and I want you to help! I have created a word for the police to catch people but I want to add time I mean after a cop arrest someone give him extra +5secdons to use the command again! How to do that?


PHP код:
CMD:ar(playeridparams[])
{
    if(!
PoliceTeam(GetPlayerSkin(playerid))) return SendClientMessage(playerid0xE74C3CFF"{FF0000}Error: {FFFFFF}Only Law Enforcement may use this command.");
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid,string[128];
    new 
Float:targetidpos[3];
    if(
GetPlayerInterior(targetid) > 0) return SendClientMessage(playeridred"{FF0000}Error: {ffffff} You can't arrest players inside an interior.");
    if(
sscanf(params"ui"playerid)) SendClientMessage(playeridCOLOR_WHITE"{E66144}[POLICE]{FFFFFF}: /Arrest(/AR) [Username /ID]. ");
    if(
GetPVarInt(playerid,"ArTime")>GetTickCount())return SendClientMessage(playerid,0xFF0000FF,"{FF0000}Error: {ffffff}Please wait 5 seconds before arresting a suspect again.");
    if(
PlayerInfo[targetid][pJailed] == 1) return SendClientMessage(playeridred"{FF0000}Error: {ffffff}This player is already in jail,you can't arrest him.");
    if(
IsPlayerInAnyVehicle(targetid)) return SendClientMessage(playerid,red,"{FF0000}Error: {ffffff}You can't arrest players if they're in a vehicle.");
    if(
GetPlayerWantedLevel(targetid) == 3) return SendClientMessage(playeridred"{FF0000}Error: {ffffff} You can't arrest players with wanted level lower than, Use /tk to issue a ticket.");
    if(
GetPlayerWantedLevel(targetid) == 0) return SendClientMessage(playeridred"{FF0000}Error: {ffffff}This player is not wanted,you can't arrest him");
    if(
playerid == targetid) return SendClientMessage(playerid,red"{FF0000}Error: {ffffff}You cannot arrest yourself.");
    if(
gTeam[playerid] == CLASS_COPS && gTeam[playerid] == CLASS_CIA && gTeam[playerid] == CLASS_SWAT && gTeam[playerid] == CLASS_ARMY) return SendClientMessage(playerid,red"You can't arrest who is in your team.");
    
GetPlayerPos(playeridtargetidpos[0], targetidpos[1], targetidpos[2]);
    if (!
IsPlayerInRangeOfPoint(playerid5.0targetidpos[0], targetidpos[1], targetidpos[2])) return SendClientMessage(playerid, -1"Nobody close enough to arrest.");
    
GetPlayerName(playeridpNamesizeof(pName));
    
GetPlayerName(targetidtNamesizeof(tName));
    if(
IsPlayerConnected(targetid)) 
Reply


Messages In This Thread
Arrest Command! - by RedRex - 23.04.2018, 12:24
Re: Arrest Command! - by m4karow - 23.04.2018, 12:49

Forum Jump:


Users browsing this thread: 1 Guest(s)