13.01.2010, 19:00
Well everyone is saying like 'Do you know ZCMD is faster?' I say yes I do know that, and they ask me why I don't change to it then.
This is the reason.
This prevents me to put
and so on at every command. With one word, much faster that way to make a code.
Second I'd like to know if there's a fix for this. (I don't think there is one because then ZCMD would be the same as DCMD as ZCMD has CallLocalFunction and DMD doesn't, right?) I hope to get a response on this,
Thanks in advance!
This is the reason.
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if (!PLAYERLIST_authed[playerid]) {
dcmd(login,5,cmdtext); // because login has 5 characters
dcmd(register,8,cmdtext); // because register has 8 characters
SendClientMessage(playerid,RED,"[ERROR] You have to login first before using commands.");
return 1;
}
if (PLAYERLIST_authed[playerid]) {
dcmd(rules,5,cmdtext);
dcmd(stats,5,cmdtext);
dcmd(help,4,cmdtext);
dcmd(vehic,5,cmdtext);
dcmd(me,2,cmdtext);
dcmd(action,6,cmdtext);
dcmd(do,2,cmdtext);
dcmd(veh,3,cmdtext);
dcmd(admins,6,cmdtext);
dcmd(househelp,9,cmdtext);
dcmd(houseinfo,9,cmdtext);
dcmd(enter,5,cmdtext);
dcmd(exit,4,cmdtext);
dcmd(house,5,cmdtext);
dcmd(lockhouse,9,cmdtext);
dcmd(unlockhouse,11,cmdtext);
dcmd(rentprice,9,cmdtext);
dcmd(buyhouse,8,cmdtext);
dcmd(sellhouse,9,cmdtext);
dcmd(unsellhouse,11,cmdtext);
dcmd(createhouse,11,cmdtext);
dcmd(destroyhouse,12,cmdtext);
}
if (Faction[playerid] == 6) {
dcmd(trace,5,cmdtext);
}
if(AdminLevel[playerid] >= 1 || IsPlayerAdmin(playerid)) {
dcmd(respawncars,11,cmdtext);
dcmd(settime,7,cmdtext);
dcmd(clearchat,9,cmdtext);
dcmd(spec,4,cmdtext);
dcmd(gotoint,7,cmdtext);
dcmd(specoff,7,cmdtext);
dcmd(ahelp,5,cmdtext);
dcmd(slap,4,cmdtext);
dcmd(sslap,5,cmdtext);
dcmd(freeze,6,cmdtext);
dcmd(unfreeze,8,cmdtext);
dcmd(gethere,7,cmdtext);
dcmd(mute,4,cmdtext);
dcmd(unmute,6,cmdtext);
dcmd(ban,3,cmdtext);
dcmd(goto,4,cmdtext);
}
if(AdminLevel[playerid] >= 2 || IsPlayerAdmin(playerid)) {
dcmd(setha,5,cmdtext);
dcmd(givegun,7,cmdtext);
dcmd(freezeall,9,cmdtext);
dcmd(unfreezeall,11,cmdtext);
dcmd(setinterior,11,cmdtext);
dcmd(announce,8,cmdtext);
dcmd(setplayerskin,13,cmdtext);
}
if(AdminLevel[playerid] == 3 || IsPlayerAdmin(playerid)) {
dcmd(makeadmin,9,cmdtext);
dcmd(addveh,6,cmdtext);
dcmd(gmx,3,cmdtext);
dcmd(makeleader,10,cmdtext);
dcmd(makedonator,11,cmdtext);
dcmd(removeadmin,11,cmdtext);
dcmd(givemoney,9,cmdtext);
}
else {
return SendClientMessage(playerid,RED,"[ERROR] Insufficient access or wrong command.");
}
return SendClientMessage(playerid,RED,"[ERROR] Insufficient access or wrong command.");
}
pawn Код:
if(padmin[playerid] == 1)
Second I'd like to know if there's a fix for this. (I don't think there is one because then ZCMD would be the same as DCMD as ZCMD has CallLocalFunction and DMD doesn't, right?) I hope to get a response on this,
Thanks in advance!