Please help me [+rep for helpers]
#1

I want all the code will be only if there is any one of 10 hp he will be in / crack

my codes:

PHP код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>
#define col_grey 0xADADADFF
new pDied[MAX_PLAYERS];
public 
OnPlayerSpawn(playerid)
{
// Checking for their variable..
    
if(pDied[playerid] == 0)
    {
    
// Spawning at ASGH in Los Santos...
        
pDied[playerid] = 0;
        
SetPlayerVirtualWorld(playerid0);
        }
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    new 
Float:xFloat:yFloat:z;
    
// Resetting their position:
    
GetPlayerPos(playeridxyz);
    
SetPlayerPos(playeridxyz);
    
SetPlayerVirtualWorld(playerid0);
    
// Freezing them in death, aka not allowing them to respawn:
    
TogglePlayerControllable(playerid0);
    
ApplyAnimation(playerid"CRACK""crckdeth1"4.1011111);
    
SetPlayerVirtualWorld(playerid0);
    
// Informing them and activating timer:
    
SetTimerEx("DeathTimer"99000false"i"playerid);
    
SetPlayerVirtualWorld(playerid0);
    return 
1;

Reply
#2

man come on,i said be patient,i am busy now,soon i will make it stop posting threads
Reply
#3

OK, but i need quick help... thanks anyway you are a good man !
Reply
#4

How about checking the players health under OnPlayerUpdate?

pawn Код:
if(GetPlayerHealth(playerid) <= 10)
{
    // Apply Animation
}
Reply
#5

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define col_grey 0xADADADFF

new pDied[MAX_PLAYERS];

 
public OnPlayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) < 10)
    {
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
        return 1;
    }
}


public OnPlayerSpawn(playerid)
{
// Checking for their variable..
    if(pDied[playerid] == 0)
    {
    // Spawning at ASGH in Los Santos...
        pDied[playerid] = 0;
        SetPlayerVirtualWorld(playerid, 0);
        }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
    // Resetting their position:
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z);
    SetPlayerVirtualWorld(playerid, 0);

    // Freezing them in death, aka not allowing them to respawn:
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 1, 1, 1);
    SetPlayerVirtualWorld(playerid, 0);

    // Informing them and activating timer:
    SetTimerEx("DeathTimer", 99000, false, "i", playerid);
    SetPlayerVirtualWorld(playerid, 0);
    return 1;
}
Reply
#6



all the server with 10 hp and i cant to write commands...
Reply
#7

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) < 10)
    {
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    }
    return 1;
}
Reply
#8

pawn Код:
#include <a_samp>
#include <zcmd>
#include <sscanf2>

#define col_grey 0xADADADFF

new pDied[MAX_PLAYERS];

 
public OnPlayerUpdate(playerid)
{
    if(GetPlayerHealth(playerid) < 10)
    {
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
    }
    return 1;
}


public OnPlayerSpawn(playerid)
{
// Checking for their variable..
    if(pDied[playerid] == 0)
    {
    // Spawning at ASGH in Los Santos...
        pDied[playerid] = 0;
        SetPlayerVirtualWorld(playerid, 0);
        }
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x, Float:y, Float:z;
    // Resetting their position:
    GetPlayerPos(playerid, x, y, z);
    SetPlayerPos(playerid, x, y, z);
    SetPlayerVirtualWorld(playerid, 0);

    // Freezing them in death, aka not allowing them to respawn:
    TogglePlayerControllable(playerid, 0);
    ApplyAnimation(playerid, "CRACK", "crckdeth1", 4.1, 0, 1, 1, 1, 1, 1);
    SetPlayerVirtualWorld(playerid, 0);

    // Informing them and activating timer:
    SetTimerEx("DeathTimer", 99000, false, "i", playerid);
    SetPlayerVirtualWorld(playerid, 0);
    return 1;
}
Reply
#9

not work have a problems
Reply
#10

all the server with the /crack and 10 hp and i cant to do commands !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)