double slash command
#1

How do I make a double slash command with ZCMD?

PHP код:
CMD:/(playeridparams[])
{
                if(!
user.admin[playerid]) return SendClientMessage(playerid0xFF0000"Si komanda tik adminams");
                new 
txt[128];
                if(
sscanf(params"s[128]" txt)) SendClientMessage(playerid0xFF0000"* Naudojimas: // [zinute]");
                new 
zin[256],vardas[MAX_PLAYER_NAME];
                
GetPlayerName(playerid,vardas,MAX_PLAYER_NAME);
                
format(zin,sizeof(zin),"%s: %s",vardas,txt);
                for(new 
i=0;i<MAX_PLAYERS;i++)
                {
                    if(
IsPlayerConnected(i))
                    {
                        if(
user.admin[playerid] || user.meras[playerid])
                        {
                            
SendClientMessage(i,0xFF4500AA,zin);
                        }
                    }
                }
                return 
1;

I want it to be like this , but this kind of command gives errors when compiling because of the CMD:/
Reply
#2

It is not possible with zcmd, since it creates a public function with the address / title command.
Reply
#3

You can create it like this
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("//", cmdtext, true, 10) == 0)
    {
     ////command here
     return 1;
    }
    return 0;
}
Reply
#4

Or you can use OnPlayerText.

@TokicMajstor, he asked with zcmd.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)