SA-MP Forums Archive
Please help me [+rep for helpers] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please help me [+rep for helpers] (/showthread.php?tid=499177)



Please help me [+rep for helpers] - howtodo - 06.03.2014

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;




Re: Please help me [+rep for helpers] - XK - 06.03.2014

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


Re: Please help me [+rep for helpers] - howtodo - 06.03.2014

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


Re: Please help me [+rep for helpers] - Knappen - 06.03.2014

How about checking the players health under OnPlayerUpdate?

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



Re: Please help me [+rep for helpers] - XK - 06.03.2014

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



Re: Please help me [+rep for helpers] - howtodo - 06.03.2014



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


Re: Please help me [+rep for helpers] - mahardika - 06.03.2014

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



Re: Please help me [+rep for helpers] - XK - 06.03.2014

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



Re: Please help me [+rep for helpers] - howtodo - 06.03.2014

not work have a problems


Re: Please help me [+rep for helpers] - howtodo - 06.03.2014

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