Anti DB as Passanger
#1

Hello i want a simple Script for anti Drive by as Passenger

The Passenger can use only a mp5

Deagle , MP5, M4, Shotgun musst block or switch can every one help me ?
Reply
#2

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange
https://sampwiki.blast.hk/wiki/IsPlayerInVehicle
https://sampwiki.blast.hk/wiki/GetPlayerWeapon

This is used to stop animations (in this case, drive-by)
ApplyAnimation(playerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
Reply
#3

I have this found it dont work why ?

Код:
public OnPlayerUpdate(playerid)
{
    if( IsPlayerInAnyVehicle(playerid) && GetPlayerWeapon(playerid) > 0 && !IsNormalWeapon(GetPlayerWeapon(playerid)) ) SetPlayerArmedWeapon(playerid, 0);
		return 1;
}
Код:
stock IsNormalWeapon(weaponid)
{
if(weaponid == 29) return 1;
return 0;
}
Reply
#4

http://forum.sa-mp.com/showthread.ph...yerarmedweapon
Reply
#5

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SPRINT)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerWeapon(playerid) != 29)
            {
                ApplyAnimation(playerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
            }
            else if(GetPlayerWeapon(playerid) == 29)
            {
                return 1;
            }
        }
    }
    return 0;
}
Not tested In Game. No errors in my PC.
Reply
#6

Quote:
Originally Posted by Marricio
Посмотреть сообщение
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(newkeys & KEY_SPRINT)
    {
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(GetPlayerWeapon(playerid) != 29)
            {
                ApplyAnimation(playerid, "CARRY", "crry_prtial", 2.0, 0, 0, 0, 0, 0);
            }
            else if(GetPlayerWeapon(playerid) == 29)
            {
                return 1;
            }
        }
    }
    return 0;
}
Not tested In Game. No errors in my PC.
I am not sure if this code only allow you to use this weapon or took your weapon, on this case id 29(mp5)
And btw why you don't like that can shoot with all weapons? at irl you can too!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)