SA-MP Forums Archive
"undefined symbol "playerid"" - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: "undefined symbol "playerid"" (/showthread.php?tid=444723)



"undefined symbol "playerid"" - Grooty - 18.06.2013

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);
	      }
	   }
	}



Re: "undefined symbol "playerid"" - Sandiel - 18.06.2013

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


Re: "undefined symbol "playerid"" - Grooty - 18.06.2013

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


Re: "undefined symbol "playerid"" - DobbysGamertag - 18.06.2013

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?


Re: "undefined symbol "playerid"" - Grooty - 18.06.2013

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...


Re: "undefined symbol "playerid"" - Grooty - 18.06.2013

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 :/


Re: "undefined symbol "playerid"" - Grooty - 18.06.2013

Bump, sorry but I really need to fix badly.


Re: "undefined symbol "playerid"" - SwisherSweet - 18.06.2013

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


Re: "undefined symbol "playerid"" - dannyk0ed - 18.06.2013

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



Re: "undefined symbol "playerid"" - Grooty - 18.06.2013

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?


Re: "undefined symbol "playerid"" - dannyk0ed - 18.06.2013

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)



Re: "undefined symbol "playerid"" - Grooty - 18.06.2013

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