SAMP id 0 cant /tk id 1 & same with /ar
#1

hey i dont know why when i am id 1 i cant give tickets but when i am id 0 i cant here the code


ticket command
PHP код:
if(!IsCop(playerid))
        return 
SendClientMessage(playeridCOLOR_RED"Only Cops/Army can use this command.");
    new 
string[120], ID;
    if(
GetDistanceBetweenPlayers(playeridID) > 4)
    {
        return 
SendClientMessage(playeridCOLOR_RED"That player is too far away to Ticket.");
    }
    new 
pwl GetPlayerWantedLevel(ID);
    if(
pwl == 1)
    {
        
format(string120"[COP ACTION] You have been fined by officer %s. You have been charged $1,000"PlayerInfo(playerid));
        
SendClientMessage(IDCOLOR_DODGERBLUEstring);
        
format(string120"[COP ACTION] You have fined %s. You have recieved a collection prize."PlayerInfo(ID));
        
SendClientMessage(playeridCOLOR_DODGERBLUEstring);
        
format(string120"[DISPATCH] Officer %s has fined %s. He is no longer wanted."PlayerInfo(playerid), PlayerInfo(ID));
        
SendCopMessage(string);
        
SetPlayerWantedLevel(ID0);
        
IncreaseScore(playerid1);
        
GivePlayerMoney(playerid2500);
        
GivePlayerMoney(ID, -1000);
    }
    if(
pwl == 2)
    {
         
format(string120"[COP ACTION] You have been fined by officer %s. You have been charged $2,000"PlayerInfo(playerid));
        
SendClientMessage(IDCOLOR_DODGERBLUEstring);
        
format(string120"[COP ACTION] You have fined %s. You have recieved a collection prize."PlayerInfo(ID));
        
SendClientMessage(playeridCOLOR_DODGERBLUEstring);
        
format(string120"[DISPATCH] Officer %s has fined %s. He is no longer wanted."PlayerInfo(playerid), PlayerInfo(ID));
        
SendCopMessage(string);
        
SetPlayerWantedLevel(ID0);
        
IncreaseScore(playerid1);
        
GivePlayerMoney(playerid2500);
        
GivePlayerMoney(ID, -2000);
    }
     if(
pwl == 3)
    {
         
format(string120"[COP ACTION] You have been fined by officer %s. You have been charged $3,000"PlayerInfo(playerid));
        
SendClientMessage(IDCOLOR_DODGERBLUEstring);
        
format(string120"[COP ACTION] You have fined %s. You have recieved a collection prize."PlayerInfo(ID));
        
SendClientMessage(playeridCOLOR_DODGERBLUEstring);
        
format(string120"[DISPATCH] Officer %s has fined %s. He is no longer wanted."PlayerInfo(playerid), PlayerInfo(ID));
        
SendCopMessage(string);
        
SetPlayerWantedLevel(ID0);
        
IncreaseScore(playerid1);
        
GivePlayerMoney(playerid2500);
        
GivePlayerMoney(ID, -3000);
    }
    else
    {
        if(
pwl == 0)
        {
            return 
SendClientMessage(playeridCOLOR_YELLOW"["COL_GREY"Error"COL_YELLOW"]"COL_GREY":"COL_LRED"player is innocent!");
        }
        if(
pwl == 4)
        {
            return 
SendClientMessage(playeridCOLOR_YELLOW"["COL_GREY"Error"COL_YELLOW"]"COL_GREY":"COL_LRED"You only can give ticket to wanted players of 1 to 3!");
        }
        if(
pwl == 5)
        {
            return 
SendClientMessage(playeridCOLOR_YELLOW"["COL_GREY"Error"COL_YELLOW"]"COL_GREY":"COL_LRED"You only can give ticket to wanted players of 1 to 3!");
        }
        if(
pwl == 6)
        {
            return 
SendClientMessage(playeridCOLOR_YELLOW"["COL_GREY"Error"COL_YELLOW"]"COL_GREY":"COL_LRED"You only can give ticket to wanted players of 1 to 3!");
        }
    }
    return 
1;

arrest command
PHP код:
command(arplayeridparams[])
{
    if(!
IsCop(playerid))
    {
        return 
SendClientMessage(playeridCOLOR_RED"You are not a Law Enforcement officer.");
    }
    new 
IDstring[200];
    if(
IsPlayerInAnyVehicle(playerid))
    {
        return 
SendClientMessage(playeridCOLOR_RED"You cannot be in a vehicle to use this command.");
    }
    if(!
IsPlayerConnected(ID))
    {
        return 
SendClientMessage(playeridCOLOR_RED"Invalid ID.");
    }
    if(
IsPlayerInAnyVehicle(ID))
 {
        return 
SendClientMessage(playeridCOLOR_RED"You cannot arrest a player inside a vehicle.");
 }
    if(
AccountInfo[ID][pJailed] == 1)
    {
        return 
SendClientMessage(playeridCOLOR_RED"You cannot arrest a jailed person.");
     }
    if(
GetDistanceBetweenPlayers(playeridID) > 4)
    {
        return 
SendClientMessage(playeridCOLOR_RED"That player is too far away to arrest.");
    }
    if(
GetPlayerWantedLevel(ID) <= 1)
    {
        return 
SendClientMessage(playeridCOLOR_RED"The player must have a warrant before you arrest.");
    }
    new 
pwl GetPlayerWantedLevel(ID);
    new 
i;
    if(
pwl == 4)
    {
        
format(stringsizeof(string), "Police Officer %s has arrested wanted suspect %s"PlayerInfo(playerid), PlayerInfo(ID));
        
SendClientMessageToAll(COLOR_BLUEstring);
        
CNR_PrintString(string);
        
format(stringsizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail"PlayerInfo(ID));
        
SendCopMessage(string);
        new 
tdstring[120];
        
format(tdstringsizeof(tdstring), "~g~+~g~~h~$~g~~h~~h~~h~4,000");
        
PlayerTextDrawSetString(playeridWMoney[playerid], tdstring);
           
PlayerTextDrawShow(playeridWMoney[playerid]);
        
SetTimerEx("HideWM"7000true"i"playerid);
        
GivePlayerMoney(playerid4000);
        
IncreaseScore(playerid1);
        
AccountInfo[ID][pJailTime] = 60 ;
        
AccountInfo[ID][pJailed] = ;
        
SetPlayerInterior(ID10);
        new 
rnd random(sizeof(PrisonSpawn));
        
SetPlayerPos(IDPrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
        
SendClientMessage(IDCOLOR_GREY"**LOS SANTOS PRISON**");
        
SendClientMessage(IDCOLOR_LIGHTBLUE"[PRISON] You have been sent to prison. You will be released soon.");
        
SetPlayerWantedLevel(ID0);
          if(
IsPlayerAttachedObjectSlotUsed(IDi)) RemovePlayerAttachedObject(IDi);
        
SetPlayerSpecialAction(IDSPECIAL_ACTION_NONE);
        
AccountInfo[ID][pCuffed] = ;
        return 
1;
    }
    if(
pwl == 5)
    {
        
format(stringsizeof(string), "Police Officer %s has arrested  most wanted suspect %s"PlayerInfo(playerid), PlayerInfo(ID));
        
SendClientMessageToAll(COLOR_BLUEstring);
        
CNR_PrintString(string);
        
format(stringsizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail"PlayerInfo(ID));
        
SendCopMessage(string);
        new 
tdstring[120];
        
format(tdstringsizeof(tdstring), "~g~+~g~~h~$~g~~h~~h~~h~10,000");
        
PlayerTextDrawSetString(playeridWMoney[playerid], tdstring);
           
PlayerTextDrawShow(playeridWMoney[playerid]);
           
SetTimerEx("HideWM"7000true"i"playerid);
        
GivePlayerMoney(playerid10000);
        
IncreaseScore(playerid2);
        
AccountInfo[ID][pJailTime] = 80 ;
        
AccountInfo[ID][pJailed] = ;
        
SetPlayerInterior(ID10);
        new 
rnd random(sizeof(PrisonSpawn));
        
SetPlayerPos(IDPrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
        
SendClientMessage(playeridCOLOR_GREY"**LOS SANTOS PRISON**");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[PRISON] You have been sent to prison. You will be released soon.");
        
TogglePlayerControllable(ID1);
        
SetPlayerWantedLevel(ID0);
           if(
IsPlayerAttachedObjectSlotUsed(IDi)) RemovePlayerAttachedObject(IDi);
        
SetPlayerSpecialAction(IDSPECIAL_ACTION_NONE);
        
AccountInfo[ID][pCuffed] = ;
        return 
1;
    }
    if(
pwl == 6)
    {
        
format(stringsizeof(string), "Police Officer %s has arrested most wanted suspect %s"PlayerInfo(playerid), PlayerInfo(ID));
        
SendClientMessageToAll(COLOR_BLUEstring);
        
CNR_PrintString(string);
        
format(stringsizeof(string), "[POLICE RADIO] Suspect %s has been sent to jail"PlayerInfo(ID));
        
SendCopMessage(string);
        new 
tdstring[120];
        
format(tdstringsizeof(tdstring), "~g~+~g~~h~$~g~~h~~h~~h~20,000");
        
PlayerTextDrawSetString(playeridWMoney[playerid], tdstring);
           
PlayerTextDrawShow(playeridWMoney[playerid]);
           
SetTimerEx("HideWM"7000true"i"playerid);
        
GivePlayerMoney(playerid20000);
        
IncreaseScore(playerid2);
        
AccountInfo[ID][pJailTime] = 100 ;
        
AccountInfo[ID][pJailed] = ;
        
SetPlayerInterior(ID10);
        new 
rnd random(sizeof(PrisonSpawn));
        
SetPlayerPos(IDPrisonSpawn[rnd][0], PrisonSpawn[rnd][1], PrisonSpawn[rnd][2]);
        
SendClientMessage(playeridCOLOR_GREY"**LOS SANTOS PRISON**");
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"[PRISON] You have been sent to prison. You will be released soon.");
        
TogglePlayerControllable(ID1);
        
SetPlayerWantedLevel(ID0);
           if(
IsPlayerAttachedObjectSlotUsed(IDi)) RemovePlayerAttachedObject(IDi);
        
SetPlayerSpecialAction(IDSPECIAL_ACTION_NONE);
        
AccountInfo[ID][pCuffed] = ;
        return 
1;
    }
    return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)