If you exit a vehicle, it cancels the job. (need help)
#6

Quote:
Originally Posted by Marricio
Посмотреть сообщение
The thing you doing wrong is almost all the code you did show.
You're creating a global var, so if you change something, you aint changing it to the x player.
You know what i mean right? You need to change the var.

Original
pawn Код:
new simplejobrunning = 0;
Fixed
pawn Код:
new simplejobrunning[MAX_PLAYERS] = 0;
You see the difference right?

The way you used to check the var value seemed strange to me, maybe not my way, i changed it, feel free to do what you want from the code.

Original
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if((simplejobrunning) == 1)
    {
        simplejobrunning = 0;
        SendClientMessage(playerid, COLOR_RED, "You're job was canceled due to exiting the Vehicle");

    }else if((simplejobrunning) == 0){

       
 }
}
Possibily Fixed
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(simplejobrunning[playerid] == 1) // this will check the value to 'playerid'
    {
        simplejobrunning[playerid] = 0; // this will change the value to 'playerid'
        SendClientMessage(playerid, COLOR_RED, "You're job was canceled due to exiting the Vehicle");
        DisablePlayerCheckpoint(playerid); // this will dissapear/disable the current player cp
        return 1;
    }
    else if(simplejobrunning[playerid] == 0)
    {
        return 1;
    }
    return 1;
}
You see the difference right?

This is not tested, but compiled, dont blame me if it doesn't works.

Good luck
It doesn't work in-game. Is something wrong with it? I've checked, but I'm not really sure.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 4 Guest(s)