10.02.2011, 05:16
Does anyone no how to make so when u enter a dm u spawn with randoms weapons (3 or 4weapons)
new wep = random(40);
GivePlayerWeapon(playerid, wep, 200);
switch( random( 4 ) ) // random 0 - 3
{
case 0: //random was 0.. give them a set of weapons
{
GivePlayerWeapon(...);
GivePlayerWeapon(...);
GivePlayerWeapon(...);
}
case 1: //random was 1 so give them a different set of weapons
{
GivePlayerWeapon(...);
GivePlayerWeapon(...);
GivePlayerWeapon(...);
}
case 2: //random was 2 so give them a different set of weapons
{
GivePlayerWeapon(...);
GivePlayerWeapon(...);
GivePlayerWeapon(...);
}
case 3: //random was 3 so give them a different set of weapons (You get the idea)
{
GivePlayerWeapon(...);
GivePlayerWeapon(...);
GivePlayerWeapon(...);
}
}
//define the random weapons you want to give here...
new const PossibleRandomWeapons[4][2] =
{
{24, 100}, //DEagle
{25, 150}, //Shotgun
{18, 4}, //Molotov
{16, 4} //Grenade
};
//give the random weapons with this code...
new r = random(sizeof(PossibleRandomWeapons));
GivePlayerWeapon(playerid, PossibleRandomWeapons[r][0], PossibleRandomWeapons[r][1]);