How to make, wait for other player to join ?
#1

Hi,
i am making a race with check points, now i made /race to join the race, but how to make the player wait, until other player join. any idea ? please answer me with a reply, thanks

regards Dipto
Reply
#2

Not too sure what you're asking.

You're trying to make it so you need more than 1 player to begin a race? That's quite easy. Simply create a variable. And once the variable turns to 2 begin the race.

pawn Код:
new pcount; //Just raise this variable when someone joins the race lobby. To raise it simply do pcount++;
Once the pcount hits 2, begin the race. You can check if it's 2 or not with timers. https://sampwiki.blast.hk/wiki/SetTimer

If you need more assistance, let me know.
Reply
#3

You can make it like when someone join the race the raceplayers will get +1 so add this under your /race:
pawn Код:
raceplayers ++:
And add this near the other news...
pawn Код:
new raceplayers = 0:
And if you want the race to start ,just add
pawn Код:
if(raceplayers >=2)
{
    The code
}
Reply
#4

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
Not too sure what you're asking.

You're trying to make it so you need more than 1 player to begin a race? That's quite easy. Simply create a variable. And once the variable turns to 2 begin the race.

pawn Код:
new pcount; //Just raise this variable when someone joins the race lobby. To raise it simply do pcount++;
Once the pcount hits 2, begin the race. You can check if it's 2 or not with timers. https://sampwiki.blast.hk/wiki/SetTimer

If you need more assistance, let me know.
yo, u helped me so much, as i m new to scripting
Reply
#5

Not a problem. I know how it feels to be new. Quite overwhelming.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)