23.10.2011, 10:04
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?
return SendClientMessage(playerid, COLOR_REDONLY, "[ERROR] Unknown command, use /Commands for a list of available commands");
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"); |
warning 225: unreachable code
public OnPlayerCommandText(playerid, cmdtext[])
{
return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
return 1;
}
I get
pawn Код:
pawn Код:
|
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
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");
}
return 0;
return SendClientMesage(playerid, COLOR_ORANGE, "Command does not exist please use /help");
Код:
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 |
public OnPlayerCommandText(playerid, cmdtext[])
{
return SendClientMessage(playerid, 1, "[ERROR] Unknown command, use /help for a list of available commands");
}