ZCMD HELP
#1

So I have something like this
Код:
CMD:Sall(playerid, params[])
{
	SendClientMessage(playerid, 0xFFFFFF, params);
	return 1;
}
1)And the server return Server:Unknown command, first of all how I can change this message
2)why zcmd keep telling me Server:Unknown command?
edit, I changed in SendClientMessage(playerid, 0xFFFFFF, params); with SendClientMessage(playerid, 0xFFFFFF, "Hello"); it's works I dont understand why
Reply
#2

Do you have the include ? Compiled with it ? Show us your server.log too. c:
Reply
#3

Код:
SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team

[09:51:36] filterscripts = ""  (string)
[09:51:36] 
[09:51:36] Server Plugins
[09:51:36] --------------
[09:51:36]  Loading plugin: sscanf
[09:51:36] 

[09:51:36]  ===============================

[09:51:36]       sscanf plugin loaded.     

[09:51:36]          Version:  2.8.2        

[09:51:36]    © 2012 Alex "******" Cole  

[09:51:36]  ===============================

[09:51:36]   Loaded.
[09:51:36]  Loaded 1 plugins.

[09:51:37] 
[09:51:37] Filterscripts
[09:51:37] ---------------
[09:51:37]   Loaded 0 filterscripts.

[09:51:37] 
----------------------------------
[09:51:37]  Blank Gamemode by your name here
[09:51:37] ----------------------------------

[09:51:37] Number of vehicle models: 0
[09:51:48] [connection] 127.0.0.1:49622 requests connection cookie.
[09:51:49] [connection] incoming connection: 127.0.0.1:49622 id: 0
[09:51:50] [join] Player has joined the server (0:127.0.0.1)
thats the log
Reply
#4

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
Do you have the include ? Compiled with it ?
There is no error/warnings on compilation?
Reply
#5

First question.

PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new 
errormsg[250];
    
format(errormsg,sizeof(errormsg),"[SYSTEM]: This command does not exist.");
    if(!
success) return SendClientMessage(playerid, COLOR_WHITE, errormsg);
    return 
1;
} 
Is an example.

Second question
PHP код:
CMD:sall(playerid, params[]) //You can't have capitals in commands. They need to be lower case.
{
    
SendClientMessage(playerid, 0xFFFFFF, params);
    return 
1;
} 
Reply
#6

Thanks a lot!


Edit: In game will ignore the case letter?
Reply
#7

Quote:
Originally Posted by Tass007
Посмотреть сообщение
PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success)
{
    new 
errormsg[250];
    
format(errormsg,sizeof(errormsg),"[SYSTEM]: This command does not exist.");
    if(!
success) return SendClientMessage(playerid, COLOR_WHITE, errormsg);
    return 
1;
} 
Format/define the string inside the brackets, not outside - you won't be needing it if the command does succeed.

PHP код:
public OnPlayerCommandPerformed(playerid, cmdtext[], success) {
    if(!
success) {
        new 
            
errormsg[48];
        
format(errormsg,sizeof(errormsg),"[SYSTEM]: This command does not exist.");
        
SendClientMessage(playerid, COLOR_WHITE, errormsg);
    }
    return 
1;
} 
Reply


Forum Jump:


Users browsing this thread: