Take a look !
#1

hello could some1 take a look @ this and tell me if this is possible

iam changing from DCMD TO ZCMD


pawn Код:
#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

and like this
pawn Код:
dcmd(register,8,cmdtext);
    dcmd(login,5,cmdtext);
    dcmd(logout,6,cmdtext);
    dcmd(goto,4,cmdtext);
    dcmd(gethere,7,cmdtext);
    dcmd(announce,8,cmdtext);
    dcmd(say,3,cmdtext);
    dcmd(flip,4,cmdtext);
    dcmd(serverinfo,10,cmdtext);
    dcmd(slap,4,cmdtext);
    dcmd(wire,4,cmdtext);
    dcmd(unwire,6,cmdtext);
    dcmd(kick,4,cmdtext);
    dcmd(ban,3,cmdtext);
    dcmd(akill,5,cmdtext);
    dcmd(eject,5,cmdtext);
    dcmd(freeze,6,cmdtext);
    dcmd(unfreeze,8,cmdtext);
    dcmd(outside,7,cmdtext);
    dcmd(healall,7,cmdtext);
    dcmd(givehealth,10,cmdtext);
    dcmd(sethealth,9,cmdtext);
    dcmd(skinall,7,cmdtext);
    dcmd(giveallweapon,13,cmdtext);
    dcmd(resetallweapons,15,cmdtext);
    dcmd(ejectall,8,cmdtext);
    dcmd(freezeall,9,cmdtext);
    dcmd(unfreezeall,11,cmdtext);
    dcmd(giveweapon,10,cmdtext);
    dcmd(god,3,cmdtext);
    dcmd(resetscores,11,cmdtext);
    dcmd(setlevel,8,cmdtext);
    dcmd(setskin,7,cmdtext);
    dcmd(midnight,8,cmdtext);
    dcmd(morning,7,cmdtext);
    dcmd(noon,4,cmdtext);
    dcmd(evening,7,cmdtext);
    dcmd(uconfig,7,cmdtext);
    dcmd(sm,2,cmdtext);
    dcmd(setsm,5,cmdtext);
    dcmd(setcash,7,cmdtext);
    dcmd(givecash,8,cmdtext);
    dcmd(remcash,7,cmdtext);
    dcmd(resetcash,9,cmdtext);
    dcmd(setallcash,10,cmdtext);
    dcmd(giveallcash,11,cmdtext);
    dcmd(remallcash,10,cmdtext);
    dcmd(resetallcash,12,cmdtext);
    dcmd(givearmour,10,cmdtext);
    dcmd(setarmour,9,cmdtext);
    dcmd(armourall,9,cmdtext);
    dcmd(setammo,7,cmdtext);
    dcmd(setscore,8,cmdtext);
    dcmd(ip,2,cmdtext);
    dcmd(ping,4,cmdtext);
    dcmd(explode,7,cmdtext);
    dcmd(settime,7,cmdtext);
    dcmd(setalltime,10,cmdtext);
    dcmd(force,5,cmdtext);
    dcmd(setwanted,9,cmdtext);
    dcmd(setallwanted,12,cmdtext);
    dcmd(setworld,8,cmdtext);
    dcmd(setallworld,11,cmdtext);
    dcmd(setgravity,10,cmdtext);
    dcmd(xlock,5,cmdtext);
    dcmd(xunlock,7,cmdtext);
    dcmd(carcolor,8,cmdtext);
    dcmd(gmx,3,cmdtext);
    dcmd(carhealth,9,cmdtext);
    dcmd(xinfo,5,cmdtext);
    dcmd(setping,7,cmdtext);
    dcmd(giveme,6,cmdtext);
    dcmd(givecar,7,cmdtext);
    dcmd(xspec,5,cmdtext);
    dcmd(xjail,5,cmdtext);
    dcmd(xunjail,7,cmdtext);
    dcmd(setname,7,cmdtext);
    dcmd(admins,6,cmdtext);
    dcmd(xcommands,9,cmdtext);
    dcmd(vr,2,cmdtext);
    dcmd(weather,7,cmdtext);

so i changed everything to

pawn Код:
#define zcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (zcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (zcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

pawn Код:
zcmd(register,8,cmdtext);
    zcmd(login,5,cmdtext);
    zcmd(logout,6,cmdtext);
    zcmd(goto,4,cmdtext);
    zcmd(gethere,7,cmdtext);
    zcmd(announce,8,cmdtext);
    zcmd(say,3,cmdtext);
    zcmd(flip,4,cmdtext);
    zcmd(serverinfo,10,cmdtext);
    zcmd(slap,4,cmdtext);
    zcmd(wire,4,cmdtext);
    zcmd(unwire,6,cmdtext);
    zcmd(kick,4,cmdtext);
    zcmd(ban,3,cmdtext);
    zcmd(akill,5,cmdtext);
    zcmd(eject,5,cmdtext);
    zcmd(freeze,6,cmdtext);
    zcmd(unfreeze,8,cmdtext);
    zcmd(outside,7,cmdtext);
    zcmd(healall,7,cmdtext);
    zcmd(givehealth,10,cmdtext);
    zcmd(sethealth,9,cmdtext);
    zcmd(skinall,7,cmdtext);
    zcmd(giveallweapon,13,cmdtext);
    zcmd(resetallweapons,15,cmdtext);
    zcmd(ejectall,8,cmdtext);
    zcmd(freezeall,9,cmdtext);
    zcmd(unfreezeall,11,cmdtext);
    zcmd(giveweapon,10,cmdtext);
    zcmd(god,3,cmdtext);
    zcmd(resetscores,11,cmdtext);
    zcmd(setlevel,8,cmdtext);
    zcmd(setskin,7,cmdtext);
    zcmd(midnight,8,cmdtext);
    zcmd(morning,7,cmdtext);
    zcmd(noon,4,cmdtext);
    zcmd(evening,7,cmdtext);
    zcmd(uconfig,7,cmdtext);
    zcmd(sm,2,cmdtext);
    zcmd(setsm,5,cmdtext);
    zcmd(setcash,7,cmdtext);
    zcmd(givecash,8,cmdtext);
    zcmd(remcash,7,cmdtext);
    zcmd(resetcash,9,cmdtext);
    zcmd(setallcash,10,cmdtext);
    zcmd(giveallcash,11,cmdtext);
    zcmd(remallcash,10,cmdtext);
    zcmd(resetallcash,12,cmdtext);
    zcmd(givearmour,10,cmdtext);
    zcmd(setarmour,9,cmdtext);
    zcmd(armourall,9,cmdtext);
    zcmd(setammo,7,cmdtext);
    zcmd(setscore,8,cmdtext);
    zcmd(ip,2,cmdtext);
    zcmd(ping,4,cmdtext);
    zcmd(explode,7,cmdtext);
    zcmd(settime,7,cmdtext);
    zcmd(setalltime,10,cmdtext);
    zcmd(force,5,cmdtext);
    zcmd(setwanted,9,cmdtext);
    zcmd(setallwanted,12,cmdtext);
    zcmd(setworld,8,cmdtext);
    zcmd(setallworld,11,cmdtext);
    zcmd(setgravity,10,cmdtext);
    zcmd(xlock,5,cmdtext);
    zcmd(xunlock,7,cmdtext);
    zcmd(carcolor,8,cmdtext);
    zcmd(gmx,3,cmdtext);
    zcmd(carhealth,9,cmdtext);
    zcmd(xinfo,5,cmdtext);
    zcmd(setping,7,cmdtext);
    zcmd(giveme,6,cmdtext);
    zcmd(givecar,7,cmdtext);
    zcmd(xspec,5,cmdtext);
    zcmd(xjail,5,cmdtext);
    zcmd(xunjail,7,cmdtext);
    zcmd(setname,7,cmdtext);
    zcmd(admins,6,cmdtext);
    zcmd(xcommands,9,cmdtext);
    zcmd(vr,2,cmdtext);
    zcmd(weather,7,cmdtext);

and also include
pawn Код:
#include zcmd
is this possible or do i need to edit more than just the "DCMD" to "ZCMD" ??
Reply
#2

pawn Код:
dcmd(ban, 3, cmdtext);

dcmd_ban(playerid, params[])
{
    return 1;
}
Turns into:
pawn Код:
CMD:ban(playerid, params[])
{
    return 1;
}
So you can pretty much get rid of those in the under 'OnPlayerCommandText', also, you aren't utilizing zcmd like its supposed to, you are just renaming that macro.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)