How to disable drive-by's in SA-MP 0.3c -
Scenario - 19.12.2010
[TUT] How To Disable Drive-By's In SA-MP 0.3c
Introduction
It's seems that some people (or game-mode styles) don't really go well with allowing the newly added "any weapon drive-by" system. I have decided to take 5 minutes and show you how to do this in SA-MP 0.3c...
COMPLETELY Disabling Drive-By's
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(playerid, 0);
return 1;
}
Explanation
We are simply checking to see if a players state has changed to being either the driver, or passenger, of a vehicle. If they are, we will set their "armed (equipped) weapon" to their fist. I don't think that needs to be explained further, does it?
P.S. I am adding more to this later, this is just a start!
Re: How to disable drive-by's in SA-MP 0.3c -
X35B - 19.12.2010
Ehhh, not much of a start. I do realize that I am adding more to this later and this is just a start!
Re: How to disable drive-by's in SA-MP 0.3c -
Scenario - 19.12.2010
Quote:
Originally Posted by X35B
Ehhh, not much of a start. I do realize that I am adding more to this later and this is just a start!
|
It's actually a simple thing to do, but I haven't seen anyone make a small tutorial on disabling the "any weapon drive-by" system; so I threw this together.
Re: How to disable drive-by's in SA-MP 0.3c -
Stefan_Toretto - 19.12.2010
not a tutorial, but in some threads it exists...
Re: How to disable drive-by's in SA-MP 0.3c -
MestreKiller - 19.12.2010
Quote:
Originally Posted by RealCop228
[TUT] How To Disable Drive-By's In SA-MP 0.3c
Introduction
It's seems that some people (or game-mode styles) don't really go well with allowing the newly added "any weapon drive-by" system. I have decided to take 5 minutes and show you how to do this in SA-MP 0.3c...
COMPLETELY Disabling Drive-By's
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(playerid, 0); return 1; }
Explanation We are simply checking to see if a players state has changed to being either the driver, or passenger, of a vehicle. If they are, we will set their "armed (equipped) weapon" to their fist. I don't think that needs to be explained further, does it?
P.S. I am adding more to this later, this is just a start!
|
just a start? what can you add more to it?
ok, a challenge for you.
Imagine i want just to use uzi, JUST uzi, and not allow them to use other weapons?
how could i?
Re: How to disable drive-by's in SA-MP 0.3c -
blackwave - 19.12.2010
Would that really disable? cause it means: if is the player passager or on vehicle, set his weapon for 0. Wouldn't it bug? this is like a weapon ID, but depends vehicle. Would be better use a SetPVar for the player which attacks someone else, or even if attack this person with the weapon ID: 49.
EDIT:
@Mestrekiller: you could add to his condition just these weapons ID's you want to disable also.
Like:
pawn Code:
if(newstate == PLAYER_STATE_DRIVER && GetPlayerArmedWeapon(playerid) == ID) return (...)
Re: How to disable drive-by's in SA-MP 0.3c -
Flyfishes - 19.12.2010
Short but effective! Good work
Re: How to disable drive-by's in SA-MP 0.3c -
Scenario - 19.12.2010
Quote:
Originally Posted by [OC]MestreKiller
just a start? what can you add more to it?
ok, a challenge for you.
Imagine i want just to use uzi, JUST uzi, and not allow them to use other weapons?
how could i?
|
I can add something later.
Quote:
Originally Posted by blackwave
Would that really disable? cause it means: if is the player passager or on vehicle, set his weapon for 0. Wouldn't it bug? this is like a weapon ID, but depends vehicle. Would be better use a SetPVar for the player which attacks someone else, or even if attack this person with the weapon ID: 49.
|
It would disable it because in 0.3c, you can set the players armed weapon while they are in a vehicle. Unless you set it to something else, they can't use any weapons while in a vehicle.
Re: How to disable drive-by's in SA-MP 0.3c -
__ - 19.12.2010
Untested.
pawn Code:
new weaponExceptions[] =
{24, 27, 29};
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) {
for(new i = 0; i < sizeof(weaponExceptions); i++) {
if(GetPlayerWeapon(playerid) == weaponExceptions[i]) SetPlayerArmedWeapon(playerid, 0);
}
}
return 1;
}
Add weapons to the weaponExceptions array, the example blocks drivers/passengers from using deagles, combat shotguns and MP5s, you can change it and add more weapons by adding a number then adding a comma afterwards.
Re: How to disable drive-by's in SA-MP 0.3c -
ToPhrESH - 22.12.2010
Quote:
Originally Posted by MestreKiller
just a start? what can you add more to it?
ok, a challenge for you.
Imagine i want just to use uzi, JUST uzi, and not allow them to use other weapons?
how could i?
|
Yea!? You can't FOOL a FOOLER! xD
Props to the tut tho
Re: How to disable drive-by's in SA-MP 0.3c -
GoldenM4 - 22.12.2010
i thought u ment for the driver not passenger because it would be good for roleplay servers
Re: How to disable drive-by's in SA-MP 0.3c -
BittleRyan - 22.12.2010
Code:
error 021: symbol already defined: "OnPlayerStateChange"
What is wrong and how do i fix it. It is calling the error on the line that has the:
{
Re: How to disable drive-by's in SA-MP 0.3c -
SkizzoTrick - 22.12.2010
Yea,simple but usefull xD
Your right,everyone is asking how to do this but your the first one who made a tutorial :P
Re: How to disable drive-by's in SA-MP 0.3c -
Scenario - 22.12.2010
Quote:
Originally Posted by BittleRyan
Code:
error 021: symbol already defined: "OnPlayerStateChange"
What is wrong and how do i fix it. It is calling the error on the line that has the:
{
|
You already have the the callback "OnPlayerStateChange" being used elsewhere, you need to add the code inside of what is on my main post and put it inside your callback.
Re: How to disable drive-by's in SA-MP 0.3c -
Mean - 25.12.2010
Quote:
Originally Posted by ToPhrESH
Yea!? You can't FOOL a FOOLER! xD
Props to the tut tho
|
Kinda loled here...
Respuesta: How to disable drive-by's in SA-MP 0.3c -
anonymousx - 26.12.2010
THAT'S SHIT. I don't know why you prohibit this game feature and it's allowed bugs, that they are external to the game. If you don't like Drive-By THIS IS NOT YOU GAME YOU SHOULD PLAY GAMES LIKE COUNTER STRIKE.
Re: Respuesta: How to disable drive-by's in SA-MP 0.3c -
Scenario - 26.12.2010
Quote:
Originally Posted by anonymousx
THAT'S SHIT. I don't know why you prohibit this game feature and it's allowed bugs, that they are external to the game. If you don't like Drive-By THIS IS NOT YOU GAME YOU SHOULD PLAY GAMES LIKE COUNTER STRIKE.
|
Actually, some game-modes don't allow drive-by's because their creator(s) find it unfair and unrealistic for RP modes. People enjoy playing SA-MP, nobody is forcing them to play a game-mode where you cannot drive-by. Perhaps you should stop flaming in peoples' threads.
Re: Respuesta: How to disable drive-by's in SA-MP 0.3c -
SkizzoTrick - 27.12.2010
Quote:
Originally Posted by anonymousx
THAT'S SHIT. I don't know why you prohibit this game feature and it's allowed bugs, that they are external to the game. If you don't like Drive-By THIS IS NOT YOU GAME YOU SHOULD PLAY GAMES LIKE COUNTER STRIKE.
|
Ohh cmon,another newbie who believes that his the biggest script!
The biggest Communities like LS-RP doesn't allows DB'es.My opinion is that YOU should find another game to play
P.S:My suggestion: Mario.
Re: Respuesta: How to disable drive-by's in SA-MP 0.3c -
admantis - 27.12.2010
Quote:
Originally Posted by SkizzoTrick
Ohh cmon,another newbie who believes that his the biggest script!
The biggest Communities like LS-RP doesn't allows DB'es.My opinion is that YOU should find another game to play
P.S:My suggestion: Mario.
|
lol mario
Re: How to disable drive-by's in SA-MP 0.3c -
Fool - 28.12.2010
Im sorry, but will the Weapons Return if he Changes State Again?