Payment
#1

Hi,

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

BUMP! Anyone
Reply
#3

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
    
}

Reply
#4

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 ?
Reply
#5

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
Reply
#6

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;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)