[HELP]DCMD
#1

Hallo!
I make FS and the commands work but the others not works:S
This is the FS
pawn Код:
#include <a_samp>
#include <colors>
#define LIGHTBLUE2   0xF6BB0AA
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

dcmd_setallcash(playerid,params[])
{
    if(IsPlayerAdmin(playerid))
    {
        if(!strlen(params)) return
        SendClientMessage(playerid, LIGHTBLUE2, "Usage: /setallcash [Value]") &&
        SendClientMessage(playerid, COLOR_GREEN, "Function: Will set a specified value in Money for all players");
        new var = strval(params), string[128];
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                PlayerPlaySound(i,1057,0.0,0.0,0.0);
                ResetPlayerMoney(i);
                GivePlayerMoney(i,var);
            }
        }
        format(string,sizeof(string),"Administrator has set all Players Cash to '$%d'", var );
        return SendClientMessageToAll(COLOR_BLUE, string);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not a high enough level to use this command");
}
dcmd_freezeall(playerid,params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i) && (i != playerid))
        {
        PlayerPlaySound(i,1057,0.0,0.0,0.0);
        TogglePlayerControllable(playerid,false);
        }
        }
        new string[128];
        format(string,sizeof(string),"Administrator has Frozen all players");
        return SendClientMessageToAll(COLOR_BLUE, string);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not a high enough level to use this command");
}

dcmd_unfreezeall(playerid,params[])
{
    #pragma unused params
    if(IsPlayerAdmin(playerid))
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        if(IsPlayerConnected(i) && (i != playerid))
        {
        PlayerPlaySound(i,1057,0.0,0.0,0.0);
        TogglePlayerControllable(playerid,true);
        }
        }
        new string[128];
        format(string,sizeof(string),"Administrator has Unfrozen all players");
        return SendClientMessageToAll(COLOR_BLUE, string);
    }
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You are not a high enough level to use this command");
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(setallcash,10,cmdtext);
    dcmd(freezeall,9,cmdtext);
    dcmd(unfreezeall,11,cmdtext);
    return 1;
}
Reply
#2

The "other commands" is that DCMD too?
Reply
#3

remove the "return 1;" at "OnPlayerCommandText"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)