Timer i all players to one player?
#8

just some suggestions:
pawn Код:
//at top
new GetsMoney[MAX_PLAYERS];

//your timer()
for(new i=0; i<MAX_PLAYERS; i++)
{
    if(GetsMoney[i]>0)
    {
//      GivePlayerMoney(i,5000);
        GivePlayerMoney(i,GetsMoney[i]);
        GetsMoney[i]=0;//after a player recieved money once, set it to 0 to avoid getting cash each time
    }
}

CMD:recieve(playerid,params[]){
    new targetid,amount;
    if(sscanf(params,"uD(1000)",targetid,amount))
    {
        SendClientMessage(playerid,0xff5555ff,"/recieve <id> [amount]");
        return 1;
    }
    GetsMoney[i]=amount;//to be stored in the array + synced in the next timer loop
    SendClientMessage(playerid,0x55ff55ff,"Money sent.");
    return 1;
}

public OnPlayerConnect(playerid)
{
    GetsMoney[i]=1000;
    return 1;
}
as you can see, one timer handling the all-player-loop, will do fine.
if you want the player(s) having the money at each iteration, then remove the
pawn Код:
GetsMoney[i]=0;
the zcmd:recieve needs some enhancements like adminlevel etc, but you get the concept i assume heh
*not tested
Reply


Messages In This Thread
Timer i all players to one player? - by Admigo - 19.08.2012, 14:11
Re: Timer i all players to one player? - by Shetch - 19.08.2012, 14:13
Re: Timer i all players to one player? - by Admigo - 25.08.2012, 19:33
Re: Timer i all players to one player? - by Admigo - 25.08.2012, 19:58
Re: Timer i all players to one player? - by Admigo - 25.08.2012, 20:12
Re: Timer i all players to one player? - by Admigo - 25.08.2012, 20:30
Re: Timer i all players to one player? - by leonardo1434 - 25.08.2012, 20:48
Re: Timer i all players to one player? - by Babul - 25.08.2012, 22:03

Forum Jump:


Users browsing this thread: 3 Guest(s)