Need help with a function
#8

Oke after a lot of fail's, I've managed to get the script working...
...there is jsut one thing that doesn't work. The player should be frozen for a specific amount of time. This works, but he isn't unfrozen after that time.
Here what I put on top of the script:
pawn Код:
new RespawnDelay = 100;   //The time the player will be frozen after respawned in ms.
new RespawnTimer;            //DO NOT CHANGE!!!
And here the functions:
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
if(RaceParticipant[playerid] == 4)
{
  if (EnableRespawn == 1)
  {
        new model = (GetVehicleModel(vehicleid));
        SetPlayerHealth(playerid, 100.0);
        SetRaceCheckpoint(playerid, CurrentCheckpoint[playerid]-1 ,CurrentCheckpoint[playerid]);
        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;
}

stock RespawnFreeze(playerid)
{
    TogglePlayerControllable(playerid,1);
    KillTimer(RespawnTimer);
}
Everything else works fine.
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)