Command help
#1

So what this command does it allows a player to pay money for remowing his wanted level in a police station.But the thing is the command is set to check if atleast 1 police officer is online to allow a player to pay his wanted level.I want to set it that a player can pay his wanted level even if a police officer is not online,how can i do that,what do i need to change?? Help
PHP код:
COMMAND:kazna(playerid,params[])
{
    if (
APlayerData[playerid][LoggedIn] == true && GetPlayerWantedLevel(playerid) > 0)
    {
        new 
Pronasao 0;
        new 
Policajaca 0;
        new 
Cijena 0;
        new 
Puna 0;
    
        for (new 
05i++)
        {
            new 
Float:XFloat:YFloat:Z;
            
GetObjectPos(PolicijskeKazne[i], XYZ);
        
            if (
IsPlayerInRangeOfPoint(playerid2.5XYZ))
            {
                
Pronasao 1;
            }
         }
     
         if(
Pronasao == 0) return 0;
     
     
         for (new 
0MAX_PLAYERSi++)
        {
            if(
IsPlayerConnected(i) && !IsPlayerNPC(i) && APlayerData[i][PlayerClass] == ClassPolice){
             
Policajaca Policajaca 1;
            }
        }
     
     
        
Cijena = ((GetPlayerWantedLevel(playerid) * 1000) / Policajaca) / 2;
        
Cijena floatround(Cijenafloatround_round);
        
Puna Cijena Policajaca;
        
    
        new 
Linija[128], Nadimak[MAX_PLAYER_NAME];
        
GetPlayerName(playeridNadimaksizeof(Nadimak));
        
format(Linijasizeof(Linija), "Igrac %s je platio jamcevinu za svoje prekrsaje. Dobio si %i$."NadimakCijena);
    
    
        for (new 
0MAX_PLAYERSi++)
        {
              if(
IsPlayerConnected(i) && !IsPlayerNPC(i) && APlayerData[i][PlayerClass] == ClassPolice){
                
APlayerData[i][PlayerMoney] = APlayerData[i][PlayerMoney] + Cijena;
                   
SendClientMessage(i0xFFFFFFLinija);
            }
         }
    
    
        
APlayerData[playerid][PlayerMoney] = APlayerData[playerid][PlayerMoney] - Puna;
        
PostaviWantedLevel(playerid0);
    
    
    
        new 
LinijaZ[128];
        
format(LinijaZsizeof(LinijaZ), "Uspjesno si platio svoju jamcevinu u iznosu od %i$. Pokusaj smanjiti prekrsaje sljedeci put."Puna);
        
SendClientMessage(playerid0xFFFFFFLinijaZ);
    
        return 
1;
    }
    return 
0;

Reply


Messages In This Thread
Command help - by NexySamp - 26.07.2015, 23:37
Re: Command help - by TwinkiDaBoss - 27.07.2015, 00:32
Re: Command help - by TwinkiDaBoss - 27.07.2015, 00:45

Forum Jump:


Users browsing this thread: 1 Guest(s)