if(strcmp(cmd, "/help", true) == 0) { if(IsPlayerLuxAdmin(playerid)) { //Function Here } else SendClientMessage(playerid, COLOR_WHITE, "ERROR: You not is Administrator"); return 1; }
#define COLOR_LIGHTGREEN 0x7CFC00AA
if(strcmp(cmd, "/apm", true) == 0)
{
if(IsPlayerLuxAdmin(playerid))
{
new id, string[128];
if(sscanf(params, "us[128]", id, string))
{return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /apm [playerid] [message]");}
else if(!IsPlayerConnected(id))
{return SendClientMessage(playerid, COLOR_WHITE, "ERROR: Invalid Player ID");}
else
{
new str[128];
format(str, sizeof(str), "[PMFROMADMIN]: %s", string);
SendClientMessage(id, COLOR_LIGHTGREEN, str);
}
}else{return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You're not an Administrator");}
}
Why is that? I do not think the use of documentary features something awful. All now enjoy zcmd fashion? Mass psychosis? The same can be done in OnPlayerCommandText
|
Who told you that it is faster and why? It's just a wrapper over standard OnPlayerCommandText
Just why do you think that something better is that it uses a lot of people, and not something that you like personally. |
Who told you that it is faster and why? It's just a wrapper over standard OnPlayerCommandText
Just why do you think that something better is that it uses a lot of people, and not something that you like personally. |
CMD:apm(playerid, params[])
{
new tmp[256], giveplayerid, giveplayer[25], playername[25],string[256], string2[256];
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
if (sscanf(params, "us[128]", giveplayerid, tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /apm [playerid] [message]");
if (!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOR_RED, "Error: Inactive player id!");
if (giveplayerid == playerid) return SendClientMessage(playerid, COLOR_RED, "Error: You can't admin pm your self!");
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
format(string, sizeof(string), "[PM From STAFF]: %s(%d): %s", playername, playerid, tmp);
SendClientMessage(giveplayerid, COLOR_RED, string);
format(string2,sizeof(string2), "[PM From STAFF]: %s(%d) > %s(%d): %s", playername, playerid, giveplayer, giveplayerid, tmp);
SendMessageToAdmins(COLOR_RED, string2);
return 1;
}