SA-MP Forums Archive
Payment - 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: Payment (/showthread.php?tid=632955)



Payment - Hunud - 22.04.2017

Hi,

How do i make command for admin, when i type /paymentforadmins (amount) it will only give money who is admin ? +REP if helped


Re: Payment - Hunud - 22.04.2017

BUMP! Anyone


Re: Payment - khRamin78 - 22.04.2017

Quote:
Originally Posted by Hunud
Посмотреть сообщение
Hi,

How do i make command for admin, when i type /paymentforadmins (amount) it will only give money who is admin ? +REP if helped
PHP код:
// do this in your cmd
for(new i;i<MAX_PLAYERS;i++) // this will start a loop to all players
{
    if(
IsPlayerAdmin(i)) // check if he is an admin
    
{
        
GivePlayerMoney(i,pmoney); // pmoney is params of that which players put you have to define it with sscanf easly
    
}




Re: Payment - Hunud - 22.04.2017

No you dont get me, I want to know how to make a command when i use /paymentforadmins (amount) it will only give cash to admins! Got me ?


Re: Payment - khRamin78 - 22.04.2017

Quote:
Originally Posted by Hunud
Посмотреть сообщение
No you dont get me, I want to know how to make a command when i use /paymentforadmins (amount) it will only give cash to admins! Got me ?
"I GOT IT" ! and i teach you how to loop throgh all players and give money only for players with admin status that you have to fit it in your gm as i dont know what are your varbs or includes are


Re: Payment - khRamin78 - 22.04.2017

PHP код:
// HERE you want a full cod

// im using zcmd & sscanf includes

CMD:paymentforadmins(playerid,params)
{
    new 
amount,string[128];
    if(
sscanf(params,"i",amount)) return SendClientMessage(playerid,-1,"syntex:/paymentforadmins <amount>");
    
format(string,sizeof(string),"All adminstartors has been payed by owner with salary of %d$",amount);
    for(new 
i;i<MAX_PLAYERS;i++)
    {
        if(
/*check here if player is an admin like IsAnAdmin(i) fit with your GM dude !*/)
        {
            
GivePlayerMoney(i,amount);
            
SendClientMessage(i,-1,string);
        }
    }
    
    return 
1;