server: unknown command?! But i know it exist!
#1

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

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

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

pawn Код:
return 0;
}
replace for

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

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

Yeah i tought sow too..
Can anyone please help?
Reply
#7

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

@above
I dont know how to use sscanf.XD.
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 5 Guest(s)