Police System Send Crime Report (OnPlayerDeath)
#7

You are sending a crime report even if there is no killer. Also, I think you meant to use killerid instead of playerid in that GetPlayerName thingy, since the killer is the suspect, not the victim.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new oldlevel;
    new newlevel;
    oldlevel = GetPlayerWantedLevel(killerid);
    newlevel = oldlevel + 1;
    if(killerid != INVALID_PLAYER_ID)
    {
        //if(!(killerid) && reason != 53) SendDeathMessage(killerid, playerid, reason); // Doesn't work..
        SetPlayerWantedLevel(killerid, newlevel);
        //SetPlayerWantedLevel(playerid, 0); // Removes wanted players killer, wanted level
        SendClientMessage(killerid, COP_COLOR ,"You have committed a crime, FIRST DEGREE MURDER.");
        //PlayCrimeReportForPlayer(string, 0, 3); //Not implemented yet
        new string[256], name[MAX_PLAYER_NAME]; GetPlayerName(killerid, name, sizeof(name));
        format(string, sizeof(string), "NEW CRIME REPORT: First Degree Murder, SUSPECT: {AFAFAF}%s{375FFF}", name);
        TeamChat(string);
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)