05.09.2012, 18:44
Just an example, might be a few errors & warnings (Not tested). It's just an example.
pawn Код:
new aReqHelp[MAX_PLAYERS];
OnPlayerConnect(playerid)
{
aReqHelp[playerid] = 0;
return 1;
}
CMD:ahelp(playerid, params[])
{
new string[128];
if(sscanf(params, "s[128]", string)) return SendClientMessage(playerid, -1, "USAGE: /ahelp [message]");
for(new i = 0; i < MAX_PLAYERS; ++I)
{
if(PInfo[i][pAdmin] >= 1) // Admin variable Usually along the lines of PInfo[i][pAdmin] >= 1
{
SendClientMessage(playerid, -1, string);
}
}
aReqHelp[playerid] = 1;
return 1;
}
CMD:arespond(playerid, params[])
{
new pID, string[128];
if(sscanf(params, "us[128]", pID, string)) return SendClientMessage(playerid, -1, "USAGE: /arespond [id] [message]");
if(PInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "You're not allowed to use this command.");
if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, -1, "Player not connected");
if(aReqHelp[pID] == 0) return SendClientMessage(playerid, -1, "That player does not require help.");
else SendClientMessage(pID, -1, string); aReqHelp[pID] = 0;
return 1;
}