how to make random weapons in dm - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: how to make random weapons in dm (
/showthread.php?tid=223680)
how to make random weapons in dm -
[nL]W0rfleR - 10.02.2011
Does anyone no how to make so when u enter a dm u spawn with randoms weapons (3 or 4weapons)
Re: how to make random weapons in dm -
fangoth1 - 10.02.2011
pawn Код:
new wep = random(40);
GivePlayerWeapon(playerid, wep, 200);
Re: how to make random weapons in dm -
On_Top_Non_Stop - 10.02.2011
Add this in your teleport/death match command and fill in what weapons to give the player.
pawn Код:
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(...);
}
}
Re: how to make random weapons in dm -
Mean - 10.02.2011
Quote:
Originally Posted by fangoth1
pawn Код:
new wep = random(40); GivePlayerWeapon(playerid, wep, 200);
|
I don't think that will work...
Use On_Top_Non_Stop's code.
Re: how to make random weapons in dm -
Davz*|*Criss - 10.02.2011
Mean please post the pwn code, so i will help you out on this case
Good luck
Re: how to make random weapons in dm -
Mean - 10.02.2011
Quote:
Originally Posted by Davz*|*Criss
Mean please post the pwn code, so i will help you out on this case
Good luck
|
Ermmm... WHAT ? I didn't ask for any help lal.
Re: how to make random weapons in dm -
BlackWolf120 - 10.02.2011
here you go...
pawn Код:
//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]);
Re: how to make random weapons in dm -
Mean - 10.02.2011
Well, I'd rather go with switch statements. I dno if they are faster, but they are easier to use!
Re: how to make random weapons in dm -
BlackWolf120 - 10.02.2011
switch statements are only faster if there are a lot of possibilities to "switch".
I think it just cant be easier than my code ive posted
Re: how to make random weapons in dm -
Mean - 10.02.2011
Quote:
Originally Posted by BlackWolf120
switch statements are only faster if there are a lot of possibilities to "switch".
I think it just cant be easier than my code ive posted
|
Idk, I am used to use "switch", so it's easier to me,
.