25.08.2012, 22:03
just some suggestions:
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
the zcmd:recieve needs some enhancements like adminlevel etc, but you get the concept i assume heh
*not tested
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;
}
if you want the player(s) having the money at each iteration, then remove the
pawn Код:
GetsMoney[i]=0;
*not tested