31.01.2014, 11:40
I want this script to do not 1 random cmd
I want to give cash or guns or something else, how to do it ?
I want to give cash or guns or something else, how to do it ?
switch (random(4))
{
case 0: GivePlayerMoney(playerid, 500);
case 1: GivePlayerWeapon(playerid, 24, 1000);
case 2: GivePlayerWeapon(playerid, 34, 1000);
case 3:
{
// something else..
}
}
CMD:getmoney(playerid,params[]) { new money = random(10000); GivePlayerMoney(playerid,money); }
CMD:getsomething(playerid,params[]) { switch (random(2)) { case 0: GivePlayerMoney(playerid, 500); case 1: GivePlayerWeapon(playerid, 24, 1000); case 2: GivePlayerWeapon(playerid, 34, 1000); } // Means that it will random those 3 cases, if its 1 then it will give the player 500, if its 2 then it'll give a weapon, etc. // based on Konstantionos code.