14.01.2015, 03:50
El problema es el parбmetro "playerid", en este caso no es necesario crear un argumento asн, se crea un bucle
pawn Код:
public PayDay()
{
new string [128];
for(new i; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i)) {
if(PlayerInfo[i][pCellplan] == 2){
new payday = 100*PlayerInfo[i][pLevel];
new plan = 10;
new total = payday-plan;
PlayerInfo[i][pAccount]=PlayerInfo[i][pAccount]+total;
PlayerInfo[i][pExp]++;
SendClientMessage(i, COLOR_RED,"|_______________ __Pago_Diario_________________|");
format(string, sizeof(string), "|Pago del estado: $%d Balance de cuenta: %d", payday, PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_RED, string);
format(string, sizeof(string), "|Plan celular: $-10 Total: $%d", total);
SendClientMessage(i, COLOR_RED, string);
PlayerPlayMusic(i);
}
else
{
new payday = 100*PlayerInfo[i][pLevel];
PlayerInfo[i][pAccount]=PlayerInfo[i][pAccount]+payday;
PlayerInfo[i][pExp]++;
SendClientMessage(i, COLOR_RED,"|_______________ __Pago_Diario_________________|");
format(string, sizeof(string), "|Pago del estado: $%d |Cuenta bancaria: %d", payday, PlayerInfo[i][pAccount]);
SendClientMessage(i, COLOR_RED, string);
format(string, sizeof(string), "|Total: $%d", payday);
SendClientMessage(i, COLOR_RED, string);
PlayerPlayMusic(i);
}
}
}