10.01.2015, 15:13
...well the title says it all.How can i do so they cant hit 'H' and shoot from vehicles (car windows...)
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(IsPlayerInAnyVehicle(playerid)) return 0; //This would prevent any bullets being shot from a player in a vehicle to give any damage
return 1;
}
forward FreeWeapons();
public OnFilterScriptInt()
{
SetTimer("FreeWeapons",500,1);
}
public FreeWeapons()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_PASSENGER)
{
SetPlayerArmedWeapon(i, 0);
}
}
}
if(newstate == PLAYER_STATE_PASSENGER) { SetPlayerArmedWeapon(playerid,0); }
if(newstate == PLAYER_STATE_PASSENGER || newstate == PLAYER_STATE_DRIVER) { SetPlayerArmedWeapon(playerid,0); }