Problem with onplayerdeath
#1

Hello,i've maked this code OnPlayerDeath.

pawn Код:
if(gTeam[killerid] == TEAM_CIV && gTeam[playerid] == TEAM_COP)
    {
    new plwl = GetPlayerWantedLevel(killerid);
    plwl = GetPlayerWantedLevel(killerid);
    SetPlayerWantedLevel(killerid,plwl +6);
    new string2[135];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string2, sizeof(string2), "- MURDER - You have murdered %s (%d) - Wanted Level: %d",pname,playerid,plwl);
    SendClientMessage(killerid,red,string2);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
    new current_zone;
    current_zone = player_zone[i];
    if(gTeam[playerid] == TEAM_COP)
    {
    new copmsg[170];
    new kname[MAX_PLAYER_NAME];
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(kname));
    GetPlayerName(killerid, kname, sizeof(kname));
    format(copmsg, sizeof(copmsg), "- WARNING ALL COPS: %s (%d) murdered %s (%d) at %s",kname,killerid,name,playerid,zones[current_zone][zone_name]);
    SendClientMessage(i, COLOR_BLUE, copmsg);
    }
    }
    }
Everything works fine,except one thing.

The "WARNING ALL COPS etc" need to show ONLY at TEAM_COP and not to TEAM_CIV.

How to fix this?
Reply
#2

if(gTeam[i] == TEAM_COP)
Reply
#3

Nope,doesn't work.
Reply
#4

pawn Код:
if(gTeam[killerid] == TEAM_CIV && gTeam[playerid] == TEAM_COP)
Are those statements being met? Again, use some prints to assist in debugging your code. It will help narrow down where the problem is occurring, believe me!
Reply
#5

Now it works,thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)