[HELP] Error
#1

What gives me this error? I do not understand...


Код:
error 017: undefined symbol "playerid"
pawn Код:
public timer_fuel_lower()
{
    new vehicle = GetPlayerVehicleID(playerid);
    if(Engine[vehicle] == 1)
    {
    for(new i=0;i<MAX_PLAYERS;i++) { //loop for all players
        if (isrefuelling[i]) continue; //stop when a player is already refuelling
        new vid = GetPlayerVehicleID(i); //getting vehicle ID
        if (GetPlayerVehicleSeat(i) == 0) { //if the player is a driver (it should only lower the fuel when theres an driver!)
            fuelcar[vid] = fuelcar[vid] -1; //lowering fuel value
            if (fuelcar[vid]<1) //if fuel is empty
            {
                fuelcar[vid] = 0; //setting fuel to 0 (else the timer will set it to -1 -2 -3 etc before removing player)
                RemovePlayerFromVehicle(i); //remove player out of vehicle
                GameTextForPlayer(i,"~r~Ai ramas fara~w~benzina~r~!",5000,4); //show text
            }
        }
        new string[125];format(string,sizeof string,"Benzina:%i",fuelcar[vid]); //preparing string with next fuel value
        TextDrawSetString(td_fuel[i],string); //updating textdraw
    }
    }
    return 1;
}
Reply
#2

change public timer_fuel_lower() to public timer_fuel_lower(playerid)
and change forward timer_fuel_lower() to forward timer_fuel_lower(playerid)
Reply
#3

Quote:
Originally Posted by Eth
Посмотреть сообщение
change public timer_fuel_lower() to public timer_fuel_lower(playerid)
and change forward timer_fuel_lower() to forward timer_fuel_lower(playerid)
^
+
Change the "SetTimer" to "SetTimerEx";
Information about SetTimerEx here
So, it should look like;
pawn Код:
SetTimerEx("timer_fuel_lower", /*time*/, /*repeating*/, "i", playerid);
                             //Time in MS..Repeating (0/1)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)