temp variable, not 0 even if defined
#3

Alright, so I made it:

pawn Код:
new pTruckLoaded[MAX_PLAYERS] = 0;
new pCheckpoint[MAX_PLAYERS] = 0;
and edited the /loadtruck to:
pawn Код:
CMD:loadtruck(playerid, params[]) {
    if(pInfo[playerid][pJob] == 1){
    if(IsVehicleTruck(GetPlayerVehicleID(playerid))){ // Checks if you are inside a truck.
    if(IsPlayerInRangeOfPoint(playerid, 5, 2197.8425,-2662.9883,13.5469)) { // Checks if you are close enough to the loading point.
    if(pTruckLoaded[playerid] == 0 && pCheckpoint[playerid] == 0){
    CountDownCheck10(playerid); // calls the script to start the timer to load the truck
    } else return SendClientMessage(playerid, COLOR_WHITE, "You are not a trucker.");
    } else return SendClientMessage(playerid, COLOR_WHITE, "You are not in an Ocean Dock truck.");
    } else return SendClientMessage(playerid, COLOR_WHITE, "To load the truck, go to the loading garage in Ocean Docks, then /loadtruck.");
    } else return SendClientMessage(playerid, COLOR_WHITE, "You already have an existing checkpoint or trucking route.");
    return 1;
}
It didn't work then either, and so I created a debug command:
pawn Код:
CMD:debugtruck(playerid, params[])
{
new str[50];
format(str, 50, "pTruckLoaded = %i - pCheckpoint = %i", pTruckLoaded, pCheckpoint);
SendClientMessage(playerid, COLOR_WHITE, str);
return 1;
}
and I got this:

and


The script clearly states that if we have 0 on those values, which we had, it would continue, but it didn't.
Reply


Messages In This Thread
temp variable, not 0 even if defined - by Why - 21.07.2012, 23:11
Re: temp variable, not 0 even if defined - by Vince - 21.07.2012, 23:16
Re: temp variable, not 0 even if defined - by Why - 21.07.2012, 23:44
Re: temp variable, not 0 even if defined - by DarrenReeder - 21.07.2012, 23:47
Re: temp variable, not 0 even if defined - by Why - 21.07.2012, 23:48
Re: temp variable, not 0 even if defined - by DarrenReeder - 21.07.2012, 23:49
Re: temp variable, not 0 even if defined - by Why - 22.07.2012, 00:10

Forum Jump:


Users browsing this thread: 2 Guest(s)