Need help with a function
#1

Hi,
I'm currently working on an special edition of Yagu's Race Filterscript again, because I lost my old one.
So here is my function:

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
	if(RaceParticipant[playerid]>0)
	{
	if (EnableRespawn == 1)
	{
		new currentvehicle = (GetPlayerVehicleID(playerid));
		new lastCP = (CurrentCheckpoint[playerid]-1);
		DestroyVehicle(currentvehicle);
		SetPlayerHealth(playerid, 0);
		SetRaceCheckpoint(playerid,lastCP,CurrentCheckpoint[playerid]);
		RespawnTimer = SetTimer("RespawnPlayerInVehicle", RespawnDelay, false);
		RespawnPlayerInVehicle(playerid, currentvehicle);
	}
	}
  return 1;
}

stock RespawnPlayerInVehicle(playerid, vehicleid)
{
	new lastCP = (CurrentCheckpoint[playerid]-1);
	SpawnPlayer(playerid);
	SetPlayerPos(playerid, lastCP);
	CreateVehicle(currentvehicle, lastCP, 2, 4, 600);
	PutPlayerInVehicle(playerid, currentvehicle, 0);
	KillTimer(RespawnTimer);
}
I get this error two times:
Undefined symbol "currentvehicle"
Both in the RespawnPlayerInVehicle function.
My problem is to get the variable defined in OnPlayerExitVehicle, into RespawnPlayerInVehicle.
Can it be done, or is there a workarround?
There is a new problem. Look last post...
Reply


Messages In This Thread
Need help with a function - by Vollzeitfan - 12.09.2009, 15:15
Re: Need help with a function - by Zeex - 12.09.2009, 15:41
Re: Need help with a function - by Vollzeitfan - 12.09.2009, 15:55
Re: Need help with a function - by Zeex - 12.09.2009, 16:05
Re: Need help with a function - by Vollzeitfan - 12.09.2009, 16:12
Re: Need help with a function - by Zeex - 12.09.2009, 16:19
Re: Need help with a function - by Vollzeitfan - 12.09.2009, 16:43
Re: Need help with a function - by Vollzeitfan - 12.09.2009, 19:15
Re: Need help with a function - by Zeex - 12.09.2009, 19:30
Re: Need help with a function - by Vollzeitfan - 12.09.2009, 19:47
Re: Need help with a function - by Vollzeitfan - 12.09.2009, 20:20

Forum Jump:


Users browsing this thread: 1 Guest(s)