Is there any way to make command that when i type /rewardadmins it will only give cash to player who are admin not regular player + REP
PHP код:
CMD:rewardadmins(playerid, params[])
{
static reward,str[60],name[24];
if(sscanf(params,"d",reward)) return SendClientMessage(playerid,-1,"USAGE: /rewardadmins (reward amount)");
if(!pInfo[playerid][pAdmin]) return SendClientMessage(playerid,-1,"You're not an admin."); // Change pInfo[playerid][pAdmin] to your admin variables.
GetPlayerName(playerid,name,sizeof(name));
format(str,sizeof(str),"%s has rewarded all admins with $%d",name,reward);
for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) if(pInfo[playerid][pAdmin])
{
GivePlayerMoney(i,reward);
SendClientMessage(i,-1,str);
}
return 1;
}