#1

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 !
Reply
#2

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
Reply
#3

i meant that i want to freeze player when he enters checkpoint
Reply
#4

Use, TogglePlayerControllable(playerid, 1); for it
Reply
#5

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;
}
Reply
#6

bumb
Reply
#7

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.
Reply
#8

Solved
Thnx for your Help Mates
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)