SA-MP Forums Archive
server: unknown command?! But i know it exist! - 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: server: unknown command?! But i know it exist! (/showthread.php?tid=259946)



server: unknown command?! But i know it exist! - justsomeguy - 06.06.2011

Hey eEverytime i try to use ANY command(one i KNOW it excist) i get:
Quote:
Originally Posted by SAMP CLIENT
Server: Unknown command.
What can be wrong? i searched everything!
http://pastebin.com/EwWCLvxa

If you can help me i would be very pleased.

Thanks in advance.


Re: server: unknown command?! But i know it exist! - KoczkaHUN - 06.06.2011

pawn Код:
if (!strcmp("/kill", cmdtext, true, 5))
    {
        SetPlayerHealth(playerid, 0.0);
        return 1;
    }
also you don't need to check if IsPlayerConnected to playerid, because the callbacks already check for it.
You just need to check for playerids that are given by user input.


Re: server: unknown command?! But i know it exist! - justsomeguy - 06.06.2011

Doesnt work, and the problem isnt just at the /kill command(topic updated).


Respuesta: server: unknown command?! But i know it exist! - Lunnatiicz - 06.06.2011

pawn Код:
return 0;
}
replace for

pawn Код:
return SendClientMessage(playerid, Color, "Command don't exist's");
}
lol i dont know much english с_с


Respuesta: server: unknown command?! But i know it exist! - Lunnatiicz - 06.06.2011

Sorry for 2ble post :B

In all commands you have this.

pawn Код:
if(strcmp(cmd, "/anycommand", true) == 0)
Replace that for this, in everthing commands

pawn Код:
if (!strcmp("/anycommand", cmdtext, true))
Cmdtext for strtok, if dont use only cmd

Good loock? xd


Re: server: unknown command?! But i know it exist! - justsomeguy - 07.06.2011

Yeah i tought sow too..
Can anyone please help?


Re: server: unknown command?! But i know it exist! - KoczkaHUN - 07.06.2011

may the strtok is the problem... i wouldn't believe in that function anymore. use sscanf instead.


Re: server: unknown command?! But i know it exist! - justsomeguy - 07.06.2011

@above
I dont know how to use sscanf.XD.


Re: server: unknown command?! But i know it exist! - Steven82 - 07.06.2011

Quote:
Originally Posted by KoczkaHUN
Посмотреть сообщение
may the strtok is the problem... i wouldn't believe in that function anymore. use sscanf instead.
There is nothing wrong with strtok it's just out dated....so i would still believe in that function if you wanted a godfather edit or something and didn't feel like converting all the commands.


Re: server: unknown command?! But i know it exist! - *IsBack - 07.06.2011

Some function in returning 0 (instead of 1 or anything else). Returning 0 on OnPlayerCommandText callback, gives you "Unknown command" error. One of your filterscripts may cause this problem too..
Make sure to return 1; after every command check (strcmp), and make sure you got return 0; (or return SendClientMessage(playerid,color,"Unknown command!!"); ) at the end of OnPlayerCommandText callback.
Edit: I'm feeling ignored....