/pm shut down the server
#1

Hello
i started a linxus server and when someone /pm to someone else the server just shut down
in my windows it's not happend
pawn Код:
if(strcmp(cmd, "/pm", true) == 0 || strcmp(cmd, "/p", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You havent logged in yet!");
                return 1;
            }
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} (/p)m [playerid/PartOfName] [text]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if (IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    if(HidePM[giveplayerid] > 0)
                    {
                        SendClientMessage(playerid, COLOR_GREY, "   That player is blocking messages!");
                        return 1;
                    }
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    if(giveplayerid == playerid)
                    {
                        return SendClientMessage(playerid, COLOR_GREY, "   You can`t send private message to yourself.");
                    }
                    new length = strlen(cmdtext);
                    while ((idx < length) && (cmdtext[idx] <= ' '))
                    {
                        idx++;
                    }
                    new offset = idx;
                    new result[128];
                    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                    {
                        result[idx - offset] = cmdtext[idx];
                        idx++;
                    }
                    result[idx - offset] = EOS;
                    if(!strlen(result))
                    {
                        SendClientMessage(playerid, COLOR_GRAD2, "{33CCFF}USAGE:{FFFFFF} (/p)m [playerid/PartOfName] [text]");
                        return 1;
                    }
                    CheckPM(playerid,(result));
                    format(string, sizeof(string), "[ID:%d] %s pm: %s", playerid, sendername, (result));
                    SendClientMessage(giveplayerid, 0xBBA033AA, string);
                    format(string, sizeof(string), "PM sent to [ID:%d]%s: %s", giveplayerid, giveplayer, (result));
                    SendClientMessage(playerid,  0xE5C43EAA, string);
                    format(string, sizeof(string), ">>PM from [%d]%s to [%d]%s: %s", playerid,sendername,giveplayerid, giveplayer, (result));
                    PMLog(string);
                    for(new z=0;z<PLAYERS;z++)
                        if (BigEar[z])
                            SendClientMessage(z,  0x1ED5C7FF, string);
                    return 1;
                }
            }
            else
            {
                    format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
                    SendClientMessage(playerid, COLOR_GRAD1, string);
            }
        }
        return 1;
    }
Thanks alot!
Reply
#2

Are you host server in company?
Reply
#3

what about in other commands.. ? try using some other commands.. and see if it shuts down
Reply
#4

Why are you still using this, try to use sscanf, and zcmd it will be faster + more saving lines...
6 lines to make a pm in sscanf and zcmd,
strcmp will use like 15 line to make it.. and will make it lagging the memory..
Reply
#5

Quote:
Originally Posted by [M.A]Angel[M.A]
Посмотреть сообщение
Are you host server in company?
Yes.
Reply
#6

Bump
Reply
#7

Mind showing your "PMLog" function?
Reply
#8

I know whats wrong, you dont have the log file where it should save, had the same problem.
Reply
#9

Quote:
Originally Posted by Feel
Посмотреть сообщение
I know whats wrong, you dont have the log file where it should save, had the same problem.
Yeah that's the reason it will shutdown the server. The same happened to people in the SFCRRPG script where the scriptfiles folder was named as "scripfiiles" so when the server didn't find the name scriptfiles folder it just shutdown.
Reply
#10

The PM.log is empty and it's on the right place
And /kick and /ban shut it down too!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)