[HELP] I need assistance with deathsystem
#1

What happens here now is once a player died he falls onto the ground unconscious, however he stays on the ground forever. I need it that the player automatically regains control an can walk again.


Thank you in advance.


pawn Код:
if(Died[playerid] == 1)
    {
        SetPlayerInterior(playerid,dint[playerid]);
        SetPlayerVirtualWorld(playerid,dworld[playerid]);
        SetPlayerPos(playerid,dx[playerid],dy[playerid],dz[playerid]);
        TogglePlayerControllable(playerid,0);
        SetPlayerHealth(playerid, 1);
        SetTimerEx("ApplyThatAnim",120,false,"i",playerid);
        GameTextForPlayer(playerid,"You've fallen unconscious!",120,5);
        SendClientMessage(playerid,COLOR_WHITE,"Once awake, please role play your injury.");
        dx[playerid] = 0;
        dy[playerid] = 0;
        dz[playerid] = 0;
        dint[playerid] = 0;
        dworld[playerid] = 0;
        return 1;
    }
Reply
#2

Where is this placed? And use [ pawn] tag to post code,
Reply
#3

It's under
pawn Код:
public SetPlayerSpawn(playerid)
Reply
#4

Place at onplayerspawn. And is dx dy dz set at onplayerdeath?
Reply
#5

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x, y, z);
    new interior = GetPlayerInterior(playerid);
    new world = GetPlayerVirtualWorld(playerid);
    dx[playerid] = x;
    dy[playerid] = y;
    dz[playerid] = z;
    dint[playerid] = interior;
    dworld[playerid] = world;
    Died[playerid] = 1;
    PlayerInfo[killerid][pKills] += 1;
    if(WantedPoints[playerid] > 0)
    {
Yup
Reply
#6

I Think that's Impossible
Reply
#7

are the dx,dy,dz global ?
and theres no such thing as SetPlayerSpawn
so it should be OnPlayerSpawn
Reply
#8

It is under OnPlayerSpawn. And yes
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)