// Timer Name: ServerHeartbeatTwo() // TickRate: 1 secs. task ServerHeartbeatTwo[9000]() { foreach(new i: Player) { if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][3] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 25); } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][2] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 24); } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][5] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 30); } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][5] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 31); } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][6] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 33); } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][4] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 32); } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][4] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 2; } if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][2] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 22); } |
// Timer Name: ServerHeartbeatTwo() // TickRate: 1 secs. task ServerHeartbeatTwo[1000]() { foreach(new i: Player) { if(IsPlayerInAnyVehicle(i)) { if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0); else if(PlayerInfo[i][pGuns][3] == 0) SetPlayerArmedWeapon(i, 0); else SetPlayerArmedWeapon(i, 25); } |
if ((newkeys & 2) && !(oldkeys & 2)) //key 2 is what we have to use to check if the key pressed was H.
{
if(IsPlayerInAnyVehicle(playerid) && GetPlayerVehicleSeat(playerid) != 0)
{
switch(GetPlayerWeapon(playerid))
{
case 31: {SendClientMessage(playerid, -1, "You can't drive-by with this weapon."); ApplyAnimation(playerid, "PED", "CAR_sitp", 4.1, 0, 0, 0, 0, 0, 0); return 1;}
case /*weapon id you don't want to be able to driveby with, i.e. m4*/: {SendClientMessage(playerid, -1, "You can't drive-by with this weapon."); ApplyAnimation(playerid, "PED", "CAR_sitp", 4.1, 0, 0, 0, 0, 0, 0); return 1;}
}
}
}