23.04.2014, 14:31
Код:
if(GameHour == 23 && GameMinute == 59) { for(new i = 0; i < GetMaxPlayers(); i++) { for(new playerid = 0; playerid < MAX_PLAYERS; playerid++) { if(IsPlayerConnected(playerid) && spawned[playerid] == 1) { pInfo[playerid][pDaysAlive] ++; if(pInfo[playerid][pDaysAlive] == 365) { pInfo[playerid][pBirthdays] ++; new pmoney, randcash; pmoney = GetPlayerMoney(i); randcash = random(pmoney); GiveCashToPlayer(playerid,-randcash); GivePlayerMoney(playerid, randcash); SCM(playerid,COLOR_RED,"Happy Birth Day (TESTING)"); } } } } }
but i want to give him the money an random amount we get from all others from their total money
Код:
forward GiveCashToPlayer(playerid,const money); public GiveCashToPlayer(playerid,const money) { for(new i = 0; i < MAX_PLAYERS; i ++) { if(!IsPlayerConnected(i)) continue; if(playerid == i) continue; GivePlayerMoney(i,money); } }