SA-MP Forums Archive
[FilterScript] Drive-by Weapon Switch - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Drive-by Weapon Switch (/showthread.php?tid=282753)



Drive-by Weapon Switch - Amit_B - 12.09.2011

Hey everyone,

The following script will allow the players on the server to switch their weapon during they're using drive-by (shooting from the vehicle as passengers).

By default, the keys of the weapon switch are Q and E.

Notes:
* The weapon switch will not work if you'll try to switch using the mouse scroll.
* The switch won't work if the next weapon is minigun. Only slots 2, 3, 4, 5 and 6 of the weapons are avilable to switch.

Pastebin link: http://pastebin.com/yYhjqFq3

Enjoy


Re: Drive-by Weapon Switch - iMonk3y - 12.09.2011

Ahh... Why you can switch weapons on foot but you can't in a vehicle? If I ever managed to make my own server, I would definitely use this.


Re: Drive-by Weapon Switch - Kaperstone - 12.09.2011

nice


Re: Drive-by Weapon Switch - _DownLoaD_ - 12.09.2011

תודה עמית יא סקסי
אני מחכה שתפרסם תמערכת פיאמ שלך כמו שעשית
pm 1,2,3,4 בואו לרייס
אגב בחיים לא נראה דברים כאלו מ BLUEREY
--

Ty Bro <3



Re: Drive-by Weapon Switch - Aleron - 12.09.2011

Pretty good, nice work, tested it.


Re: Drive-by Weapon Switch - Kaperstone - 12.09.2011

Quote:
Originally Posted by _DownLoaD_
Посмотреть сообщение
תודה עמית יא סקסי
אני מחכה שתפרסם תמערכת פיאמ שלך כמו שעשית
pm 1,2,3,4 בואו לרייס
אגב בחיים לא נראה דברים כאלו מ BLUEREY
--

Ty Bro <3
אתה מתכוון ל-מערכת הודעות פרטיות... -.-
ותדבר באנגלית בפורום הזה..


Re: Drive-by Weapon Switch - Amit_B - 12.09.2011

Use only English on this section please...


Re: Drive-by Weapon Switch - Cypress - 12.09.2011

Not bad. However I have one question, 'What does the following thing do?'.

pawn Код:
new pweapon[MAX_PLAYERS] = {0,...};

//What does this? {0,...}
I never used this so I'm wondering what it is.


AW: Drive-by Weapon Switch - NaS - 12.09.2011

This sets ALL slots of the array pweapon to 0 :P


Re: Drive-by Weapon Switch - Amit_B - 12.09.2011

Quote:
Originally Posted by Cypress
Посмотреть сообщение
Not bad. However I have one question, 'What does the following thing do?'.

pawn Код:
new pweapon[MAX_PLAYERS] = {0,...};

//What does this? {0,...}
I never used this so I'm wondering what it is.
Yup, NaS's answer is right.

using this for example:
pawn Код:
new array[3] = {0,1,2};
setting the array at start of the script, to 0 on the first cell, 1 on the second, etc.
using {0,...} will set all of the cells to 0.