drive by weapon
#1

can u tell me or give me link any tut how to made player can't use ak47 on drive pessenger seat
Reply
#2

pawn Код:
new PlayerWeapon[MAX_PLAYERS][13];
new PlayerAmmo[MAX_PLAYERS][13];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
            for (new i = 0; i<13; i++)
            {
                    GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
            }
            ResetPlayerWeapons(playerid);  
    }
    if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
            for(new i=0;i<13;i++)
            {
                    GivePlayerWeapon(playerid,PlayerWeapon[playerid][i],PlayerAmmo[playerid][i]);
            }
    }
    return 1;
}
Reply
#3

save his weapons, take weapons from him and give him cak when he gets out of the vehicle.
Reply
#4

Quote:
Originally Posted by tyler12
Посмотреть сообщение
pawn Код:
new PlayerWeapon[MAX_PLAYERS][13];
new PlayerAmmo[MAX_PLAYERS][13];

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
            for (new i = 0; i<13; i++)
            {
                    GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
            }
            ResetPlayerWeapons(playerid);  
    }
    if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
            for(new i=0;i<13;i++)
            {
                    GivePlayerWeapon(playerid,PlayerWeapon[playerid][i],PlayerAmmo[playerid][i]);
            }
    }
    return 1;
}
there is reset and i dnt want reset just some hidden weapons
Reply
#5

Quote:
Originally Posted by sscarface
Посмотреть сообщение
there is reset and i dnt want reset just some hidden weapons
When the player exits the vehicle, the weapons will be gave back. Other than that, I don't know a way around it.
Reply
#6

Quote:
Originally Posted by tyler12
Посмотреть сообщение
When the player exits the vehicle, the weapons will be gave back. Other than that, I don't know a way around it.
but i want when player enter on pessenger seat they can use mp5 and pistol and 9mm only 3
Reply
#7

Quote:
Originally Posted by sscarface
Посмотреть сообщение
but i want when player enter on pessenger seat they can use mp5 and pistol and 9mm only 3
pawn Код:
if(GetPlayerWeapon(playerid) == <id of AK>)SetPlayerArmedWeapon(playerid,0);
you can do that when a player is in a car.

else like other people suggest, save the weapons when a player enters a car, remove all of them and only gie mp5 etc.. all allowed weapons. then when a player exist, restore them checking how much ammo they got left.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)