head shoot system
#6

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;
}
Reply


Messages In This Thread
head shoot system - by Porta0123 - 08.09.2013, 13:53
Respuesta: head shoot system - by Braun - 08.09.2013, 14:00
Respuesta: head shoot system - by oOFotherOo - 08.09.2013, 14:04
Re: head shoot system - by Porta0123 - 08.09.2013, 14:12
Respuesta: head shoot system - by Braun - 08.09.2013, 14:16
Re: head shoot system - by Porta0123 - 08.09.2013, 14:21
Respuesta: head shoot system - by Braun - 08.09.2013, 14:29
Re: head shoot system - by Porta0123 - 08.09.2013, 14:41
Respuesta: head shoot system - by Braun - 08.09.2013, 14:49
Re: head shoot system - by Porta0123 - 08.09.2013, 14:51

Forum Jump:


Users browsing this thread: 2 Guest(s)