22.04.2014, 14:05
Only use the array for the mod shop, the rest was just an example. I'll suggest you to use foreach so it loops through the connected players only.
pawn Код:
public MoneyTimer()
{
new username[MAX_PLAYER_NAME], money;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
money = GetPlayerMoney(i);
if(GetPlayerCash(i) != money)
{
if (money < Cash[i] && Player_ModShop{i}) Cash[i] = money;
ResetMoneyBar(i);//Resets the money in the original moneybar, Do not remove!
UpdateMoneyBar(i,GetPlayerCash(i));//Sets the money in the moneybar to the serverside cash, Do not remove!
new hack = money - GetPlayerCash(i);
GetPlayerName(i,username,sizeof(username));
printf("%s has picked up/attempted to spawn $%d.", username,hack);
}
}
}
}