randomly
#1

how to go through all the players playing in the server and give randomly any one a prize.

do you know ?
Reply
#2

maybe this can help you
http://pastebin.com/5f0pjpWB
it's a old script : not mine
Reply
#3

umm no.. :/
Reply
#4

Example:
PHP код:
stock giftsystem(playerid)
{
        new 
rand random(6);
        switch(
rand)
        {
                case 
0:
                {
                
GiveDodMoney(playerid5000);
                 
SendClientMessage(playeridCOLOR_YELLOW,"*You gained random reward - $5000*");
                }
                case 
1:
                {
                
PlayerInfo[playerid][pMaterials] += 5000;
                 
SendClientMessage(playeridCOLOR_YELLOW,"*You gained random reward - 5000 Materials*");
                }
                case 
2:
                {
                
GiveDodWeapon(playerid2799999);
                 
SendClientMessage(playeridCOLOR_YELLOW,"*You gained random reward - SPAS*");
                }
                case 
3:
                {
                
GiveDodWeapon(playerid3199999);
                 
SendClientMessage(playeridCOLOR_YELLOW,"*You gained random reward - M4*");
                }
                case 
4:
                {
                
PlayerInfo[playerid][pcocaine] += 10;
                 
SendClientMessage(playeridCOLOR_YELLOW,"*You gained random reward - 10 grams of Cocaine*");
                }
                case 
5:
                {
                
PlayerInfo[playerid][pWeed] += 30;
                 
SendClientMessage(playeridCOLOR_YELLOW,"*You gained random reward - 30 grams of Weed*");
                }
        }

Reply
#5

I will try foreach.

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)