SA-MP Forums Archive
[Include] Car Weapon switch (QElike) - 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)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Car Weapon switch (QElike) (/showthread.php?tid=245653)



Car Weapon switch (QElike) - Mmartin - 01.04.2011

Hey there!
There is my first include - switching weapons in car with Q - E, very comfortable.
For allow switch for everyone, put this to OnGameModeInit (banbadweaps is optional. When you set it on true [ or you don't do anything], it will ban RPG, HS RPG and flamethrower for shooting from car, when you set it to false, weapons can be used [or .. "used", becouse you can't shoot from car with flamethrower .. ])
Код:
M_AllowForAll(true,banbadweaps=true);
for disable
Код:
M_AllowForAll(false);
allow for specific playerid
Код:
M_AllowForPlayer(playerid,true);
deny for specific playerid
Код:
M_AllowForPlayer(playerid,false);
Allow some weapon for all
Код:
M_AllowWeapon(weaponid,true);
Deny some weapon for all
Код:
M_AllowWeapon(weaponid,false);
Allow some weapon for playerid
Код:
M_AllowWeaponForPlayer(playerid,weaponid,true);
Deny some weaon for playerid
Код:
M_AllowWeaponForPlayer(playerid,weaponid,false);
Now, add some stocks to publics:
OnPlayerConnect
Код:
M_OnPlayerConnect(playerid);
OnPlayerUpdate
Код:
M_OnPlayerUpdate(playerid);
OnPlayerKeyStateChange
Код:
M_CarSwitch(playerid,newkeys);
Author: Mmartin (me)
Licency: I dont care. Just enjoy and say 'Thanks'

DOWNLOAD: http://solidfiles.com/d/39fca/
VIDEO: [ame]http://www.youtube.com/watch?v=mFO1Rpgd_1k[/ame]


Re: Car Weapon switch (QElike) - Cypress - 01.04.2011

How can i prevent desert eagle switching?


Re: Car Weapon switch (QElike) - Mmartin - 01.04.2011

It is not in features of this include.
Give me some time, i will add it in few minutes/hours


Re: Car Weapon switch (QElike) - BASITJALIL - 01.04.2011

Nice


Re: Car Weapon switch (QElike) - Mmartin - 01.04.2011

If compiler occurs error for undefined symbol getweaponslot, add this into stocks (solidfiles are currently down, then i will reupload inc)
Код:
stock GetWeaponSlot(model)
		{
		    switch(model)
			     {
					case 16..18: return 8;
					case 22..24: return 2;
					case 25..27: return 3;
					case 28,29,32: return 4;
					case 30,31: return 5;
					case 33,34: return 6;
					case 35,38: return 7;
					case 36: return 6;
					case 19: return 5;
					case 20: return 3;
					case 21: return 2;
			      }
			      return -1;
}
//Stock added to include, don't worry now


AW: Car Weapon switch (QElike) - Meta - 01.04.2011

EDIT: I didn't say anything, this is a no-sense post made by me :O


Re: Car Weapon switch (QElike) - Mmartin - 01.04.2011

Upload link edited, add GetWeaponSlot function and some bugfixes.
Link @ 1st. post!


Re: Car Weapon switch (QElike) - Venice - 01.04.2011

lol but this released yesterday link : - https://sampforum.blast.hk/showthread.php?tid=245365


Re: Car Weapon switch (QElike) - Mmartin - 01.04.2011

Quote:
Originally Posted by venice
Посмотреть сообщение
lol but this released yesterday link : - https://sampforum.blast.hk/showthread.php?tid=245365
Oh dude, cmooon.
Really, it's crap. It can't be good for me, becouse it is random. This is not random, but this is the same weapon switching, like you are switching onfoot.

Added new DL link (see 1st post) And some features!

Developer note: It's better to deny (M_AllowWeapon(35,false)) all weapons, which can't shoot from car (eg. Rpg)


Re: Car Weapon switch (QElike) - Mmartin - 01.04.2011

Sry for doublepost, delete this plz