[HELP] OnPlayerDeath
#1

I have this problem with OnPlayerDeath !

http://www.youtube.com/watch?v=qXcNT...ature=*********

Can anyone help me.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    PInfo[killerid][pKill] += 1;
    PInfo[playerid][pDeaths] += 1;
    DisablePlayerRaceCheckpoint(playerid);
    DisablePlayerCheckpoint(playerid);
    DakarRacer[playerid] = 0;
    Forester[playerid] = 0;
    Dostava[playerid] = 0;
    if(ForestRed[playerid] == 1)
    {
    new string[256];
    ForestC -= 1;
    ForestRed[playerid] = 0;
    format(string, 256, "~r~CRVENI: ~w~%d /// ~b~PLAVI: ~w~%d", ForestC, ForestP);
    TextDrawSetString(Event, string);
    TextDrawHideForPlayer(playerid, Event);
    }
    if(ForestBlue[playerid] == 1)
    {
    new string[256];
    ForestP -= 1;
    ForestBlue[playerid] = 0;
    format(string, 256, "~r~CRVENI: ~w~%d /// ~b~PLAVI: ~w~%d", ForestC, ForestP);
    TextDrawSetString(Event, string);
    TextDrawHideForPlayer(playerid, Event);
    }
    if(Meta[playerid] == 1)
    {
    Meta[playerid] = 0;
    Meta[killerid] = 1;
    SetPlayerColor(playerid, TEAM_HIT_COLOR);
    SetPlayerColor(killerid, COLOR_LIGHTBLUE);
    new string[256];
    new p1[MAX_PLAYER_NAME], p2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, p1, sizeof(p1));
    GetPlayerName(killerid, p2, sizeof(p2));
    format(string, sizeof(string), "SERVER: Meta (%s) je ubijena od strane (%s) - sada on postaje meta.", p1, p2);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);
    }
    if(hit[playerid] == 1 && HitInfo[killerid][hitHit] == 1 && PInfo[killerid][pMember] == 6)
    {
    if(hitmanid[killerid] == playerid)
    {
    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new level = PInfo[playerid][pScore];
    new pdclan = 500*IsACop(playerid);
    HitInfo[killerid][hitCijena] = level*100+pdclan;
    format(string, sizeof(string), "HITMAN AGENCY: Uspjesno ste rjesili svoju metu pod imenom %s te ste dobili $%d.", name, HitInfo[killerid][hitCijena]);
    SCM(killerid, COLOR_GOLD, string);
    GivePlayerMoney(killerid, HitInfo[killerid][hitCijena]);
    HitInfo[killerid][hitHit] = 0;
    GivePlayerMoney(playerid, 100);
    SetPlayerColor(playerid,TEAM_HIT_COLOR);
    SetTimerEx("HitTime", 180000, false, "%d", playerid);
    }
    }
    if(Speced[playerid] == 1)
    {
    foreach(Player,i)
    {
    if(spectatorid[i] == playerid)
    {
    PlayerSpectatePlayer(i, playerid);
    }
    }
    return 1;
    }
    //WL
    if(IsCopClose(killerid))
    {
    if(PInfo[killerid][pMember] != 1 && PInfo[playerid][pMember] == 1)
    {
    if(PInfo[killerid][pWanted] < 6)
    {
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(killerid, name, sizeof(name));
    PInfo[killerid][pWanted] = 6;
    SetPlayerWantedLevel(killerid, 6);
    Clearable[killerid] = 0;
    SCM(killerid, COLOR_LIGHTRED, "INFO: Pocinili ste zlocin 'ubojstvo sluzbene osobe' - dobili ste wanted level 6.");
    format(string, sizeof(string), "WANTED INFO: Igrac %s je pocinio zlocin 'ubojstvo sluzbene osobe' - dobio je wanted level 6.", name);
    SendRadioMessage(1, COLOR_SVJETLOPLAVA, string);
    }
    }
    else if(PInfo[killerid][pMember] != 1 && PInfo[playerid][pMember] != 1)
    {
    if(PInfo[killerid][pWanted] < 5)
    {
    new name[MAX_PLAYER_NAME], string[256];
    GetPlayerName(killerid, name, sizeof(name));
    PInfo[killerid][pWanted] = 5;
    SetPlayerWantedLevel(killerid, 5);
    Clearable[killerid] = 0;
    SCM(killerid, COLOR_LIGHTRED, "INFO: Pocinili ste zlocin 'ubojstvo prvog stupnja' - dobili ste wanted level 5.");
    format(string, sizeof(string), "WANTED INFO: Igrac %s je pocinio zlocin 'ubojstvo prvog stupnja' - dobio je wanted level 5.", name);
    SendRadioMessage(1, COLOR_SVJETLOPLAVA, string);
    }
    }
    }
    GivePlayerMoney(playerid, 100);
    if(PlayerTied[playerid] > 0) { KillTimer(tied[playerid]); TogglePlayerControllable(playerid, 1); PlayerTied[playerid] = 0; }
    DisablePlayerCheckpoint(playerid);
    Delator[playerid] = 0;
    return 1;
}
Reply
#2

Anyone know the problem - please. !
Reply
#3

Stop bumping your topic, there is nothing wrong with this code.It's onplayerspawn fault.
Reply
#4

Exactly, show us the
pawn Код:
public OnPlayerSpawn(playerid);
please
Reply
#5

Just to precise that killerid is a player, so if the server set your hp to 0, it shall not work.

if(killerid != INVALID_PLAYER_ID) PInfo[killerid][pKill] += 1;
Reply
#6

pawn Код:
public OnPlayerSpawn(playerid)
{
    SetSpawnInfo(playerid, playerid, PInfo[playerid][pChar], 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
    if(PInfo[playerid][pChar] >= 0) { SetPlayerSkin(playerid, PInfo[playerid][pChar]); }
    TogglePlayerControllable(playerid, 0);
    ResetPlayerWeapons(playerid);
    SetPlayerColor(playerid, TEAM_HIT_COLOR);
    SetPlayerSpawn(playerid);
    SetPlayerSkin(playerid, 299);
    return 1;
}
Reply
#7

wtf is SetPlayerSpawn() show us that
Reply
#8

pawn Код:
public SetPlayerSpawn(playerid)
{
         if(PInfo[playerid][pArea] == 1)
         {
         if(PInfo[playerid][pAreaTime] >= 1)
         {

                    SetSpawnInfo(playerid, playerid, 299, 212.1278,1918.4097,17.6406, 269.15, 0, 0, 0, 0, 0, 0 );
                    SetPlayerVirtualWorld(playerid, 1);
                    SetPlayerPos(playerid, 212.1278,1918.4097,17.6406);
                    SetPlayerInterior(playerid, 6);
                    SetPlayerSkin(playerid, 162);
                    TogglePlayerControllable(playerid, 1);
                    timer2 = SetTimerEx("JailTimer", 1000, 1, "%d", playerid);
         }
         }
         if(PInfo[playerid][pJail] == 1)
         {
         if(PInfo[playerid][pJailTime] >= 1)
         {

                    new Random = random(sizeof(RandomSpawns));
                    SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
                    SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
                    SetPlayerInterior(playerid, 6);
                    TogglePlayerControllable(playerid, 1);
                    timer2 = SetTimerEx("JailTimer", 1000, 1, "%d", playerid);
         }
         }
         if(PInfo[playerid][pArea] == 0 || PInfo[playerid][pAreaTime] <= 0 || Specing[playerid] < 2)
         {
         if(PInfo[playerid][pMember] == 1)
         {
         SetSpawnInfo(playerid, playerid, 299, 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
         SetPlayerSkin(playerid, PInfo[playerid][pChar]);
         SetPlayerPos(playerid, 257.9010,78.4252,1003.6406);
         SetPlayerFacingAngle(playerid, 179.5358);
         SetPlayerInterior(playerid, 6);
         TogglePlayerControllable(playerid, 1);
         }
         if(PInfo[playerid][pMember] == 2)
         {
         SetSpawnInfo(playerid, playerid, 299, 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
         SetPlayerSkin(playerid, PInfo[playerid][pChar]);
         SetPlayerPos(playerid, -2163.0798,645.2178,1057.5938);
         SetPlayerFacingAngle(playerid, 177.7713);
         SetPlayerInterior(playerid, 1);
         TogglePlayerControllable(playerid, 1);
         }
         if(PInfo[playerid][pMember] == 3)
         {
         SetSpawnInfo(playerid, playerid, 299, 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
         SetPlayerSkin(playerid, PInfo[playerid][pChar]);
         SetPlayerPos(playerid, 2329.2517,-1140.8192,1050.4922);
         SetPlayerFacingAngle(playerid, 90.7498);
         SetPlayerInterior(playerid, 12);
         TogglePlayerControllable(playerid, 1);
         }
         if(PInfo[playerid][pMember] == 4)
         {
         SetSpawnInfo(playerid, playerid, 299, 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
         SetPlayerSkin(playerid, PInfo[playerid][pChar]);
         SetPlayerPos(playerid, 2495.9202,-1710.3983,1014.7422);
         SetPlayerFacingAngle(playerid, 357.3854);
         SetPlayerInterior(playerid, 3);
         TogglePlayerControllable(playerid, 1);
         }
         if(PInfo[playerid][pMember] == 5)
         {
         SetSpawnInfo(playerid, playerid, 299, 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
         SetPlayerSkin(playerid, PInfo[playerid][pChar]);
         SetPlayerPos(playerid, 323.2385,1119.0667,1083.8828);
         SetPlayerFacingAngle(playerid, 88.6167);
         SetPlayerInterior(playerid, 5);
         TogglePlayerControllable(playerid, 1);
         }
         if(PInfo[playerid][pMember] == 6)
         {
         SetSpawnInfo(playerid, playerid, 299, 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
         SetPlayerSkin(playerid, PInfo[playerid][pChar]);
         SetPlayerPos(playerid, 2807.4063,-1166.9968,1025.5703);
         SetPlayerFacingAngle(playerid, 180.1600);
         SetPlayerInterior(playerid, 8);
         TogglePlayerControllable(playerid, 1);
         }
         if(PInfo[playerid][pMember] == 0)
         {
             SetSpawnInfo(playerid, playerid, PInfo[playerid][pModel], 1154.0967, -1770.9999, 16.5992, 269.15, 0, 0, 0, 0, 0, 0 );
             TogglePlayerControllable(playerid, 1);
             SetPlayerInterior(playerid, 0);
             SetPlayerSkin(playerid, PInfo[playerid][pModel]);
         }
         if(Specing[playerid] == 2)
         {
         SetPlayerPos(playerid, ReconDest[playerid][0], ReconDest[playerid][1], ReconDest[playerid][2]);
         LoadGuns(playerid);
         Specing[playerid] = 0;
         Speced[spectatorid[playerid]] = 0;
         SetPlayerInterior(playerid, reconint[0]);
         }
         }
         return 1;
}
Reply
#9

dude fackin.. are you sure u have AddPlayerClass on gamemodeinit?

idk.. how this always happend to you?
Reply
#10

idk.. how this always happend to you? - what you mean

AddPlayerClass i have
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)