Server crashes upon command
#1

This is a rather strange bug, I spent some time trying to solve it but I couldn't, I hope that some of you might have the magical solution..

This command is the error, if a Helper accepts a help request, the server simply crashes.

pawn Код:
CMD:accepthelp(playerid, params[])
{
    foreach(Player, i)
    {
        if( GetPVarInt( i, "COMMUNITY_ADVISOR_REQUEST" ) >= 1 )
        {
            AdvisorCall = i;
        }
    }
    if(AdvisorCall < 999)
    {
        if(IsPlayerConnected(AdvisorCall))
        {
            new string[128];
            if(HelpingNewbie[playerid] != 999)
            {
                SendClientMessageEx(playerid, COLOR_GRAD2, "  You are already helping someone.");
                return 1;
            }
            if(GetPVarInt(playerid, "AdvisorDuty") == 0)
            {
                SendClientMessageEx(playerid, COLOR_GRAD2, "  You are not on duty as a community advisor.");
                return 1;
            }
            format(string, sizeof(string), "* %s has accepted the help request from %s.",GetPlayerNameEx(playerid), GetPlayerNameEx(AdvisorCall));
            SendDutyAdvisorMessage(TEAM_AZTECAS_COLOR, string);
            format(string, sizeof(string), "* You have accepted %s's help request, once you are done type /finishhelp to get back to your position.",GetPlayerNameEx(AdvisorCall));
            SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
            format(string, sizeof(string), "* Helper %s has accepted your help request.",GetPlayerNameEx(playerid));
            SendClientMessageEx(AdvisorCall, COLOR_LIGHTBLUE, string);
            PlayerInfo[playerid][pAcceptedHelp]++;
            new Float: x, Float: y, Float: z, Float: r, i, vw;
            vw = GetPlayerVirtualWorld(playerid);
            i = GetPlayerInterior(playerid);
            GetPlayerPos(playerid, x, y, z);
            GetPlayerFacingAngle(playerid, r);
            SetPVarFloat(playerid, "AdvisorLastx", x);
            SetPVarFloat(playerid, "AdvisorLasty", y);
            SetPVarFloat(playerid, "AdvisorLastz", z);
            SetPVarFloat(playerid, "AdvisorLastr", r);
            SetPVarInt(playerid, "AdvisorLastInt", i);
            SetPVarInt(playerid, "AdvisorLastVW", vw);
            GetPlayerPos(AdvisorCall, x, y, z);
            vw = GetPlayerVirtualWorld(AdvisorCall);
            i = GetPlayerInterior(AdvisorCall);
            SetPlayerPos(playerid, x, y+2, z);
            SetPlayerVirtualWorld(playerid, vw);
            SetPlayerInterior(playerid, i);
            HelpingNewbie[playerid] = AdvisorCall;
            AdvisorCall = 999;
            AddCAReportToken(playerid); // Advisor Tokens
            return 1;
        }
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_GREY, "   No-one has requested any help yet!");
        return 1;
    }
    return 1;
}
Reply
#2

me too
anybody please help!

when it runs on windows server its okay, but on linux it crash.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)