Onplayerdeath
#1

My onplayerdeath does not send any death message and client message if the killerid =INVALID_PLAYER_ID
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(aduty[killerid] == 1 && killerid != INVALID_PLAYER_ID) return GameTextForPlayer(playerid,"~r~Unfair Death",4000,3);
    new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
    GetPlayerName(killerid, killerName, sizeof(killerName));
    GetPlayerName(playerid, playerName, sizeof(playerName));
    HideAllServerTextDraws(playerid);
    SetPlayerColor(killerid, COLOR_ORANGERED);
    ad_recent1[playerid] =0;
    KillTimer(ad_timer1[playerid]);
    pInfo[playerid][DrugTime]=0;
    if (killerid != INVALID_PLAYER_ID)
    {
        if(randomid == playerid)
        {
            new str1[200];
            randomid = -1;
            new str2[200];

            format(str2, sizeof(str2),"~p~~h~%s (%d) ~w~Has Killed The ~g~Bonus~w~ Player ~p~~h~%s (%d) ~w~And Won ~g~~h~$%d.",killerName, killerid, playerName, playerid, randmoney);
            TextDrawSetString(Textdraw111, str2);
            TextDrawShowForAll(Textdraw111);

            new Miney = pInfo[killerid][Money];
            pInfo[killerid][Money] =Miney+randmoney;
            format(str1, sizeof(str1),"* {00B9FF}%s (%d) {FFFFFF}Has Killed The Bonus Player {00B9FF}%s (%d) {FFFFFF}And Won {73FF00}$%d.",killerName, killerid, playerName, playerid, randmoney);
            SCMA(COLOR_ORANGE, str1);
            randmoney =0;
        }
        pInfo[killerid][Kills]++;
        pInfo[playerid][Deaths]++;
        new WantedLevel = GetPlayerWantedLevel(killerid);
        if(WantedLevel == 0)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 4);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 6 - Felon - Warrant Issued");
        }
        if(WantedLevel == 4)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 8 - Felon - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MUDER);
        }
        if(WantedLevel == 5)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 9 - Most Wanted - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MOSTWANTED);
        }
        if(WantedLevel == 6)
        {
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 10 - Most Wanted - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MOSTWANTED);
        }
        SendDeathMessage(killerid, playerid, reason);
        if(InDuel[playerid] == 1)
        {
                new string[256];
                if(DuelCage1 == playerid || DuelCage1 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage1price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage1price*2;
                    DuelCage1 = -1;
                    return 1;
                }
                if(DuelCage2 == playerid || DuelCage2 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage2price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage2price*2;
                    DuelCage2 = -1;
                    return 1;
                }
                if(DuelCage3 == playerid || DuelCage3 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage3price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage3price*2;
                    DuelCage3 = -1;
                    return 1;
                }
                if(DuelCage4 == playerid || DuelCage4 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage4price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage4price*2;
                    DuelCage4 = -1;
                    return 1;
                }
                return 1;
        }
        KillStreak[killerid] ++;
        new Miney = pInfo[killerid][Money];
        pInfo[killerid][Money] =Miney+500*2;
        SetPlayerWantedLevel(playerid, 0);
        KillStreak[playerid] = 0;
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        new str[256];
        switch(KillStreak[killerid])
        {
            case 2: format(str, sizeof(str), "~g~%s has performed a ~y~double kill!", killerName);
            case 3: format(str, sizeof(str), "~y~Triple Kill for ~b~%s!", killerName);
            case 4: format(str, sizeof(str), "~p~Fourth Kill for ~r~%s!", killerName);
            case 5: format(str, sizeof(str), "~r~%s is dominating with ~p~five kills!", killerName);
            case 6: format(str, sizeof(str), "~w~%s is epic !! Imagine that !! ~y~six kills!", killerName);
            case 7: format(str, sizeof(str), "~r~Epic luck for %s with ~w~seven kills!", killerName);
            case 8: format(str, sizeof(str), "~p~%s is Amazing Killer with ~y~eight kills!", killerName);
            case 9: format(str, sizeof(str), "~g~%s is Profesional !! ~b~nine kills!", killerName);
            case 10: format(str, sizeof(str), "~b~%s is annihilating ! ~g~ten kills!", killerName);
            case 11: format(str, sizeof(str), "~b~%s Nigga ~P~~H~is on ~R~~H~Fire ! ~g~eleven kills!", killerName);
            case 12: format(str, sizeof(str), "~b~~H~ This is totally ~G~~H~shit ! ~g~%s twelve kills!", killerName);
            case 13: format(str, sizeof(str), "~g~~H~ Has Fucked you ~G~~H~ALL ! ~g~%s thirteen kills!", killerName);
            case 14: format(str, sizeof(str), "~g~~H~Aim ~R~Botter ! ~g~%s fourteen kills!", killerName);
            case 15: format(str, sizeof(str), "~r~~H~%s in Offically an ~g~~h~Hacker ! ~g~ fifteen kills!", killerName);
        }
        if(KillStreak[killerid] == 2)
        {
            pInfo[killerid][Money] =Miney+5000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$5000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 3)
        {
            pInfo[killerid][Money] =Miney+6000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$6000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 3)
        {
            pInfo[killerid][Money] =Miney+7000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$7000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 4)
        {
            pInfo[killerid][Money] =Miney+8000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$8000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 5)
        {
            pInfo[killerid][Money] =Miney+9000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$9000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 6)
        {
            pInfo[killerid][Money] =Miney+10000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$10000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 7)
        {
            pInfo[killerid][Money] =Miney+11000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$11000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 8)
        {
            pInfo[killerid][Money] =Miney+12000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$12000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 9)
        {
            pInfo[killerid][Money] =Miney+13000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$13000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 10)
        {
            pInfo[killerid][Money] =Miney+14000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$14000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 11)
        {
            pInfo[killerid][Money] =Miney+14000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$14000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 12)
        {
            pInfo[killerid][Money] =Miney+15000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$15000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 13)
        {
            pInfo[killerid][Money] =Miney+16000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$16000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 14)
        {
            pInfo[killerid][Money] =Miney+17000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$17000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 15)
        {
            pInfo[killerid][Money] =Miney+18000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$18000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        GameTextForAll(str,3000,3);
        new wepname[32];
        GetWeaponName(reason, wepname, sizeof(wepname));
        SendClientMessageToAll(COLOR_MAROON, msg);
        SetPlayerWantedLevel(playerid, 0);
        if(challenge[playerid] == 1)
        {
               new stringc[256], pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(stringc, sizeof(stringc), "%s (%d) Got Killed In Sniper Death Match By %s (%d)", pname,playerid,killerName,killerid);
               SCMA(COLOR_MAROON, stringc);
        }
        if(dms[playerid] == 1)
        {
               new stringc[256], pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(stringc, sizeof(stringc), "%s (%d) got killed in a Death Match Stadium by %s (%d)", playerName,playerid,killerName,killerid);
               SCMA(COLOR_MAROON, stringc);
        }
        switch (reason)
        {
             case 0: reasonMsg = "Unarmed";
             case 1: reasonMsg = "Brass Knuckles";
             case 2: reasonMsg = "Golf Club";
             case 3: reasonMsg = "Night Stick";
             case 4: reasonMsg = "Knife";
             case 5: reasonMsg = "Baseball Bat";
             case 6: reasonMsg = "Shovel";
             case 7: reasonMsg = "Pool Cue";
             case 8: reasonMsg = "Katana";
             case 9: reasonMsg = "Chainsaw";
             case 10: reasonMsg = "Dildo";
             case 11: reasonMsg = "Dildo";
             case 12: reasonMsg = "Vibrator";
             case 13: reasonMsg = "Vibrator";
             case 14: reasonMsg = "Flowers";
             case 15: reasonMsg = "Cane";
             case 22: reasonMsg = "Pistol";
             case 23: reasonMsg = "Silenced Pistol";
             case 24: reasonMsg = "Desert Eagle";
             case 25: reasonMsg = "Shotgun";
             case 26: reasonMsg = "Sawn-off Shotgun";
             case 27: reasonMsg = "Combat Shotgun";
             case 28: reasonMsg = "MAC-10";
             case 29: reasonMsg = "MP5";
             case 30: reasonMsg = "AK-47";
             case 31: reasonMsg = "M4";
             case 32: reasonMsg = "TEC-9";
             case 33: reasonMsg = "Country Rifle";
             case 34: reasonMsg = "Sniper Rifle";
             case 37: reasonMsg = "Fire";
             case 38: reasonMsg = "Minigun";
             case 41: reasonMsg = "Spray Can";
             case 42: reasonMsg = "Fire Extinguisher";
             case 49: reasonMsg = "Vehicle Collision";
             case 50: reasonMsg = "Vehicle Collision";
             case 51: reasonMsg = "Explosion";
             default: reasonMsg = "Unknown";
       }
       format(msg, sizeof(msg), "*%s killed by %s. (%s)", killerName, playerName, reasonMsg);
       SendClientMessageToAll(COLOR_MAROON, msg);
    }
    else
    {
        switch (reason)
        {
              case 53: format(msg, sizeof(msg), "*%s died. (Drowned)", playerName);
              case 54: format(msg, sizeof(msg), "*%s died. (Collision)", playerName);
              default: format(msg, sizeof(msg), "*%s died.", playerName);
        }
        pInfo[playerid][Deaths]++;
        SendDeathMessage(playerid, INVALID_PLAYER_ID, reason);
        SendClientMessageToAll(COLOR_MAROON, msg);
        if(randomid == playerid)
        {
            new str1[200];
            randomid = -1;
            new str2[200];
            format(str2, sizeof(str2),"~g~Bonus Player ~p~~h~%s (%d) ~w~Has ~r~died ~w~in an ~y~Accident.", playerName, playerid);
            TextDrawSetString(Textdraw111, str2);
            TextDrawShowForAll(Textdraw111);
            format(str1, sizeof(str1),"* Bonus: {00B9FF}%s (%d) {FFFFFF}Has Been Died In An Accident.", playerName, playerid);
            SCMA(COLOR_ORANGE, str1);
            randmoney =0;
        }
    }
    SetPlayerColor(playerid, COLOR_GREY);
    PlayerDuelWatching[playerid] = 0;
    Anti_heal[playerid] = 0;
    spawned[playerid] =0;
    AUTO_SAVE(playerid);
    AUTO_SAVE(killerid);
    aduty[playerid] =0;
    return 1;
}
Reply
#2

What do you mean (?), Like This;
pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(aduty[killerid] == 1 && killerid != INVALID_PLAYER_ID) return GameTextForPlayer(playerid,"~r~Unfair Death",4000,3);
    new msg[128], killerName[MAX_PLAYER_NAME], reasonMsg[32], playerName[MAX_PLAYER_NAME];
    GetPlayerName(killerid, killerName, sizeof(killerName));
    GetPlayerName(playerid, playerName, sizeof(playerName));
    HideAllServerTextDraws(playerid);
    SetPlayerColor(killerid, COLOR_ORANGERED);
    ad_recent1[playerid] =0;
    KillTimer(ad_timer1[playerid]);
    pInfo[playerid][DrugTime]=0;
    if (killerid != INVALID_PLAYER_ID)
    {
        if(randomid == playerid)
        {
            new str1[200];
            randomid = -1;
            new str2[200];

            SendDeathMessage(killerid, playerid, reason);

            format(str2, sizeof(str2),"~p~~h~%s (%d) ~w~Has Killed The ~g~Bonus~w~ Player ~p~~h~%s (%d) ~w~And Won ~g~~h~$%d.",killerName, killerid, playerName, playerid, randmoney);
            TextDrawSetString(Textdraw111, str2);
            TextDrawShowForAll(Textdraw111);

            new Miney = pInfo[killerid][Money];
            pInfo[killerid][Money] =Miney+randmoney;
            format(str1, sizeof(str1),"* {00B9FF}%s (%d) {FFFFFF}Has Killed The Bonus Player {00B9FF}%s (%d) {FFFFFF}And Won {73FF00}$%d.",killerName, killerid, playerName, playerid, randmoney);
            SCMA(COLOR_ORANGE, str1);
            randmoney =0;
        }
        pInfo[killerid][Kills]++;
        pInfo[playerid][Deaths]++;
        new WantedLevel = GetPlayerWantedLevel(killerid);
        if(WantedLevel == 0)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 4);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 6 - Felon - Warrant Issued");
        }
        if(WantedLevel == 4)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 8 - Felon - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MUDER);
        }
        if(WantedLevel == 5)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 9 - Most Wanted - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MOSTWANTED);
        }
        if(WantedLevel == 6)
        {
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 10 - Most Wanted - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MOSTWANTED);
        }
        SendDeathMessage(killerid, playerid, reason);
        if(InDuel[playerid] == 1)
        {
                new string[256];
                if(DuelCage1 == playerid || DuelCage1 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage1price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage1price*2;
                    DuelCage1 = -1;
                    return 1;
                }
                if(DuelCage2 == playerid || DuelCage2 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage2price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage2price*2;
                    DuelCage2 = -1;
                    return 1;
                }
                if(DuelCage3 == playerid || DuelCage3 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage3price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage3price*2;
                    DuelCage3 = -1;
                    return 1;
                }
                if(DuelCage4 == playerid || DuelCage4 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "[DUEL] %s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", killerName, killerid, playerName, playerid, DuelCage4price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage4price*2;
                    DuelCage4 = -1;
                    return 1;
                }
                return 1;
        }
        KillStreak[killerid] ++;
        new Miney = pInfo[killerid][Money];
        pInfo[killerid][Money] =Miney+500*2;
        SetPlayerWantedLevel(playerid, 0);
        KillStreak[playerid] = 0;
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        new str[256];
        switch(KillStreak[killerid])
        {
            case 2: format(str, sizeof(str), "~g~%s has performed a ~y~double kill!", killerName);
            case 3: format(str, sizeof(str), "~y~Triple Kill for ~b~%s!", killerName);
            case 4: format(str, sizeof(str), "~p~Fourth Kill for ~r~%s!", killerName);
            case 5: format(str, sizeof(str), "~r~%s is dominating with ~p~five kills!", killerName);
            case 6: format(str, sizeof(str), "~w~%s is epic !! Imagine that !! ~y~six kills!", killerName);
            case 7: format(str, sizeof(str), "~r~Epic luck for %s with ~w~seven kills!", killerName);
            case 8: format(str, sizeof(str), "~p~%s is Amazing Killer with ~y~eight kills!", killerName);
            case 9: format(str, sizeof(str), "~g~%s is Profesional !! ~b~nine kills!", killerName);
            case 10: format(str, sizeof(str), "~b~%s is annihilating ! ~g~ten kills!", killerName);
            case 11: format(str, sizeof(str), "~b~%s Nigga ~P~~H~is on ~R~~H~Fire ! ~g~eleven kills!", killerName);
            case 12: format(str, sizeof(str), "~b~~H~ This is totally ~G~~H~shit ! ~g~%s twelve kills!", killerName);
            case 13: format(str, sizeof(str), "~g~~H~ Has Fucked you ~G~~H~ALL ! ~g~%s thirteen kills!", killerName);
            case 14: format(str, sizeof(str), "~g~~H~Aim ~R~Botter ! ~g~%s fourteen kills!", killerName);
            case 15: format(str, sizeof(str), "~r~~H~%s in Offically an ~g~~h~Hacker ! ~g~ fifteen kills!", killerName);
        }
        if(KillStreak[killerid] == 2)
        {
            pInfo[killerid][Money] =Miney+5000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$5000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 3)
        {
            pInfo[killerid][Money] =Miney+6000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$6000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 3)
        {
            pInfo[killerid][Money] =Miney+7000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$7000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 4)
        {
            pInfo[killerid][Money] =Miney+8000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$8000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 5)
        {
            pInfo[killerid][Money] =Miney+9000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$9000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 6)
        {
            pInfo[killerid][Money] =Miney+10000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$10000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 7)
        {
            pInfo[killerid][Money] =Miney+11000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$11000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 8)
        {
            pInfo[killerid][Money] =Miney+12000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$12000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 9)
        {
            pInfo[killerid][Money] =Miney+13000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$13000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 10)
        {
            pInfo[killerid][Money] =Miney+14000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$14000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 11)
        {
            pInfo[killerid][Money] =Miney+14000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$14000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 12)
        {
            pInfo[killerid][Money] =Miney+15000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$15000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 13)
        {
            pInfo[killerid][Money] =Miney+16000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$16000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 14)
        {
            pInfo[killerid][Money] =Miney+17000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$17000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 15)
        {
            pInfo[killerid][Money] =Miney+18000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$18000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        GameTextForAll(str,3000,3);
        new wepname[32];
        GetWeaponName(reason, wepname, sizeof(wepname));
        SendClientMessageToAll(COLOR_MAROON, msg);
        SetPlayerWantedLevel(playerid, 0);
        if(challenge[playerid] == 1)
        {
               new stringc[256], pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(stringc, sizeof(stringc), "%s (%d) Got Killed In Sniper Death Match By %s (%d)", pname,playerid,killerName,killerid);
               SCMA(COLOR_MAROON, stringc);
        }
        if(dms[playerid] == 1)
        {
               new stringc[256], pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(stringc, sizeof(stringc), "%s (%d) got killed in a Death Match Stadium by %s (%d)", playerName,playerid,killerName,killerid);
               SCMA(COLOR_MAROON, stringc);
        }
        switch (reason)
        {
             case 0: reasonMsg = "Unarmed";
             case 1: reasonMsg = "Brass Knuckles";
             case 2: reasonMsg = "Golf Club";
             case 3: reasonMsg = "Night Stick";
             case 4: reasonMsg = "Knife";
             case 5: reasonMsg = "Baseball Bat";
             case 6: reasonMsg = "Shovel";
             case 7: reasonMsg = "Pool Cue";
             case 8: reasonMsg = "Katana";
             case 9: reasonMsg = "Chainsaw";
             case 10: reasonMsg = "Dildo";
             case 11: reasonMsg = "Dildo";
             case 12: reasonMsg = "Vibrator";
             case 13: reasonMsg = "Vibrator";
             case 14: reasonMsg = "Flowers";
             case 15: reasonMsg = "Cane";
             case 22: reasonMsg = "Pistol";
             case 23: reasonMsg = "Silenced Pistol";
             case 24: reasonMsg = "Desert Eagle";
             case 25: reasonMsg = "Shotgun";
             case 26: reasonMsg = "Sawn-off Shotgun";
             case 27: reasonMsg = "Combat Shotgun";
             case 28: reasonMsg = "MAC-10";
             case 29: reasonMsg = "MP5";
             case 30: reasonMsg = "AK-47";
             case 31: reasonMsg = "M4";
             case 32: reasonMsg = "TEC-9";
             case 33: reasonMsg = "Country Rifle";
             case 34: reasonMsg = "Sniper Rifle";
             case 37: reasonMsg = "Fire";
             case 38: reasonMsg = "Minigun";
             case 41: reasonMsg = "Spray Can";
             case 42: reasonMsg = "Fire Extinguisher";
             case 49: reasonMsg = "Vehicle Collision";
             case 50: reasonMsg = "Vehicle Collision";
             case 51: reasonMsg = "Explosion";
             default: reasonMsg = "Unknown";
       }
       format(msg, sizeof(msg), "*%s killed by %s. (%s)", killerName, playerName, reasonMsg);
       SendClientMessageToAll(COLOR_MAROON, msg);
    }
    else
    {
        switch (reason)
        {
              case 53: format(msg, sizeof(msg), "*%s died. (Drowned)", playerName);
              case 54: format(msg, sizeof(msg), "*%s died. (Collision)", playerName);
              default: format(msg, sizeof(msg), "*%s died.", playerName);
        }
        pInfo[playerid][Deaths]++;
        SendDeathMessage(playerid, INVALID_PLAYER_ID, reason);
        SendClientMessageToAll(COLOR_MAROON, msg);
        if(randomid == playerid)
        {
            new str1[200];
            randomid = -1;
            new str2[200];
            format(str2, sizeof(str2),"~g~Bonus Player ~p~~h~%s (%d) ~w~Has ~r~died ~w~in an ~y~Accident.", playerName, playerid);
            TextDrawSetString(Textdraw111, str2);
            TextDrawShowForAll(Textdraw111);
            format(str1, sizeof(str1),"* Bonus: {00B9FF}%s (%d) {FFFFFF}Has Been Died In An Accident.", playerName, playerid);
            SCMA(COLOR_ORANGE, str1);
            randmoney =0;
        }
    }
    SetPlayerColor(playerid, COLOR_GREY);
    PlayerDuelWatching[playerid] = 0;
    Anti_heal[playerid] = 0;
    spawned[playerid] =0;
    AUTO_SAVE(playerid);
    AUTO_SAVE(killerid);
    aduty[playerid] =0;
    return 1;
}
Reply
#3

there is problem when u die in other way not by an player
pawn Code:
switch (reason)
        {
             case 0: reasonMsg = "Unarmed";
             case 1: reasonMsg = "Brass Knuckles";
             case 2: reasonMsg = "Golf Club";
             case 3: reasonMsg = "Night Stick";
             case 4: reasonMsg = "Knife";
             case 5: reasonMsg = "Baseball Bat";
             case 6: reasonMsg = "Shovel";
             case 7: reasonMsg = "Pool Cue";
             case 8: reasonMsg = "Katana";
             case 9: reasonMsg = "Chainsaw";
             case 10: reasonMsg = "Dildo";
             case 11: reasonMsg = "Dildo";
             case 12: reasonMsg = "Vibrator";
             case 13: reasonMsg = "Vibrator";
             case 14: reasonMsg = "Flowers";
             case 15: reasonMsg = "Cane";
             case 22: reasonMsg = "Pistol";
             case 23: reasonMsg = "Silenced Pistol";
             case 24: reasonMsg = "Desert Eagle";
             case 25: reasonMsg = "Shotgun";
             case 26: reasonMsg = "Sawn-off Shotgun";
             case 27: reasonMsg = "Combat Shotgun";
             case 28: reasonMsg = "MAC-10";
             case 29: reasonMsg = "MP5";
             case 30: reasonMsg = "AK-47";
             case 31: reasonMsg = "M4";
             case 32: reasonMsg = "TEC-9";
             case 33: reasonMsg = "Country Rifle";
             case 34: reasonMsg = "Sniper Rifle";
             case 37: reasonMsg = "Fire";
             case 38: reasonMsg = "Minigun";
             case 41: reasonMsg = "Spray Can";
             case 42: reasonMsg = "Fire Extinguisher";
             case 49: reasonMsg = "Vehicle Collision";
             case 50: reasonMsg = "Vehicle Collision";
             case 51: reasonMsg = "Explosion";
             default: reasonMsg = "Unknown";
       }
       format(msg, sizeof(msg), "*%s killed by %s. (%s)", killerName, playerName, reasonMsg);
       SendClientMessageToAll(COLOR_MAROON, msg);
    }
    else
    {
        switch (reason)
        {
              case 53: format(msg, sizeof(msg), "*%s died. (Drowned)", playerName);
              case 54: format(msg, sizeof(msg), "*%s died. (Collision)", playerName);
              default: format(msg, sizeof(msg), "*%s died.", playerName);
        }
it also won't send these messages
Reply
#4

does it send any message or shows any GameTextForPlayer ?
Reply
#5

Quote:
Originally Posted by BroZeus
View Post
does it send any message or shows any GameTextForPlayer ?
no :/ but if the player get's killed by someone then it works
i can't find anything wrong
Reply
#6

bump sorry ****** can't wait 6 mins more :/
Reply
#7

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(aduty[killerid] == 1 && killerid != INVALID_PLAYER_ID) return GameTextForPlayer(playerid,"~r~Unfair Death",4000,3);
    new msg[128], reasonMsg[32];
    HideAllServerTextDraws(playerid);
    SetPlayerColor(killerid, COLOR_ORANGERED);
    ad_recent1[playerid] =0;
    KillTimer(ad_timer1[playerid]);
    pInfo[playerid][DrugTime]=0;
    if (killerid != INVALID_PLAYER_ID)
    {
        if(randomid == playerid)
        {
            new str1[200];
            randomid = -1;
            new str2[200];

            format(str2, sizeof(str2),"~p~~h~%s (%d) ~w~Has Killed The ~g~Bonus~w~ Player ~p~~h~%s (%d) ~w~And Won ~g~~h~$%d.",pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, randmoney);
            TextDrawSetString(Textdraw111, str2);
            TextDrawShowForAll(Textdraw111);

            new Miney = pInfo[killerid][Money];
            pInfo[killerid][Money] =Miney+randmoney;
            format(str1, sizeof(str1),"* {00B9FF}%s (%d) {FFFFFF}Has Killed The Bonus Player {00B9FF}%s (%d) {FFFFFF}And Won {73FF00}$%d.",pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, randmoney);
            SCMA(COLOR_ORANGE, str1);
            randmoney =0;
        }
        pInfo[killerid][Kills]++;
        pInfo[playerid][Deaths]++;
        new WantedLevel = GetPlayerWantedLevel(killerid);
        if(WantedLevel == 0)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 4);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 6 - Felon - Warrant Issued");
        }
        if(WantedLevel == 4)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 8 - Felon - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MUDER);
        }
        if(WantedLevel == 5)
        {
            SetPlayerWantedLevel(killerid, GetPlayerWantedLevel(killerid) + 1);
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 9 - Most Wanted - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MOSTWANTED);
        }
        if(WantedLevel == 6)
        {
            SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 10 - Most Wanted - Warrant Issued");
            SetPlayerColor(killerid, COLOR_MOSTWANTED);
        }
        SendDeathMessage(killerid, playerid, reason);
        if(InDuel[playerid] == 1)
        {
                new string[256];
                if(DuelCage1 == playerid || DuelCage1 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage1price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage1price*2;
                    DuelCage1 = -1;
                    return 1;
                }
                if(DuelCage2 == playerid || DuelCage2 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage2price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage2price*2;
                    DuelCage2 = -1;
                    return 1;
                }
                if(DuelCage3 == playerid || DuelCage3 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage3price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage3price*2;
                    DuelCage3 = -1;
                    return 1;
                }
                if(DuelCage4 == playerid || DuelCage4 == killerid)
                {
                    Inventation[playerid] = -1;
                    InventationSent[playerid] = -1;
                    Inventation[killerid] = -1;
                    InventationSent[killerid] = -1;
                    InDuel[playerid] = 0;
                    InDuel[killerid] = 0;
                    format(string, sizeof(string), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage4price);
                    SCMA(COLOR_SKYBLUE, string);
                    new Miney = pInfo[killerid][Money];
                    pInfo[killerid][Money] =Miney+DuelCage4price*2;
                    DuelCage4 = -1;
                    return 1;
                }
                return 1;
        }
        KillStreak[killerid] ++;
        new Miney = pInfo[killerid][Money];
        pInfo[killerid][Money] =Miney+500*2;
        SetPlayerWantedLevel(playerid, 0);
        KillStreak[playerid] = 0;
        SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
        new str[256];
        switch(KillStreak[killerid])
        {
            case 2: format(str, sizeof(str), "~g~%s has performed a ~y~double kill!", pInfo[killerid][playername]);
            case 3: format(str, sizeof(str), "~y~Triple Kill for ~b~%s!", pInfo[killerid][playername]);
            case 4: format(str, sizeof(str), "~p~Fourth Kill for ~r~%s!", pInfo[killerid][playername]);
            case 5: format(str, sizeof(str), "~r~%s is dominating with ~p~five kills!", pInfo[killerid][playername]);
            case 6: format(str, sizeof(str), "~w~%s is epic !! Imagine that !! ~y~six kills!", pInfo[killerid][playername]);
            case 7: format(str, sizeof(str), "~r~Epic luck for %s with ~w~seven kills!", pInfo[killerid][playername]);
            case 8: format(str, sizeof(str), "~p~%s is Amazing Killer with ~y~eight kills!", pInfo[killerid][playername]);
            case 9: format(str, sizeof(str), "~g~%s is Profesional !! ~b~nine kills!", pInfo[killerid][playername]);
            case 10: format(str, sizeof(str), "~b~%s is annihilating ! ~g~ten kills!", pInfo[killerid][playername]);
            case 11: format(str, sizeof(str), "~b~%s Nigga ~P~~H~is on ~R~~H~Fire ! ~g~eleven kills!", pInfo[killerid][playername]);
            case 12: format(str, sizeof(str), "~b~~H~ This is totally ~G~~H~shit ! ~g~%s twelve kills!", pInfo[killerid][playername]);
            case 13: format(str, sizeof(str), "~g~~H~ Has Fucked you ~G~~H~ALL ! ~g~%s thirteen kills!", pInfo[killerid][playername]);
            case 14: format(str, sizeof(str), "~g~~H~Aim ~R~Botter ! ~g~%s fourteen kills!", pInfo[killerid][playername]);
            case 15: format(str, sizeof(str), "~r~~H~%s in Offically an ~g~~h~Hacker ! ~g~ fifteen kills!", pInfo[killerid][playername]);
        }
        if(KillStreak[killerid] == 2)
        {
            pInfo[killerid][Money] =Miney+5000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$5000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 3)
        {
            pInfo[killerid][Money] =Miney+6000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$6000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 3)
        {
            pInfo[killerid][Money] =Miney+7000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$7000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 4)
        {
            pInfo[killerid][Money] =Miney+8000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$8000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 5)
        {
            pInfo[killerid][Money] =Miney+9000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$9000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 6)
        {
            pInfo[killerid][Money] =Miney+10000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$10000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 7)
        {
            pInfo[killerid][Money] =Miney+11000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$11000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 8)
        {
            pInfo[killerid][Money] =Miney+12000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$12000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 9)
        {
            pInfo[killerid][Money] =Miney+13000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$13000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 10)
        {
            pInfo[killerid][Money] =Miney+14000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$14000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 11)
        {
            pInfo[killerid][Money] =Miney+14000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$14000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 12)
        {
            pInfo[killerid][Money] =Miney+15000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$15000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 13)
        {
            pInfo[killerid][Money] =Miney+16000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$16000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 14)
        {
            pInfo[killerid][Money] =Miney+17000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$17000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        if(KillStreak[killerid] == 15)
        {
            pInfo[killerid][Money] =Miney+18000;
            new stringg[500];
            format(stringg,sizeof(stringg),"You Recive "GREEN"$18000"SKYBLUE"For Your %d Kills",KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,stringg);
        }
        GameTextForAll(str,3000,3);
        new wepname[32];
        GetWeaponName(reason, wepname, sizeof(wepname));
        SendClientMessageToAll(COLOR_MAROON, msg);
        SetPlayerWantedLevel(playerid, 0);
        if(challenge[playerid] == 1)
        {
               new stringc[256], pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(stringc, sizeof(stringc), "%s (%d) Got Killed In Sniper Death Match By %s (%d)", pInfo[playerid][playername],playerid,pInfo[killerid][playername],killerid);
               SCMA(COLOR_MAROON, stringc);
        }
        if(dms[playerid] == 1)
        {
               new stringc[256], pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(stringc, sizeof(stringc), "%s (%d) got killed in a Death Match Stadium by %s (%d)", pInfo[playerid][playername],playerid,pInfo[killerid][playername],killerid);
               SCMA(COLOR_MAROON, stringc);
        }
        switch (reason)
        {
             case 0: reasonMsg = "Unarmed";
             case 1: reasonMsg = "Brass Knuckles";
             case 2: reasonMsg = "Golf Club";
             case 3: reasonMsg = "Night Stick";
             case 4: reasonMsg = "Knife";
             case 5: reasonMsg = "Baseball Bat";
             case 6: reasonMsg = "Shovel";
             case 7: reasonMsg = "Pool Cue";
             case 8: reasonMsg = "Katana";
             case 9: reasonMsg = "Chainsaw";
             case 10: reasonMsg = "Dildo";
             case 11: reasonMsg = "Dildo";
             case 12: reasonMsg = "Vibrator";
             case 13: reasonMsg = "Vibrator";
             case 14: reasonMsg = "Flowers";
             case 15: reasonMsg = "Cane";
             case 22: reasonMsg = "Pistol";
             case 23: reasonMsg = "Silenced Pistol";
             case 24: reasonMsg = "Desert Eagle";
             case 25: reasonMsg = "Shotgun";
             case 26: reasonMsg = "Sawn-off Shotgun";
             case 27: reasonMsg = "Combat Shotgun";
             case 28: reasonMsg = "MAC-10";
             case 29: reasonMsg = "MP5";
             case 30: reasonMsg = "AK-47";
             case 31: reasonMsg = "M4";
             case 32: reasonMsg = "TEC-9";
             case 33: reasonMsg = "Country Rifle";
             case 34: reasonMsg = "Sniper Rifle";
             case 37: reasonMsg = "Fire";
             case 38: reasonMsg = "Minigun";
             case 41: reasonMsg = "Spray Can";
             case 42: reasonMsg = "Fire Extinguisher";
             case 49: reasonMsg = "Vehicle Collision";
             case 50: reasonMsg = "Vehicle Collision";
             case 51: reasonMsg = "Explosion";
             default: reasonMsg = "Unknown";
       }
       format(msg, sizeof(msg), "*%s killed by %s. (%s)", pInfo[playerid][playername], pInfo[killerid][playername], reasonMsg);
       SendClientMessageToAll(COLOR_MAROON, msg);
    }
    else
    {
        switch (reason)
        {
              case 53: format(msg, sizeof(msg), "*%s died. (Drowned)", pInfo[playerid][playername]);
              case 54: format(msg, sizeof(msg), "*%s died. (Collision)", pInfo[playerid][playername]);
              default: format(msg, sizeof(msg), "*%s died.", pInfo[playerid][playername]);
        }
        pInfo[playerid][Deaths]++;
        SendDeathMessage(playerid, INVALID_PLAYER_ID, reason);
        SendClientMessageToAll(COLOR_MAROON, msg);
        if(randomid == playerid)
        {
            new str1[200];
            randomid = -1;
            new str2[200];
            format(str2, sizeof(str2),"~g~Bonus Player ~p~~h~%s (%d) ~w~Has ~r~died ~w~in an ~y~Accident.", pInfo[playerid][playername], playerid);
            TextDrawSetString(Textdraw111, str2);
            TextDrawShowForAll(Textdraw111);
            format(str1, sizeof(str1),"* Bonus: {00B9FF}%s (%d) {FFFFFF}Has Been Died In An Accident.", pInfo[playerid][playername], playerid);
            SCMA(COLOR_ORANGE, str1);
            randmoney =0;
        }
    }
    SetPlayerColor(playerid, COLOR_GREY);
    PlayerDuelWatching[playerid] = 0;
    Anti_heal[playerid] = 0;
    spawned[playerid] =0;
    AUTO_SAVE(playerid);
    AUTO_SAVE(killerid);
    aduty[playerid] =0;
    return 1;
}
new one but still same problem
Reply
#8

Please help here
Reply
#9

Wow, that took longer than expected..

pawn Code:
public OnPlayerDeath(playerid, killerid, reason)
{
    new msg[128];
    pInfo[playerid][Deaths]++;
    if(killerid != INVALID_PLAYER_ID)
    {
        SendDeathMessage(killerid, playerid, reason);
        if(aduty[killerid]) GameTextForPlayer(playerid,"~r~Unfair Death",4000,3);
        new reasonMsg[32];
        HideAllServerTextDraws(playerid);
        SetPlayerColor(killerid, COLOR_ORANGERED);
        ad_recent1[playerid] = 0;
        KillTimer(ad_timer1[playerid]);
        pInfo[playerid][DrugTime] = 0;
        if(randomid == playerid)
        {
            randomid = INVALID_PLAYER_ID;
            format(msg, sizeof(msg),"~p~~h~%s (%d) ~w~Has Killed The ~g~Bonus~w~ Player ~p~~h~%s (%d) ~w~And Won ~g~~h~$%d.",pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, randmoney);
            TextDrawSetString(Textdraw111, msg);
            TextDrawShowForAll(Textdraw111);
            pInfo[killerid][Money] += randmoney;
            format(msg, sizeof(msg),"* {00B9FF}%s (%d) {FFFFFF}Has Killed The Bonus Player {00B9FF}%s (%d) {FFFFFF}And Won {73FF00}$%d.",pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, randmoney);
            SCMA(COLOR_ORANGE, msg);
            randmoney = 0;
        }
        pInfo[killerid][Kills]++;
        new val = GetPlayerWantedLevel(killerid);
        switch(val)
        {
            case 0:
            {
                SetPlayerWantedLevel(killerid, val + 4);
                SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 6 - Felon - Warrant Issued");
            }
            case 4:
            {
                SetPlayerWantedLevel(killerid, val + 1);
                SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 8 - Felon - Warrant Issued");
                SetPlayerColor(killerid, COLOR_MUDER);
            }
            case 5:
            {
                SetPlayerWantedLevel(killerid, val + 1);
                SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 9 - Most Wanted - Warrant Issued");
                SetPlayerColor(killerid, COLOR_MOSTWANTED);
            }
            case 6:
            {
                SCM(killerid,COLOR_ORANGE,"Committed A Crime (Murder) - Wanted Level 10 - Most Wanted - Warrant Issued");
                SetPlayerColor(killerid, COLOR_MOSTWANTED);
            }
        }
        if(InDuel[playerid])
        {
            new cage = 0;
            if(DuelCage1 == playerid || DuelCage1 == killerid) cage = 1;
            if(DuelCage2 == playerid || DuelCage2 == killerid) cage = 2;
            if(DuelCage3 == playerid || DuelCage3 == killerid) cage = 3;
            if(DuelCage4 == playerid || DuelCage4 == killerid) cage = 4;
            Inventation[playerid] = INVALID_PLAYER_ID;
            InventationSent[playerid] = INVALID_PLAYER_ID;
            Inventation[killerid] = INVALID_PLAYER_ID;
            InventationSent[killerid] = INVALID_PLAYER_ID;
            InDuel[playerid] = 0;
            InDuel[killerid] = 0;
            switch(cage)
            {
                case 1:
                {
                    format(msg, sizeof(msg), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage1price);
                    pInfo[killerid][Money] += (DuelCage1price * 2);
                    DuelCage1 = -1;
                }
                case 2:
                {
                    format(msg, sizeof(msg), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage2price);
                    pInfo[killerid][Money] += (DuelCage2price * 2);
                    DuelCage2 = -1;
                }
                case 3:
                {
                    format(msg, sizeof(msg), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage3price);
                    pInfo[killerid][Money] += (DuelCage3price * 2);
                    DuelCage3 = -1;
                }
                case 4:
                {
                    format(msg, sizeof(msg), "%s (%d) Has Won Duel Against %s (%d) And Won "GREEN"$%d", pInfo[killerid][playername], killerid, pInfo[playerid][playername], playerid, DuelCage4price);
                    pInfo[killerid][Money] += (DuelCage4price * 2);
                    DuelCage4 = -1;
                }
            }
            SCMA(COLOR_SKYBLUE, msg);
        }
        else
        {
            KillStreak[killerid]++;
            pInfo[killerid][Money] += 1000;
            SetPlayerWantedLevel(playerid, 0);
            KillStreak[playerid] = 0;
        }
        SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
        switch(KillStreak[killerid])
        {
            case 2: format(msg, sizeof(msg), "~g~%s has performed a ~y~double kill!", pInfo[killerid][playername]);
            case 3: format(msg, sizeof(msg), "~y~Triple Kill for ~b~%s!", pInfo[killerid][playername]);
            case 4: format(msg, sizeof(msg), "~p~Fourth Kill for ~r~%s!", pInfo[killerid][playername]);
            case 5: format(msg, sizeof(msg), "~r~%s is dominating with ~p~five kills!", pInfo[killerid][playername]);
            case 6: format(msg, sizeof(msg), "~w~%s is epic !! Imagine that !! ~y~six kills!", pInfo[killerid][playername]);
            case 7: format(msg, sizeof(msg), "~r~Epic luck for %s with ~w~seven kills!", pInfo[killerid][playername]);
            case 8: format(msg, sizeof(msg), "~p~%s is Amazing Killer with ~y~eight kills!", pInfo[killerid][playername]);
            case 9: format(msg, sizeof(msg), "~g~%s is Profesional !! ~b~nine kills!", pInfo[killerid][playername]);
            case 10: format(msg, sizeof(msg), "~b~%s is annihilating ! ~g~ten kills!", pInfo[killerid][playername]);
            case 11: format(msg, sizeof(msg), "~b~%s Nigga ~P~~H~is on ~R~~H~Fire ! ~g~eleven kills!", pInfo[killerid][playername]);
            case 12: format(msg, sizeof(msg), "~b~~H~ This is totally ~G~~H~shit ! ~g~%s twelve kills!", pInfo[killerid][playername]);
            case 13: format(msg, sizeof(msg), "~g~~H~ Has Fucked you ~G~~H~ALL ! ~g~%s thirteen kills!", pInfo[killerid][playername]);
            case 14: format(msg, sizeof(msg), "~g~~H~Aim ~R~Botter ! ~g~%s fourteen kills!", pInfo[killerid][playername]);
            case 15: format(msg, sizeof(msg), "~r~~H~%s in Offically an ~g~~h~Hacker ! ~g~ fifteen kills!", pInfo[killerid][playername]);
        }
        GameTextForAll(msg, 3000, 3);
        if(KillStreak[killerid] >= 2)
        {
            new reward = (3000 + (KillStreak[killerid] * 1000));
            pInfo[killerid][Money] += reward;
            format(msg,sizeof(msg),"You Receive "GREEN"$%d"SKYBLUE"For Your %d Kills",reward, KillStreak[killerid]);
            SCM(killerid,COLOR_SKYBLUE,msg);
        }
        if(challenge[playerid])
        {
               new pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(msg, sizeof(msg), "%s (%d) Got Killed In Sniper Death Match By %s (%d)", pInfo[playerid][playername],playerid,pInfo[killerid][playername],killerid);
               SCMA(COLOR_MAROON, msg);
        }
        if(dms[playerid])
        {
               new pname[MAX_PLAYER_NAME];
               GetPlayerName(playerid, pname, sizeof(pname));
               format(msg, sizeof(msg), "%s (%d) got killed in a Death Match Stadium by %s (%d)", pInfo[playerid][playername],playerid,pInfo[killerid][playername],killerid);
               SCMA(COLOR_MAROON, msg);
        }
        switch(reason)
        {
            case 0: reasonMsg = "Unarmed";
            case 1: reasonMsg = "Brass Knuckles";
            case 2: reasonMsg = "Golf Club";
            case 3: reasonMsg = "Night Stick";
            case 4: reasonMsg = "Knife";
            case 5: reasonMsg = "Baseball Bat";
            case 6: reasonMsg = "Shovel";
            case 7: reasonMsg = "Pool Cue";
            case 8: reasonMsg = "Katana";
            case 9: reasonMsg = "Chainsaw";
            case 10: reasonMsg = "Dildo";
            case 11: reasonMsg = "Dildo";
            case 12: reasonMsg = "Vibrator";
            case 13: reasonMsg = "Vibrator";
            case 14: reasonMsg = "Flowers";
            case 15: reasonMsg = "Cane";
            case 22: reasonMsg = "Pistol";
            case 23: reasonMsg = "Silenced Pistol";
            case 24: reasonMsg = "Desert Eagle";
            case 25: reasonMsg = "Shotgun";
            case 26: reasonMsg = "Sawn-off Shotgun";
            case 27: reasonMsg = "Combat Shotgun";
            case 28: reasonMsg = "MAC-10";
            case 29: reasonMsg = "MP5";
            case 30: reasonMsg = "AK-47";
            case 31: reasonMsg = "M4";
            case 32: reasonMsg = "TEC-9";
            case 33: reasonMsg = "Country Rifle";
            case 34: reasonMsg = "Sniper Rifle";
            case 37: reasonMsg = "Fire";
            case 38: reasonMsg = "Minigun";
            case 41: reasonMsg = "Spray Can";
            case 42: reasonMsg = "Fire Extinguisher";
            case 49: reasonMsg = "Vehicle Collision";
            case 50: reasonMsg = "Vehicle Collision";
            case 51: reasonMsg = "Explosion";
            default: reasonMsg = "Unknown";
        }
        format(msg, sizeof(msg), "*%s killed by %s. (%s)", pInfo[playerid][playername], pInfo[killerid][playername], reasonMsg);
        SendClientMessageToAll(COLOR_MAROON, msg);
    }
    else
    {
        switch(reason)
        {
              case 53: format(msg, sizeof(msg), "*%s died. (Drowned)", pInfo[playerid][playername]);
              case 54: format(msg, sizeof(msg), "*%s died. (Collision)", pInfo[playerid][playername]);
              default: format(msg, sizeof(msg), "*%s died.", pInfo[playerid][playername]);
        }
        SendDeathMessage(playerid, INVALID_PLAYER_ID, reason);
        SendClientMessageToAll(COLOR_MAROON, msg);
        if(randomid == playerid)
        {
            randomid = INVALID_PLAYER_ID;
            format(msg, sizeof(msg),"~g~Bonus Player ~p~~h~%s (%d) ~w~Has ~r~died ~w~in an ~y~Accident.", pInfo[playerid][playername], playerid);
            TextDrawSetString(Textdraw111, msg);
            TextDrawShowForAll(Textdraw111);
            format(msg, sizeof(msg),"* Bonus: {00B9FF}%s (%d) {FFFFFF}Has Been Died In An Accident.", pInfo[playerid][playername], playerid);
            SCMA(COLOR_ORANGE, msg);
            randmoney = 0;
        }
    }
    SetPlayerColor(playerid, COLOR_GREY);
    PlayerDuelWatching[playerid] = 0;
    Anti_heal[playerid] = 0;
    spawned[playerid] = 0;
    AUTO_SAVE(playerid);
    AUTO_SAVE(killerid);
    aduty[playerid] = 0;
    return 1;
}
Reply
#10

thanks bro +rep but it won't send the death message if killed by invalid player id
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)