[HELP] Passenger shoot - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] Passenger shoot (
/showthread.php?tid=341456)
[HELP] Passenger shoot -
c0GI - 10.05.2012
Hy i need a script that player who want to sit in vehicle as passenger, he didn't can shoot with deagle!!!
Can anybody make it for me?

)
Re: [HELP] Passenger shoot -
[MG]Dimi - 10.05.2012
pawn Код:
//Solution 1
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE) // if he pressed Fire
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) != 0) // he is in vehicle and he isn't driver
{
SetPlayerArmedWeapon(playerid,0); //once he uses it it will be resetted
}
}
return 1;
}
// Solution 2
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_PASSENGER && GetPlayerWeapon(playerid) == 24) // Player entered a vehicle as a driver and is armed with Deagle
{
SetPlayerArmedWeapon(playerid,0); //once he uses it it will be resetted
}
return 0;
}
Re: [HELP] Passenger shoot -
c0GI - 10.05.2012
TOOO SRBINEEE!!! TAKO JE HVALA TI BRATE <3
Nego dal da uzmem Soluciju 2 ili Soluciju 1
Re: [HELP] Passenger shoot -
c0GI - 10.05.2012
But Can you make it if player want to sit as a passinger (suvozac) ! And if a player hold in hand deagle, not any weapon, just deagle!!! HELP
Re: [HELP] Passenger shoot -
[MG]Dimi - 10.05.2012
Second Solution is if he has Deagle in his hands.