12.09.2009, 20:20
Well, I don't like to say that, but how do I call the function whenever a player presses the button to enter/exit vehicle?
I looked at this and this, but I don't understand it...
Here are the complete functions again:
I looked at this and this, but I don't understand it...
Here are the complete functions again:
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(RaceParticipant[playerid] == 4)
{
if (EnableRespawn == 1)
{
new model = (GetVehicleModel(vehicleid));
SetPlayerHealth(playerid, 100.0);
SetRaceCheckpoint(playerid, CurrentCheckpoint[playerid],CurrentCheckpoint[playerid]+1);
DestroyVehicle(vehicleid);
SetPlayerPos(playerid, lastCPx, lastCPy, lastCPz);
new currentvehicleID = CreateVehicle(model, lastCPx, lastCPy, lastCPz, lastCPa, 2, 4, 600);
PutPlayerInVehicle(playerid, currentvehicleID, 0);
RespawnTimer = SetTimer("RespawnFreeze", RespawnDelay, false);
TogglePlayerControllable(playerid,0);
}
}
return 1;
}
public RespawnFreeze(playerid)
{
TogglePlayerControllable(playerid,1);
KillTimer(RespawnTimer);
}