14.10.2011, 02:08
Tenta isso.
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & (KEY_FIRE | KEY_SPRINT)) == (KEY_FIRE | KEY_SPRINT) && (oldkeys & (KEY_FIRE | KEY_SPRINT)) != (KEY_FIRE | KEY_SPRINT) || newkeys == KEY_FIRE)
{
if(IsPlayerInAnyVehicle(playerid))
{
if(!tiro[playerid])
{
new Float:x, Float:y, Float:z;
GetVehiclePos(v, x, y, z);
CreateExplosion(x, y + 25, z, 3, 5.0);
CreateExplosion(x, y + 30, z, 3, 5.0);
CreateExplosion(x, y + 35, z, 3, 5.0);
CreateExplosion(x, y + 40, z, 3, 5.0);
CreateExplosion(x, y + 45, z, 3, 5.0);
CreateExplosion(x, y + 50, z, 3, 5.0);
tiro[playerid] = true;
return 1;
}
else return SendClientMessage(playerid, -1, "Espere 5 segundos para sua arma recarregar!");
}
}
return 1;
}