Posts: 86
Threads: 41
Joined: Oct 2012
Reputation:
0
Hello, how can i give the player random weapons every time he spawn?
Like every time a new weapons in Cases?
I can't find any tutorial
Posts: 86
Threads: 41
Joined: Oct 2012
Reputation:
0
How could the player take the random weapons?
I mean like he take 5 weapons, Every time he spawn he take new one
Posts: 1,504
Threads: 109
Joined: Jan 2012
pawn Код:
new RandomWeap[][4] =
{
{WEAPON_MP5},
{WEAPON_M4},
{WEAPON_SHOTGUN}
// you can keep adding more just have to change the "[4]" to the number you have defined +1
};
public OnPlayerSpawn(playerid)
{
new rand = random(sizeof(RandomWeap));
GivePlayerWeapon(playerid, RandomWeap[rand][0], ammo); //change "ammo" to the amount of ammo you want
GivePlayerWeapon(playerid, RandomWeap[rand][1], ammo); //change "ammo" to the amount of ammo you want
GivePlayerWeapon(playerid, RandomWeap[rand][2], ammo); //change "ammo" to the amount of ammo you want
return 1;
}
Not sure if it'll work though, test it.