16.05.2017, 14:36
This could work, a temporary fix (Creates a PVar storing player's last weapon they have hold before entering the vehicle) - The server then will force the player to hold that weapon whenever the player tries to switch for a new weapon.
PHP Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
{
SetPVarInt(playerid, "old_weapon", GetPlayerWeapon(playerid));
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(IsPlayerInAnyVehicle(playerid))
{
SetPlayerArmedWeapon(playerid, GetPVarInt(playerid, "old_weapon"));
}
return 1;
}