SA-MP Forums Archive
YCMD to ZCMD - 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: YCMD to ZCMD (/showthread.php?tid=576889)



YCMD to ZCMD - Sn4ke2 - 07.06.2015

Hy, how to move this command from YCMD to ZCMD ?
PHP код:
#include <a_samp>
#include <fly>
public OnFilterScriptInit()
{
    print(
"=========================================\n");
    print(
"Fly include demo FS by Norck");
    print(
" ");
    print(
"=========================================\n");
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
InitFly(playerid);
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if(!
strcmp(cmdtext,"/fly",true))
    {
        
StartFly(playerid);
        return 
1;
    }
    if(!
strcmp(cmdtext,"/stopfly",true))
    {
        
StopFly(playerid);
        return 
1;
    }
    return 
0;




Re: YCMD to ZCMD - Konstantinos - 07.06.2015

That strcmp and not YCMD. Also there are so many tutorials about how to write a command in ZCMD, you should search next time.

PHP код:
CMD:fly(playeridparams[])
{
    
StartFly(playerid);
    return 
1;
}

CMD:stopfly(playeridparams[])
{
    
StopFly(playerid);
    return 
1;




Re: YCMD to ZCMD - NoDi522 - 07.06.2015

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
That strcmp and not YCMD. Also there are so many tutorials about how to write a command in ZCMD, you should search next time.

PHP код:
CMD:fly(playeridparams[])
{
    
StartFly(playerid);
    return 
1;
}
CMD:stopfly(playeridparams[])
{
    
StopFly(playerid);
    return 
1;

Do what Konstantinos said and be sure you include it at the top of the script:

PHP код:
#include <zcmd> 



Re: YCMD to ZCMD - Sn4ke2 - 07.06.2015

ok, Thank you :*