Strcmp to zcmd help
#1

Need help converting this strcmp to zcmd.

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    new 
string[64], temp1temp2;
    if (
strcmp(cmdtext"/gatemode"true9) == 0)
    {
        if (
strlen(cmdtext[10]) == 0)
        {
            
SendClientMessage(playerid0xFFFF00FF"Usage: /gatemode 0 = commands, 1 = automatic");
            return 
1;
        }
        
temp1 strval(cmdtext[10]);
        if (
temp1 != && temp1 != 1)
        {
            
SendClientMessage(playerid0xFFFF00FF"Usage: /gatemode 0 = commands, 1 = automatic");
            return 
1;
        } 
As always, who ever helps will get +1 Rep.

Cheers, thanks for your time.
Reply
#2

PHP код:
CMD:gatemode(playeridparams[ ])
    { 
        if(
isnull(params)) 
        { 
            
SendClientMessage(playerid0xFFFF00FF"Usage: /gatemode 0 = commands, 1 = automatic"); 
            return 
1
        } 
        
temp1 strval(params); 
        if (
temp1 != && temp1 != 1
        { 
            
SendClientMessage(playerid0xFFFF00FF"Usage: /gatemode 0 = commands, 1 = automatic"); 
            return 
1
        } 
Reply
#3

Thank you. +1 Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)