Random Numbers
#7

Quote:
Originally Posted by LarzI
Посмотреть сообщение
You would have to store the number of players registered in a file, read it when registering a player, and set his number to the number of players register + 1.

I bet you know how to save that to a file, so here's how you would save it
In this example, "pRegs" is the function
you would use to store the information from the file
pawn Код:
//put this globally
new regNum[ MAX_PLAYERS ][ 7 ]; //7 cells for #XXXXX

//registration
format( regNum[ playerid ], 7, "#%05i", ( pRegs + 1 ));
The string regNum would now contain - if there were 5 players registered - "#00006"

Remember to save the new number of registered players after a player registeres.
Wait, I still don't get it of how to code it ? Show me an example at OnPlayerConnect
Reply


Messages In This Thread
Random Numbers - by Zex Tan - 21.12.2012, 12:41
Re: Random Numbers - by LarzI - 21.12.2012, 13:05
Re: Random Numbers - by Zex Tan - 21.12.2012, 13:12
Re: Random Numbers - by LarzI - 21.12.2012, 13:19
Re: Random Numbers - by Zex Tan - 21.12.2012, 13:32
Re: Random Numbers - by LarzI - 21.12.2012, 13:37
Re: Random Numbers - by Zex Tan - 19.01.2013, 00:54

Forum Jump:


Users browsing this thread: 1 Guest(s)