"undefined symbol "playerid""
#1

It says undefined for playerid, here's the whole script paragraph.

Code:
Timer:VehicleUpdate[15000]()
{
    new engine,lights,alarm,doors,bonnet,boot,objective,modelid;
    for(new v = 0; v < MAX_VEHICLES; v++) if(GetVehicleModel(v)) {

		modelid = GetVehicleModel(v);
	    GetVehicleParamsEx(v,engine,lights,alarm,doors,bonnet,boot,objective);
		switch(modelid) {
			case 520, 476, 593, 553, 513, 512, 577, 592, 511, 539, 464, 519: VehicleFuel[v] = 100;
			case 509, 481, 510: VehicleFuel[v] = 100, arr_Engine{v} = 1, SetVehicleParamsEx(v,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
		}
	    if(engine == VEHICLE_PARAMS_ON) {
			if(VehicleFuel[v] > 0.0 && !IsVIPcar(v) && !IsATruckerCar(v))
			{
				VehicleFuel[v]-=0.01;
				
				format(erpstring, sizeof(erpstring), "%.2f GAL", VehicleFuel[v]);
				
(it's on this line)		TextDrawSetString(FuelText[playerid],erpstring);
				
				if(VehicleFuel[v] <= 0.0) SetVehicleParamsEx(v,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
			}
			if(arr_Engine{v} == 0) SetVehicleParamsEx(v,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
	      }
	   }
	}
Reply
#2

You don't have playerid set in your parameter. Just add it there 'VehicleUpdate[15000](playerid)'
Reply
#3

Quote:
Originally Posted by Sandiel
View Post
You don't have playerid set in your parameter. Just add it there 'VehicleUpdate[15000](playerid)'
Thanks!

I'll +rep you when I get 50 posts :3
Reply
#4

Find the timer. Check if its a SetTimerEx("Name",time,"something",playerid);

then add playerid

Otherwise, using a timer that method will only work on ID 0 won't it?
Reply
#5

Quote:
Originally Posted by Sandiel
View Post
You don't have playerid set in your parameter. Just add it there 'VehicleUpdate[15000](playerid)'
Didn't work...
Reply
#6

Quote:
Originally Posted by DobbysGamertag
View Post
Find the timer. Check if its a SetTimerEx("Name",time,"something",playerid);

then add playerid

Otherwise, using a timer that method will only work on ID 0 won't it?
Can't find the SetTimerEx either :/
Reply
#7

Bump, sorry but I really need to fix badly.
Reply
#8

new engine,lights,alarm,doors,bonnet,boot,objective,mo delid,playerid;
or just global define it.
Reply
#9

pawn Code:
Timer:VehicleUpdate[MAX_PLAYERS];//Add this anywhere at the top of your script...
Timer:VehicleUpdate[10000](playerid) Then add this to define the timer for the Playerid
Reply
#10

Quote:
Originally Posted by dannyk0ed
View Post
pawn Code:
Timer:VehicleUpdate[10000](playerid, vehicleid) Then add this to define the timer for the Player and Vehicle ID
So where do I put this??
Do I replace that Timer I have posted on this thread with that one?
Reply
#11

Quote:
Originally Posted by Grooty
Посмотреть сообщение
So where do I put this??
Do I replace that Timer I have posted on this thread with that one?
Yes.
pawn Код:
Timer:VehicleUpdate[10000](playerid)
Reply
#12

Quote:
Originally Posted by dannyk0ed
Посмотреть сообщение
Yes.
pawn Код:
Timer:VehicleUpdate[10000](playerid)
Now I get the same error, AND this one.

C:\Users\Administrator\Desktop\PLA\gamemodes\pla.p wn(2245) : error 010: invalid function or declaration
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)