Using ZCMD and giving me unknown command?
#1

Hey! So as I started using zcmd, I made a command like this for a simple test:
pawn Код:
COMMAND:help(playerid, params[])
{
    SendClientMessage(playerid, COLOR_WHITE,"IT WORKS!");
}
Now when i go ingame and type /help it gives me the message and after that: SERVER: Unknown command. How could I fix this? I'm using both includes, zcmd and sscanf.

They are not placed in the onplayercommandtext function because it wont let me.
Reply
#2

Add this somewhere in your gamemode
Код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    return 1;
}
Reply
#3

Just like that? Why so? It is true it worked.
Reply
#4

Yea , just like that , don't ask me why and how it works because i don't know i just use it )
Reply
#5

WOW! @Rock18 - Dude, that code what you gave him is not wrong or anything, but that code will do a totally different thing from what he asked.

@Spiral - When you are doing the commands in ZCMD you NEED to return them as true/false.

Your command should look like:

pawn Код:
COMMAND:help(playerid, params[])
{
    SendClientMessage(playerid, COLOR_WHITE,"IT WORKS!");
    return 1; // You see this. You need to return it as a false/true!
}
Reply
#6

Well whats the difference? I used many commands in a row, why should I waste 50 more lines on 50 more commands, if i could only use 4 lines?
Reply
#7

Because it tells the script that the command was successfull.
Reply
#8

Quote:
Originally Posted by Spiral
Посмотреть сообщение
Well whats the difference? I used many commands in a row, why should I waste 50 more lines on 50 more commands, if i could only use 4 lines?
LMAO! Don't be scared to waste lines.
And you'll have your script working more smother. You can look here to see how the commands work with ZCMD.
Reply
#9

Quote:
Originally Posted by Spiral
Посмотреть сообщение
Well whats the difference? I used many commands in a row, why should I waste 50 more lines on 50 more commands, if i could only use 4 lines?
First person who I have seen which do not like "lines" in their script and consider it as "waste".
Reply
#10

If you want to save your lines, put return before your last function.
pawn Код:
COMMAND:help(playerid, params[])
{
    return SendClientMessage(playerid, COLOR_WHITE,"IT WORKS!");
}
Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)