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;
}
Just an example, might be a few errors & warnings (Not tested). It's just an example.
pawn Код:
|
for(new pID; pID < MAX_PLAYERS; pID++; )
{
if(PlayerInfo[pID][Admin])
{
SendClientMessage(pID, 0x0, "Admin Message here!");
}
}
new aReqHelp[MAX_PLAYERS];
public 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(PlayerInfo[i][pAdmin] >= 1) // CHANGE ME (To your admin varibale - If its not that already)
{
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(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "You're not allowed to use this command."); // CHANGE ME (To your admin varibale - If its not that already)
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;
}