Problem [+rep for helpers]
#1

I have a problem with the death system, when someone dying the doctor fill his hp and the system take him to the hospital directly.

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] == 1)
    {
    
// Spawning at ASGH in Los Santos...
        
pDied[playerid] = 0;
        
SetPlayerPos(playerid1177.8596, -1324.087614.0915);
                
// Message and money removal (using -400 at GivePlayerMoney to fine 500 as you automaticly lose $100 when you die).
        
SendClientMessage(playeridcol_grey"{639E4D}INFO:{ADADAD} You have just respawned and you lost $500!");
        
GivePlayerMoney(playerid, -400);
        }
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    new 
Float:xFloat:yFloat:z;
    
// Resetting their position:
    
GetPlayerPos(playeridxyz);
    
SetPlayerPos(playeridxyz);
    
// Freezing them in death, aka not allowing them to respawn:
    
TogglePlayerControllable(playerid0);
    
ApplyAnimation(playerid"CRACK""crckdeth1"4.1011111);
    
// Informing them and activating timer:
    
SendClientMessage(playeridcol_grey"{639E4D}INFO:{ADADAD} You have been brutally wounded! If someone doesn't revive you soon, you will die!");
    
SetTimerEx("DeathTimer"3200false"i"playerid);
    return 
1;
}
forward DeathTimer(playerid);
public 
DeathTimer(playerid)
{
    
// As seen here: informing them and enabling variable:
    
SendClientMessage(playeridcol_grey"{639E4D}INFO:{ADADAD} Nobody managed to save you in time, you died!");
    
pDied[playerid] = 1;
    
// PlayerControllable to true...
    
TogglePlayerControllable(playerid1);
    return 
1;

Reply


Messages In This Thread
Problem [+rep for helpers] - by howtodo - 06.03.2014, 20:19
Re: Problem [+rep for helpers] - by XK - 06.03.2014, 20:27
Re: Problem [+rep for helpers] - by howtodo - 06.03.2014, 20:28
Re: Problem [+rep for helpers] - by XK - 06.03.2014, 20:47
Re: Problem [+rep for helpers] - by howtodo - 06.03.2014, 20:49
Re: Problem [+rep for helpers] - by howtodo - 06.03.2014, 21:13
Re: Problem [+rep for helpers] - by benjaminjones - 06.03.2014, 21:17
Re: Problem [+rep for helpers] - by XK - 06.03.2014, 21:27
Re: Problem [+rep for helpers] - by howtodo - 06.03.2014, 21:29
Re: Problem [+rep for helpers] - by XK - 06.03.2014, 21:30

Forum Jump:


Users browsing this thread: 1 Guest(s)