SA-MP Forums Archive
Cash - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Cash (/showthread.php?tid=633116)



Cash - Hunud - 25.04.2017

Hi,

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


Re: Cash - StrikerZ - 25.04.2017

PHP код:
CMD:rewardadmins(playeridparams[])
{
    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 
0GetPlayerPoolSize(); <= ji++) if(pInfo[playerid][pAdmin])
    {
        
GivePlayerMoney(i,reward);
        
SendClientMessage(i,-1,str);
    }
    return 
1;