SA-MP Forums Archive
/pm shut down the server - 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: /pm shut down the server (/showthread.php?tid=292710)



/pm shut down the server - Chris_Morrison - 24.10.2011

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!


Re : /pm shut down the server - [M.A]Angel[M.A] - 24.10.2011

Are you host server in company?


Re: /pm shut down the server - spd_sahil - 24.10.2011

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


Re : /pm shut down the server - Naruto_Emilio - 24.10.2011

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..


Re: Re : /pm shut down the server - Chris_Morrison - 24.10.2011

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


Re: /pm shut down the server - Chris_Morrison - 25.10.2011

Bump


Re: /pm shut down the server - SmiT - 25.10.2011

Mind showing your "PMLog" function?


Re: /pm shut down the server - Feel - 25.10.2011

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


Re: /pm shut down the server - suhrab_mujeeb - 25.10.2011

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.


Re: /pm shut down the server - Chris_Morrison - 25.10.2011

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