SA-MP Forums Archive
Tiny problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Tiny problem (/showthread.php?tid=191597)



Tiny problem - TheNuttyScientist - 19.11.2010

Код:
E:\SA-MP Server\gamemodes\lvdm.pwn(577) : warning 209: function "OnPlayerCommandText" should return a value
Line:

pawn Код:
}
     SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
}
It may be a small spelling mistake somewhere, but I'm not very sure.


AW: Tiny problem - Extremo - 19.11.2010

All you have to do is return 1; or return 0; Depending on if you want it to say Unknown Command or not. 1 Means no message all fine, 0 means the command does not exist.


Re: Tiny problem - IstuntmanI - 19.11.2010

You must to have
Код:
return SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
so will be:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //stuff
    //another stuff
    return SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
}



Re: Tiny problem - BigAl - 19.11.2010

if(strcmp(cmdtext, "/command", true) == 0);
{
SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
return 1;
}

Try that


Re: Tiny problem - TheNuttyScientist - 19.11.2010

Quote:
Originally Posted by costel_nistor96
Посмотреть сообщение
You must to have
Код:
return SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
so will be:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    //stuff
    //another stuff
    return SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
}
Ah, I remember that now. I'm such an idiot, thanks for helping.


Re: Tiny problem - dark_clown - 19.11.2010

pawn Код:
}
     else return SendClientMessage(playerid, RED, "That is an unknown command! Type /cmds for a list of available commands.");
}