SA-MP Forums Archive
Strange 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: Strange problem. (/showthread.php?tid=99089)



Strange problem. - ded - 25.09.2009

Hi, I have a problem. Ever since I upgraded my gamemode to 0.3 I have been encountering alot of problems, the latest one is .. on some commands it sends the message "Server: Unknown Command" but the command still works, now I've checked the whole gamemode and remote handlers for something that could be causing this and I have found nothing, i just don't understand it.

Has anybody got any idea's as to what could be causing this?

I can't show any code because the script is private, so just idea's and thoughts please.


Re: Strange problem. - Goobiiify - 25.09.2009

does the command works but it's give you a "unknown command" too?
in that case, return 1;


Re: Strange problem. - _Vortex - 25.09.2009

Quote:
Originally Posted by » Pawnst★r «
I can't show any code because the script is private, so just idea's and thoughts please.
How can it be so private that you can't even show the commands? xD

Anyways, yeah, make sure it returns 1.


Re: Strange problem. - ded - 25.09.2009

Make sure what returns 1? I have OnPlayerCommandText returning 0.


Re: Strange problem. - Desert - 25.09.2009

OnPlayerCommandText returns 0 if the command does not exist in your script.
Since as you say its only some of them make sure there is return 1; at all of them


Re: Strange problem. - Peter_Corneile - 25.09.2009

Try adding return 0; at the last of the OnPlayerCommandText only but return 1; must be in eevry command .. Only one return 0; (at the last of OnPlayerCommandText)


Re: Strange problem. - ded - 25.09.2009

Quote:
Originally Posted by Desert
OnPlayerCommandText returns 0 if the command does not exist in your script.
Since as you say its only some of them make sure there is return 1; at all of them
On all of my commands? Ok .. I will check ... for the 4th time.

Also, I have return 0; in some of my commands ... an example of this:

pawn Код:
dcmd_clearallchat(playerid,params[]) {
  #pragma unused params
    if(PlayerInfo[playerid][Level] >= 3) {
        CMDMessageToAdmins(playerid,"CLEARALLCHAT");
        for(new i = 0; i < 50; i++) SendClientMessageToAll(green," "); return 1;
    } else return 0;
}
Is this correct? Like I say, it all worked perfectly in 0.2x but in 0.3 it is causing me alot of problems :/


Re: Strange problem. - Peter_Corneile - 25.09.2009

Ahh so its dcmd eh .... I am new to dcmd actually


Re: Strange problem. - ded - 25.09.2009

New to dcmd?! xD

Yeah, well ... any help is great.


Re: Strange problem. - Peter_Corneile - 25.09.2009

Ye i use strcmp cos it is easy for me xD .. But still try removing return 0 from each command and just let one be at the last