public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(weapondid == ID del arma) { new Float:vida; GetPlayerHealth(playerid, vida); SetPlayerHealth(playerid, vida -cantidad de vida); } }
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid) { if(balas == 1) { ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync): } }
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid != INVALID_PLAYER_ID)
{
static Float:SacarVida;
GetPlayerHealth(playerid, SacarVida);
if(weaponid == 24)
{
SetPlayerHealth(playerid, SacarVida-1); // Saca %1 de vida.
}
}
return 1;
}
ahhh , valee ahora entiendo xDDD (es lo que tiene 4s sin mover un dedo en scripts xDD)
y una ъltima cosa, como se hacнa para que cuando disperen a la cabeza muera directamente? |
Sistema de headshot by:[EdX]Sparrow
#include <samp>
#define TIMER_INTERVAL 150
new
maxPlayers;
public OnFilterScriptInit()
{
maxPlayers = GetMaxPlayers();
SetTimer("CheckHeadShot", TIMER_INTERVAL, 1);
print("\n----------------------------------");
print(" System by: [EdX]Sparrow");
print("----------------------------------\n");
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPVarInt(playerid, "Headshotted") == 1)
{
SetPVarInt(playerid, "Headshotted", 0);
GameTextForPlayer(playerid, "~r~Headshotted Porra!", 3000, 3);
GameTextForPlayer(killerid, "~r~Headshott Porra!", 3000, 3);
}
return 1;
}
forward CheckHeadShot();
public CheckHeadShot()
{
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;
}
ya , pero cuбl es? es lo que no se xDDD es el mismo efecto de que cuando te dan con la granada de humo
|
public OnPlayerUpdate(playerid) {
if(GetPlayerAnimationIndex(playerid)) {
new animlib[32];
new animname[32];
new msg[128];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
format(msg, 128, "Running anim: %s %s", animlib, animname);
SendClientMessageToAll(0xFFFFFFFF, msg);
} return true;
}
ApplyAnimation(playerid, "PED", "gas_cwr", 4.1, 0, 1, 1, 1, 1, 1);