#1

hello
I need command that selects a random player from the server and gives him a random amount of money
Reply
#2

Use Iter_Random function from y_iterate to get random player ids.
Use Random function to get random integer value that can be used as random amount of money
Use GivePlayerMoney to give money to that player
Reply
#3

De obicei nu ofer cod pe tava oamenilor, astept sa vad ce au facut ei, abea dupa le ofer ceva.
Data viitoare incearca sa faci tu ceva, dupa sa vi si sa ceri.

Poftim urmatorul cod( ai nevoie de y_iterate pentru a merge ):
Apropo sa updatezi in functie de procesorul de comenzi pe care il folosesti, comanda este facuta pe YCMD.

Код:
YCMD:randomgive(playerid, params[], help)
{
	new
		randomPlayer = Iter_Random(Player),
		randomSum    = 1000 + random(9555);

	GivePlayerMoney(randomPlayer, randomSum);
	return 1;
}
The randomPlayer variable selects a random player from the server.
Variabila randomSum ofera o suma random de bani jucatorului. 1000$ ii primeste clar, si o suma random din 9555$.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)