help - 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: help (
/showthread.php?tid=601654)
Checkpoint Help -
Shaheen - 24.02.2016
Hello Guys,
I need some Help i am currently scripting a Server.. so i have some doubts about scripting..
when a player is doing job he enters the checkpoint to load so my question is how to make checkpoint freeze for 5-10 seconds for loading goods ?
Thnx in advance !
Re: help -
BiosMarcel - 24.02.2016
what exactly do u mean? Do u mean put a timer between the checkpoint entering and the object spawn? if thats what u mean use
https://sampwiki.blast.hk/wiki/SetTimer
Re: help -
Shaheen - 24.02.2016
i meant that i want to freeze player when he enters checkpoint
Re: help -
saffierr - 24.02.2016
Use, TogglePlayerControllable(playerid, 1); for it
Re: help -
Shaheen - 25.02.2016
i will show the codes plz can u set it correct ??
Код:
public OnPlayerEnterCheckpoint(playerid) {
switch(MissionStage[playerid]) {
case STAGE_LOAD: {
new
rand = random(sizeof gDeliverCPs)
;
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~Passengers Boarding !~g~", 5000, 0);
SetPlayerCheckpoint(playerid, gDeliverCPs[rand][0], gDeliverCPs[rand][1], gDeliverCPs[rand][2], 10.0);
MissionStage[playerid] = STAGE_UNLOAD;
}
case STAGE_UNLOAD: {
DisablePlayerCheckpoint(playerid);
GameTextForPlayer(playerid, "~g~Passengers UnLoading !~g~", 5000, 0);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 1);
GivePlayerMoney(playerid, 5000);
MissionStage[playerid] = STAGE_IDLE;
}
}
return false;
}
Re: help -
Shaheen - 25.02.2016
bumb
Re: help -
-CaRRoT - 25.02.2016
Its pretty simple but it won't help you to just provide the code.
What you need to do is to freeze the player once he enters the checkpoint [
https://sampwiki.blast.hk/wiki/Function...rControllable], then create a simple 5-10 seconds timer and run it once the player enter the checkpoint right after you freeze him, [
https://sampwiki.blast.hk/wiki/SetTimerEx] then unfreeze the player once the timer runs out.
Re: help -
Shaheen - 26.02.2016
Solved
Thnx for your Help Mates