Need help with a function
#11

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