[Include] Car Weapon switch (QElike)
#1

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]
Reply
#2

How can i prevent desert eagle switching?
Reply
#3

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

Nice
Reply
#5

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
Reply
#6

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

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

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

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)
Reply
#10

Sry for doublepost, delete this plz
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)