Strcmp to zcmd help
#1

Need help converting this strcmp to zcmd.

PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new 
string[64], temp1, temp2;
    if (
strcmp(cmdtext, "/gatemode", true, 9) == 0)
    {
        if (
strlen(cmdtext[10]) == 0)
        {
            
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic");
            return 
1;
        }
        
temp1 = strval(cmdtext[10]);
        if (
temp1 != 0 && temp1 != 1)
        {
            
SendClientMessage(playerid, 0xFFFF00FF, "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(playerid, params[ ])
    { 
        if(
isnull(params)) 
        { 
            
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic"); 
            return 
1; 
        } 
        
temp1 = strval(params); 
        if (
temp1 != 0 && temp1 != 1) 
        { 
            
SendClientMessage(playerid, 0xFFFF00FF, "Usage: /gatemode 0 = commands, 1 = automatic"); 
            return 
1; 
        } 
Reply
#3

Thank you. +1 Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)