Server Crashes when jailing cop
#1

Hey,
When I jail a Cop, server crashes:
Quote:
Originally Posted by crashinfo.txt
--------------------------

Exception At Address: 0x0045ECA7



Registers:

EAX: 0x00000000 EBX: 0x00F3C778 ECX: 0x00000000 EDX: 0x00000000

ESI: 0x00EE0750 EDI: 0x00EE0750 EBP: 0x00F3D124 ESP: 0x0012FDCC

EFLAGS: 0x00010287



Stack:



--------------------------

Exception At Address: 0x0046B37E



Registers:

EAX: 0x00000000 EBX: 0x00000000 ECX: 0x00000000 EDX: 0x00000015

ESI: 0x00F4F260 EDI: 0x00000000 EBP: 0x00F47E1C ESP: 0x0012F3E0

EFLAGS: 0x00010213



Stack:



--------------------------

Exception At Address: 0x0045ECA7



Registers:

EAX: 0x00000000 EBX: 0x00F3C778 ECX: 0x00000000 EDX: 0x00000000

ESI: 0x00EE0750 EDI: 0x00EE0750 EBP: 0x00F3D124 ESP: 0x0012FDCC

EFLAGS: 0x00010287



Stack:



--------------------------

Exception At Address: 0x0047CDC5



Registers:

EAX: 0x6C6C412A EBX: 0x0366C373 ECX: 0x7FFFFFFE EDX: 0x0012F9BB

ESI: 0x0012F618 EDI: 0x0012FBF6 EBP: 0x0012F664 ESP: 0x0012F5D8

EFLAGS: 0x00010202



Stack:
Here is my jail command:

pawn Код:
dcmd_jail(playerid, params[])
{
  if (dUserINT(PlayerName(playerid)).("Adminlvl")>=3 || gTeam[playerid] == 2)
    {
        new id, time, reason[64], name [24], plname [24];
        if (sscanf(params, "uds", id, time,reason)) UsageMsg(playerid, "Usage: /jail <PlayerID/PartOfName> <minutes> <reason>");
        else if (id == INVALID_PLAYER_ID) ErrorMsg(playerid, "Player not found");
        else if (jailed[id] == 1) return ErrorMsg(playerid, "Player is already jailed");
        else
        {
                GetPlayerName(playerid,name,24);
                GetPlayerName(id,plname,24);
                SendFMessage(playerid,COLOR_SYSTEM,"Player %s has been jailed for %i minutes. Reason: %s", plname,time,reason); //Formats String And Sends To Player
                SendFMessage(id,COLOR_SYSTEM,"You have been jailed by %s for %i minutes. Reason: %s",name,time,reason); //same as above
                SetPlayerInterior(id, 10);
                SetPlayerPos(id,224.1258,111.1923,999.0156);
                JailMinutesTimer = SetTimerEx("JailMinutes",60000,1,"di",id,time);
                dUserSet(plname).("Jailed","yes");
                dUserSetINT(plname).("JailedFor",time);
                new oldreason[512];
                new string[64];
                format(oldreason, sizeof(oldreason),"%s",dUser(plname).("JailReason"));
                format(string,sizeof(string),"%s,%s",oldreason,reason);
                dUserSet(plname).("JailReason",string);
                dUserSet(plname).("wasJailed","yes");
                jailed[id] = 1;
        }
    }
    else return ErrorMsg(playerid,"Unknown command. See server commands by typing /cmd.");
    return 1;
}
If I jail normal players (non cops) like medics and others everything is ok... But on cop server crashes....
Reply
#2

Nobody knows why I have this problem?
Reply
#3

Check if the given ID is a COP team assigned ID.

If it is, return 1;

That'll just stop him from doing anything to the given id.
Reply
#4

But I may need to jail cops, so maybe instead of returning 1 I'll make them to non-cops...
Thanks.. I couldn't think that myself...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)