Little Explanation
#1

I need explanation with something. So i have my @OnPlayerStateChange:

PHP Code:
    {
        new 
Vozilo GetPlayerVehicleID(playerid);
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(
Vozilo == Autobus[0] || Vozilo == Autobus[1] || Vozilo == Autobus[2] || Vozilo == Autobus[3] || Vozilo == Autobus[4])
            {
                if(
PlayerPosao[playerid][pZaposlen] != 1) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Niste zaposleni kao vozac autobusa"); // This line
                 
else if(PlayerPosao[playerid][pID] != 1) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Niste zaposleni kao vozac autobusa") && RemovePlayerFromVehicle(playerid);
                   {
                     
SendClientMessage(playerid,-1,""COLOR_WG"WG:{FFFFFF} Zapocnite posao:"COLOR_LAGANA" /ruta");
                    
SendClientMessage(playerid,-1,""COLOR_WG"WG:{FFFFFF} Prekinite posao:"COLOR_LAGANA" /prekiniposao");
                }
            }
        }
        return 
1;
    } 
Here you can see a line:

PHP Code:
 if(PlayerPosao[playerid][pZaposlen] != 1) return SendClientMessage(playerid,-1,""COLOR_CRVENA"Greska:{FFFFFF} Niste zaposleni kao vozac autobusa"); 
I need an explanation how could I make this: ...[pZaposlen] != "Potvrda" instead of != 1. I want do to that because when i get job it saves into the ini file "Employed: True" not "Employed: 1"... Any ideas?
Reply
#2

Use a boolean.
Reply
#3

That i know how to use it to get no errors i wouldn't ask this question.
Reply
#4

If its a boolean then you can just do this
PHP Code:
if(PlayerPosao[playerid][pZaposlen])return .... 
But it seems u make it load it as a string, so if its a string then you gotta do this :
PHP Code:
if(strcmp(PlayerPosao[playerid][pZaposlen], "Potvrda") != 0) return ... 
strcmp returns 0 if string matches so we do != 0
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)