[Help]Not sure how to script this
#1

How can i make a timed spawn like a spawn time so when you try to spawn after like if you come late it will send you to spectating and how do i make a score board(textdraw) of the remaining players of the tdm that are still alive.
Reply
#2

Just return 0 under OnPlayerRequestSpawn to make them not be able to spawn for a specified reason.
Reply
#3

you can make a variable and a timer for the spawning part..

at top of script:

Код:
CanSpawn[MAX_PLAYERS];
OnPlayerConnect:

Код:
CanSpawn(playerid) = 1;
OnPlayerRequestSpawn:

Код:
if(CanSpawn == 0)
{
SendClientMessage(playerid,color,"You cannot spawn yet!");
return 0;
}
OnPlayerDeath:

Код:
CanSpawn = 0;
Then add a timer on onplayerdeath for the amount of secs you want and make the timer change canspawn to 1 so they can spawn
Reply
#4

Quote:
Originally Posted by [TPG
Coole210 ]
you can make a variable and a timer for the spawning part..

at top of script:

Код:
CanSpawn[MAX_PLAYERS];
OnPlayerConnect:

Код:
CanSpawn(playerid) = 1;
OnPlayerRequestSpawn:

Код:
if(CanSpawn == 0)
{
SendClientMessage(playerid,color,"You cannot spawn yet!");
return 0;
}
OnPlayerDeath:

Код:
CanSpawn = 0;
Then add a timer on onplayerdeath for the amount of secs you want and make the timer change canspawn to 1 so they can spawn
But i want to make it so if they come late they can't spawn till gamemode is over and just spectate some players. Not timed for when they can spawn. Anyways thanks for that script.
Reply
#5

Okay make 3 timers

1 30 mins for example (gamemode ends)

1 27 mins for example (setting a variable to 1 meaning the 3rd timer can be activated)

1 3 mins for example (Making all people that connect & spawn wait 3 minutes in spectating mode)



Reply
#6

okay.. where do i put the timers? could you post an example please :O
Reply
#7

Код:
new gmend;
new gmlate;
new cantspawn;
then set the gmend timer in ongamemodeinit make a forward & public function for it

set gmlate timer at ongamemodeinit and do the same as gmend but just set a variable in it

set cantspawn timer when the variable in gmlate is activated

Need any further help about timers? Use the good old sa-mp wiki:

Reply
#8

ya i got that i need a timer but when i put time example:
new Timer;
Код:
public GameModeInit()
{
    SetTimer("Timer", 30000, 0);
}

public Timer()
{
  TogglePlayerSpectating(playerid, 1);
  PlayerSpectatePlayer(playerid, killerid);
}
then when timer runs out it just turns to spectating(not sure what variable to put)
Reply
#9

bumb
Reply
#10

help me please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)