SA-MP Forums Archive
Random Weap Help :) - 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)
+--- Thread: Random Weap Help :) (/showthread.php?tid=434139)



Random Weap Help :) - Giroud12 - 01.05.2013

pawn Код:
new wepsid[5][2] =
{
   {1,100}, // first is the id of the weapon, second is the amount of ammo.
   {2,200}, // first is the id of the weapon, second is the amount of ammo.
   {3,300}, // first is the id of the weapon, second is the amount of ammo.
   {4,400}, // first is the id of the weapon, second is the amount of ammo.
   {5,500} // first is the id of the weapon, second is the amount of ammo.
};

// usage:
new rando = random(sizeof(wepsid)); // making a random function.
GivePlayerWeapon(playerid,wepsid[rando][0],wepsid[rando][1]);
Can i put this at OnDialogResponse?


Re: Random Weap Help :) - Lordzy - 01.05.2013

Quote:
Originally Posted by Giroud12
Посмотреть сообщение
Can i put this at OnDialogResponse?
Why not? - Just the array could be upside or not in a callback, so that if you need to use it for other purpose you can randomize it and use it.


Re: Random Weap Help :) - Giroud12 - 01.05.2013

Thanks, Im making /randomweap in dialog
Its easy for u