SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (/showthread.php?tid=530849)



Help - AkaSKY - 09.08.2014

Hello ! I got this script: http://pastebin.com/c8sKcYip. The problem is that it works for a player, if i'm right the playerid, but for the other player (pid) it says "No one comitted any illegal against you." even if someone did. Please help me with this problem. Thank you.


Re: Help - SanAndreasMP - 09.08.2014

Care to share the codes?


Re: Help - AkaSKY - 09.08.2014

Код:
	

    if(strcmp("/call 112", cmdtext, true) == 0)
    {
    new pid; if(IsPlayerConnected(pid) && IsPlayerConnected(playerid))
    {
    if(Cell[playerid] == 1 && Cell[pid] == 2)
    {
        Cell[playerid] = 0;
            Cell[pid] = 0;
            SendClientMessage(playerid, COLOR_RED, "PD: Thank you for reporting the illegal.");
            if(GetPlayerWantedLevel(pid) < 6)
            {
            if(pid != INVALID_PLAYER_ID) SetPlayerWantedLevel(pid, GetPlayerWantedLevel(pid) + 1);
        new string[128],name[MAX_PLAYERS];
        GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "Current wanted: %d, {FF0000}Reporter: %s {FF0000}Crime: Murder", GetPlayerWantedLevel(pid), name);
            SendClientMessage(pid, COLOR_YELLOW, string);
            return 1;
            }
            if(GetPlayerWantedLevel(pid) == 6)
            {
        new tmp[128],name[MAX_PLAYERS];
        GetPlayerName(playerid, name, sizeof(name));
        format(tmp, sizeof(tmp), "Current wanted: 6, {FF0000}Reporter: %s {FF0000}Crime: Murder", name);
            SendClientMessage(pid, COLOR_YELLOW, tmp);
            SetPlayerWantedLevel(pid, GetPlayerWantedLevel(pid) + 0);
            return 1;
            }
            SetTimerEx("Wanted", 1800000, false, "i", pid);
    }
    else
    {
    SendClientMessage(playerid, COLOR_WHITE, "No one comitted any illegal against you.");
    return 1;
    }}
    return 1;
    }
    ////////////////////////////////
    public OnPlayerDeath(playerid,killerid,reason)
    {
        if(killerid != INVALID_PLAYER_ID && playerid != INVALID_PLAYER_ID)
        {
        Cell[playerid] = 1;
        Cell[killerid] = 2;
            new str[128], playername[MAX_PLAYER_NAME];
            GetPlayerName(killerid, playername, sizeof(playername));
            format(str, sizeof(str), "%s killed you. You have 60 seconds to type /call 112.", playername);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str);
            SetTimerEx("Killcell",60000,false, "i", playerid);
            return 1;
            }
    return 1;
    }