08.09.2013, 14:21
pawn Код:
#include <a_samp>
#define TIMER_INTERVAL 150
#define amarillo 0xE7F016C8
new fogueo;
new maxPlayers;
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/fogueo", cmdtext, true, 9) == 0)
{
if(fogueo == 0)
{
fogueo = 1;
SendClientMessage(playerid, amarillo, "Ahora todas tus balas SON de Fogueo");
}
else
{
if(fogueo == 1)
{
fogueo = 0;
SendClientMessage(playerid, amarillo, "Ahora todas tus balas NO son de Fogueo");
}
}
return 1;
}
return 0;
}
public OnFilterScriptInit()
{
fogueo = 0;
maxPlayers = GetMaxPlayers();
SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(fogueo == 1)
{
if(GetPVarInt(playerid, "Headshotted") == 1)
{
SetPVarInt(playerid, "Headshotted", 0);
}
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(fogueo == 1)
{
if(issuerid != INVALID_PLAYER_ID)
{
ApplyAnimation(playerid,"ped","gas_cwr",4.1,0,1,1,0,0);
static Float:SacarVida;
GetPlayerHealth(playerid, SacarVida);
SetPlayerHealth(playerid, SacarVida-1);
}
}
return 1;
}
forward CheckHeadShot();
public CheckHeadShot()
{
if(fogueo == 1)
{
new index;
for(new playerid; playerid < maxPlayers; playerid++)
{
if(IsPlayerConnected(playerid))
{
index = GetPlayerAnimationIndex(playerid);
if(index == 1173 || index == 1175 || index == 1177 || index == 1178)
{
SetPVarInt(playerid, "Headshotted", 1);
SetPlayerHealth(playerid, 0);
}
}
}
}
return 1;
}