Hi,
How do i make command for admin, when i type /paymentforadmins (amount) it will only give money who is admin ? +REP if helped |
// 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
}
}
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 ?
|
// 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;
}