03.10.2013, 22:26
how to give random gun onplayerspawn? with some prohibited weapons like. flame thrower,granede, minigun, rocket. rocket seaker. thanks!
new x = random(5);
switch(x)
{
case 0:
{
//Weapon1
//Weapon2
//Weapon3
//Weapon4
}
case 1:
{
//Weapon1
//Weapon2
//Weapon3
//Weapon4
}
case 2:
{
//Weapon1
//Weapon2
//Weapon3
//Weapon4
}
case 3:
{
//Weapon1
//Weapon2
//Weapon3
//Weapon4
}
case 4:
{
//Weapon1
//Weapon2
//Weapon3
//Weapon4
}
}
public OnPlayerSpawn(playerid)
{
GivePlayerWeapon(playerid, (random(35 - 22) + 22), 500);
return 1;
}
new x = random(5); switch(x) { case 0: { GivePlayerWeapon(playerid, 26, 64); // Give the player a sawn-off shotgun, with 64 ammo. } case 1: { GivePlayerWeapon(playerid, 24, 64); // Give the player a deagle, with 64 ammo. } case 2: { GivePlayerWeapon(playerid, 27, 64); // Give the player a spas(combat shotgun), with 64 ammo. } case 3: { GivePlayerWeapon(playerid, 21, 64); // Give the player an M-4, with 64 ammo. } case 4: { GivePlayerWeapon(playerid, 30, 64); // Give the player an AK-47, with 64 ammo. } }