Posts: 65
Threads: 16
Joined: Jun 2010
Reputation:
0
Hello,
how can i disable the Drive-By function with all guns? I mean, you can shot with a deagle or a sniper from a bice as a passenger...
how can i disable it in my script?
best regards and sorry for my bad english,
nescha
Posts: 2,220
Threads: 154
Joined: Jul 2009
Reputation:
0
You can make a script that when a player is holding it it switches to another weapon
Posts: 65
Threads: 16
Joined: Jun 2010
Reputation:
0
Yes, but how can i put this in my script? On other servers it was deactivated to, I have no idea how I could disable it...
Posts: 1,767
Threads: 124
Joined: Mar 2010
Код:
if(GetPlayerWeapon(playerid) == WEAPON_SNIPER)SetPlayerArmedWeapon(playerid, 0);
i think it should work ;d
Posts: 65
Threads: 16
Joined: Jun 2010
Reputation:
0
And where must i place this code? How can i find out the names of a gun like deagle? (WEAPON_DEAGLE?)
lg
Posts: 2,220
Threads: 154
Joined: Jul 2009
Reputation:
0
In a timer, which gets set when a player enters a vehicle as passenger.
You can find them in a_samp.inc :P
Posts: 1,767
Threads: 124
Joined: Mar 2010
Em.. OnPlayerStateChange.
Код:
if(newstate == PLAYER_STATE_PASSENGER && oldstate == PLAYER_STATE_ONFOOT)
{
if(GetPlayerWeapon(playerid) == WEAPON_SNIPER)SetPlayerArmedWeapon(playerid, 0);
}
Posts: 65
Threads: 16
Joined: Jun 2010
Reputation:
0
If the server is not very burdensome when i use this with all weapons? oO
Posts: 1,767
Threads: 124
Joined: Mar 2010
Quote:
Originally Posted by Sergei
Why
So if player is put in the vehicle by server, he should be able to drive-by with dealge?
|
It's getting oldstate FOOT without else states.. i think it's good.