SA-MP Forums Archive
ZCMD HELP - 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)
+--- Thread: ZCMD HELP (/showthread.php?tid=622936)



ZCMD HELP - POL_george - 28.11.2016

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


Re: ZCMD HELP - Dayrion - 28.11.2016

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


Re: ZCMD HELP - POL_george - 28.11.2016

Код:
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


Re: ZCMD HELP - Dayrion - 28.11.2016

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


Re: ZCMD HELP - Tass007 - 28.11.2016

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;
} 



Re: ZCMD HELP - POL_george - 28.11.2016

Thanks a lot!


Edit: In game will ignore the case letter?


Re: ZCMD HELP - d1git - 28.11.2016

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;
}