Personally, I'd recommend ZCMD as this is what I am used to (though I have not even attempted to use YCMD), yet people 'claim' that Zcmd is the 'fastest' processor out there, yet I haven't really seen any tests in comparison of the two.
You can turn a Command such as this:
pawn Код:
if(strcmp(cmd, "/freeze", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /freeze [playerid/PartOfName]");
return 1;
}
new playa;
playa = ReturnUser(tmp);
if(PlayerInfo[playa][pAdmin] > 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Admins can not be frozen");
return 1;
}
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
TogglePlayerControllable(playa, 0);
format(string, sizeof(string), "AdmCmd: %s Freezes %s",sendername, giveplayer);
printf("%s",string);
format(string, sizeof(string), "AdmCmd: %s was Frozen by %s",giveplayer ,sendername);
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
}
}
return 1;
}
To
pawn Код:
CMD:freeze(playerid, params[]) //freeze command
{
if(PlayerInfo[playerid][pAdmin] >= 2)
{
new PID, pName[MAX_PLAYER_NAME], Sender[MAX_PLAYER_NAME];
if(sscanf(params, "u", PID)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /freeze [playerid]");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
new Str[128];
GetPlayerRPName(PID, pName, sizeof(pName));
GetPlayerRPName(playerid, Sender, sizeof(Sender));
format(Str, sizeof(Str), "AdmCmd: %s has been frozen by %s.", pName, Sender);
SendClientMessageToAll(COLOR_YELLOW, Str);
TogglePlayerControllable(PID,0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
}
return 1;
}
I think you can observe the amount of lines being used in each method.