SA-MP Forums Archive
Why does my server.exe keep crashing? - 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: Why does my server.exe keep crashing? (/showthread.php?tid=292251)



Why does my server.exe keep crashing? - rangerxxll - 23.10.2011

I'm not on a host provider or anything, I'm just running the server.exe and everytime I do ANY command that doesn't exist, it crashes. How can I fix this problem?


Re: Why does my server.exe keep crashing? - manchestera - 23.10.2011

Try putting this at the top of public OnPlayerCommandText(playerid, cmdtext[]) {

Код:
return SendClientMessage(playerid, COLOR_REDONLY, "[ERROR] Unknown command, use /Commands for a list of available commands");
Not 100% sure if it will work.


Re: Why does my server.exe keep crashing? - rangerxxll - 23.10.2011

Quote:
Originally Posted by manchestera
Посмотреть сообщение
Try putting this at the top of public OnPlayerCommandText(playerid, cmdtext[]) {

Код:
return SendClientMessage(playerid, COLOR_REDONLY, "[ERROR] Unknown command, use /Commands for a list of available commands");
Not 100% sure if it will work.
I get
pawn Код:
warning 225: unreachable code
When I do
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
    return 1;
}
Am I putting it in the wrong position?


Re: Why does my server.exe keep crashing? - manchestera - 23.10.2011

Quote:
Originally Posted by rangerxxll
Посмотреть сообщение
I get
pawn Код:
warning 225: unreachable code
When I do
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
    return 1;
}
Am I putting it in the wrong position?
Код:
OnPlayerCommandText(playerid, cmdtext[])
{//remove this 
    return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
	return 1;//remove this
}
//here put your first cmd
if it still will not compile post OnplayerCommandText from the top to the last of the first cmd


Re: Why does my server.exe keep crashing? - Kostas' - 23.10.2011

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/help", true))
    {
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: This is the /help command!");
        return 1;
    }
    return SendClientMesage(playerid, COLOR_ORANGE, "Command does not exist please use /help");
}
Replace
pawn Код:
return 0;
with the Message you want
For Example
pawn Код:
return SendClientMesage(playerid, COLOR_ORANGE, "Command does not exist please use /help");



Re: Why does my server.exe keep crashing? - rangerxxll - 23.10.2011

Quote:
Originally Posted by manchestera
Посмотреть сообщение
Код:
OnPlayerCommandText(playerid, cmdtext[])
{//remove this 
    return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
	return 1;//remove this
}
//here put your first cmd
if it still will not compile post OnplayerCommandText from the top to the last of the first cmd
Eh, now whenever I log in the server.exe closes lol.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
   
}
Also, is it usual for it to crash when doing a command that doesn't exist? It should just stay open and not show any text if I do a wrong command.