Why does my server.exe keep crashing?
#1

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?
Reply
#2

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.
Reply
#3

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?
Reply
#4

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
Reply
#5

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");
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)