[HELP] undefined symbol "playerid"
#1

I add this code;

Код:
Timer:SpeedoCheck[1000](playerid)
{
    	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PlayerInfo[playerid][pSpeedoOn] == 1) {
		new veh = GetPlayerVehicleID(playerid);
	    new Float:Speed = GetVehicleSpeed(veh, 0);
	    new string[128];

		if(!IsABicycle(veh))
		{
			format(string,sizeof(string),"~b~HIZ:~n~~w~%d MPH~n~~g~BENZIN: ~w~%.2f",floatround(Speed/1.609),Gas[veh]);
			PlayerTextDrawSetString(playerid,SpeedoText0,string);
		}
	}
	return 1;
}

Timer:CheckGas[5000](playerid)
{
    if(!IsPlayerNPC(playerid)) {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            new Float:x,Float:y,Float:z;
            new vehicle = GetPlayerVehicleID(playerid);
            if(!IsABicycle(vehicle)) {
                GetPlayerPos(playerid, x, y, z);
                new Float:Speed = GetVehicleSpeed(vehicle, 0);
                if(IsAPlane2(vehicle)) {
                    if(Gas[vehicle] >= 1) {
                        if(floatround(Speed/1.609) < 100 && floatround(Speed/1.609) > 0) {
                            Gas[vehicle]-=1.0;
                        }
                        if(floatround(Speed/1.609) > 100 && floatround(Speed/1.609) < 110) {
                            Gas[vehicle]-=1.2;
                        }
                        if(floatround(Speed/1.609) > 110 && floatround(Speed/1.609) < 120) {
                            Gas[vehicle]-=1.4;
                        }
                        if(floatround(Speed/1.609) > 120) {
                            Gas[vehicle]-=1.6;
                        }
                        if(Gas[vehicle] < 0) {
                            Gas[vehicle] =0.0;
						}
                    }
                    else
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective;
				        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
				        if(engine == 1)
				        {
				            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
						}
					}
				}
				else if(IsACDLTruck(vehicle))
				{
				    if(Gas[vehicle] >= 1) {
                        if(floatround(Speed/1.609) > 0 && floatround(Speed/1.609) < 30) {
                            Gas[vehicle]-=0.2;
                        }
                        if(floatround(Speed/1.609) >= 30 && floatround(Speed/1.609) < 40) {
                            Gas[vehicle]-=0.4;
                        }
                        if(floatround(Speed/1.609) >= 40 && floatround(Speed/1.609) < 50) {
                            Gas[vehicle]-=0.6;
                        }
                        if(floatround(Speed/1.609) >= 50) {
                            Gas[vehicle]-=0.8;
                        }
                        if(Gas[vehicle] < 0) {
                            Gas[vehicle] =0.0;
						}
                    }
                    else
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective;
				        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
				        if(engine == 1)
				        {
				            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
				            SendClientMessageEx(playerid, COLOR_GRAD2, " Aracınızın benzini bittiği iзin motor durduruldu!");
						}
					}
				}
				else
				{
				    if(Gas[vehicle] >= 1) {
                        if(floatround(Speed/1.609) < 100 && floatround(Speed/1.609) > 0) {
                            Gas[vehicle]-=0.2;
                        }
                        if(floatround(Speed/1.609) > 100 && floatround(Speed/1.609) < 110) {
                            Gas[vehicle]-=0.4;
                        }
                        if(floatround(Speed/1.609) > 110 && floatround(Speed/1.609) < 120) {
                            Gas[vehicle]-=0.6;
                        }
                        if(floatround(Speed/1.609) > 120) {
                            Gas[vehicle]-=0.8;
                        }
                        if(Gas[vehicle] < 0) {
                            Gas[vehicle] =0.0;
						}
                    }
                    else
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective;
				        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
				        if(engine == 1)
				        {
				            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
				            SendClientMessageEx(playerid, COLOR_GRAD2, " Aracınızın benzini bittiği iзin motor durduruldu!");
						}
					}
				}
            }
        }
    }
}
And this errors;

Код:
(113098) : error 017: undefined symbol "playerid"
(113099) : error 017: undefined symbol "playerid"
(113106) : error 017: undefined symbol "playerid"
(113114) : error 017: undefined symbol "playerid"
(113115) : error 017: undefined symbol "playerid"
(113117) : error 017: undefined symbol "playerid"
(113119) : error 017: undefined symbol "playerid"
(113175) : error 017: undefined symbol "playerid"
(113205) : error 017: undefined symbol "playerid"
HOW TO FİX ?
Reply
#2

isnt it
Quote:

timer SpeedoCheck[1000](playerid)

Reply
#3

This now;

Reply
#4

Timer => public
Reply
#5

try to do forward SpeedoCheck[5000](playerid) and then public SpeedoCheck[1000](playerid) not know if works like this 1
pawn Код:
forward SpeedoCheck[1000](playerid)
public SpeedoCheck[1000](playerid)
Reply
#6

Again this error;

Reply
#7

pawn Код:
forward SpeedoCheck(playerid);
forward CheckGas(playerid);

public SpeedoCheck(playerid)
{
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && PlayerInfo[playerid][pSpeedoOn] == 1) {
        new veh = GetPlayerVehicleID(playerid);
        new Float:Speed = GetVehicleSpeed(veh, 0);
        new string[128];

        if(!IsABicycle(veh))
        {
            format(string,sizeof(string),"~b~HIZ:~n~~w~%d MPH~n~~g~BENZIN: ~w~%.2f",floatround(Speed/1.609),Gas[veh]);
            PlayerTextDrawSetString(playerid,SpeedoText0,string);
        }
    }
    return 1;
}

public CheckGas(playerid)
{
    if(!IsPlayerNPC(playerid)) {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
            new Float:x,Float:y,Float:z;
            new vehicle = GetPlayerVehicleID(playerid);
            if(!IsABicycle(vehicle)) {
                GetPlayerPos(playerid, x, y, z);
                new Float:Speed = GetVehicleSpeed(vehicle, 0);
                if(IsAPlane2(vehicle)) {
                    if(Gas[vehicle] >= 1) {
                        if(floatround(Speed/1.609) < 100 && floatround(Speed/1.609) > 0) {
                            Gas[vehicle]-=1.0;
                        }
                        if(floatround(Speed/1.609) > 100 && floatround(Speed/1.609) < 110) {
                            Gas[vehicle]-=1.2;
                        }
                        if(floatround(Speed/1.609) > 110 && floatround(Speed/1.609) < 120) {
                            Gas[vehicle]-=1.4;
                        }
                        if(floatround(Speed/1.609) > 120) {
                            Gas[vehicle]-=1.6;
                        }
                        if(Gas[vehicle] < 0) {
                            Gas[vehicle] =0.0;
                        }
                    }
                    else
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                        if(engine == 1)
                        {
                            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
                        }
                    }
                }
                else if(IsACDLTruck(vehicle))
                {
                    if(Gas[vehicle] >= 1) {
                        if(floatround(Speed/1.609) > 0 && floatround(Speed/1.609) < 30) {
                            Gas[vehicle]-=0.2;
                        }
                        if(floatround(Speed/1.609) >= 30 && floatround(Speed/1.609) < 40) {
                            Gas[vehicle]-=0.4;
                        }
                        if(floatround(Speed/1.609) >= 40 && floatround(Speed/1.609) < 50) {
                            Gas[vehicle]-=0.6;
                        }
                        if(floatround(Speed/1.609) >= 50) {
                            Gas[vehicle]-=0.8;
                        }
                        if(Gas[vehicle] < 0) {
                            Gas[vehicle] =0.0;
                        }
                    }
                    else
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                        if(engine == 1)
                        {
                            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
                            SendClientMessageEx(playerid, COLOR_GRAD2, " Aracinizin benzini bittigi iзin motor durduruldu!");
                        }
                    }
                }
                else
                {
                    if(Gas[vehicle] >= 1) {
                        if(floatround(Speed/1.609) < 100 && floatround(Speed/1.609) > 0) {
                            Gas[vehicle]-=0.2;
                        }
                        if(floatround(Speed/1.609) > 100 && floatround(Speed/1.609) < 110) {
                            Gas[vehicle]-=0.4;
                        }
                        if(floatround(Speed/1.609) > 110 && floatround(Speed/1.609) < 120) {
                            Gas[vehicle]-=0.6;
                        }
                        if(floatround(Speed/1.609) > 120) {
                            Gas[vehicle]-=0.8;
                        }
                        if(Gas[vehicle] < 0) {
                            Gas[vehicle] =0.0;
                        }
                    }
                    else
                    {
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(vehicle,engine,lights,alarm,doors,bonnet,boot,objective);
                        if(engine == 1)
                        {
                            SetVehicleParamsEx(vehicle,0,lights,alarm,doors,bonnet,boot,objective);
                            SendClientMessageEx(playerid, COLOR_GRAD2, " Aracinizin benzini bittigi iзin motor durduruldu!");
                        }
                    }
                }
            }
        }
    }
}
Reply
#8

I will add where this code ?

Код:
SetTimerEx("SpeedoCheck", 4000, 0, "d", playerid);

SetTimerEx("CheckGas", 4000, 0, "d", playerid);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)