pawn Код:
public Maintenance()
{
new string[128];
ABroadCast(COLOR_YELLOW, "{AA3333}Maintenance{FFFF00}: Locking Paintball Arenas...", 1);
for(new i = 0; i < MAX_ARENAS; i++)
{
foreach(Player, p)
{
new arenaid = GetPVarInt(p, "IsInArena");
if(arenaid == i)
{
if(PaintBallArena[arenaid][pbBidMoney] > 0)
{
GivePlayerCash(p,PaintBallArena[GetPVarInt(p, "IsInArena")][pbBidMoney]);
format(string,sizeof(string),"You have been refunded a total of $%d because of premature closure.",PaintBallArena[GetPVarInt(p, "IsInArena")][pbBidMoney]);
SendClientMessageEx(p, COLOR_WHITE, string);
}
if(arenaid == GetPVarInt(p, "ArenaNumber"))
{
switch(PaintBallArena[arenaid][pbGameType])
{
case 1:
{
if(PlayerInfo[p][pDonateRank] < 3)
{
PlayerInfo[p][pPaintTokens] += 3;
format(string,sizeof(string),"You have been refunded a total of %d Paintball Tokens because of premature closure.",3);
SendClientMessageEx(p, COLOR_WHITE, string);
}
}
case 2:
{
if(PlayerInfo[p][pDonateRank] < 3)
{
PlayerInfo[p][pPaintTokens] += 4;
format(string,sizeof(string),"You have been refunded a total of %d Paintball Tokens because of premature closure.",4);
SendClientMessageEx(p, COLOR_WHITE, string);
}
}
case 3:
{
if(PlayerInfo[p][pDonateRank] < 3)
{
PlayerInfo[p][pPaintTokens] += 5;
format(string,sizeof(string),"You have been refunded a total of %d Paintball Tokens because of premature closure.",5);
SendClientMessageEx(p, COLOR_WHITE, string);
}
}
case 4:
{
if(PlayerInfo[p][pDonateRank] < 3)
{
PlayerInfo[p][pPaintTokens] += 5;
format(string,sizeof(string),"You have been refunded a total of %d Paintball Tokens because of premature closure.",5);
SendClientMessageEx(p, COLOR_WHITE, string);
}
}
case 5:
{
if(PlayerInfo[p][pDonateRank] < 3)
{
PlayerInfo[p][pPaintTokens] += 6;
format(string,sizeof(string),"You have been refunded a total of %d Paintball Tokens because of premature closure.",6);
SendClientMessageEx(p, COLOR_WHITE, string);
}
}
}
}
LeavePaintballArena(p, arenaid);
}
}
ResetPaintballArena(i);
PaintBallArena[i][pbLocked] = 2;
}
ABroadCast(COLOR_YELLOW, "{AA3333}Maintenance{FFFF00}: Freezing Accounts...", 1);
ABroadCast(COLOR_YELLOW, "{AA3333}Maintenance{FFFF00}: Force Saving Accounts...", 1);
foreach(Player, i)
{
GameTextForPlayer(i, "Scheduled Maintenance.", 5000, 5);
DisablePlayerCheckpoint(i);
gPlayerCheckpointStatus[i] = CHECKPOINT_NONE;
for(new s = 0; s < 12; s++)
{
if(PlayerInfo[i][pAGuns][s] != 0)
{
RemovePlayerWeapon(i, PlayerInfo[i][pAGuns][s]);
}
}
PlayerInfo[i][pInt] = GetPlayerInterior(i);
PlayerInfo[i][pVW] = GetPlayerVirtualWorld(i);
PlayerInfo[i][pChar] = PlayerInfo[i][pModel];
GetPlayerIp(i, PlayerInfo[i][pIP], 32);
GetPlayerPos(i, PlayerInfo[i][pPos_x], PlayerInfo[i][pPos_y], PlayerInfo[i][pPos_z]);
GetPlayerFacingAngle(i, PlayerInfo[i][pPos_r]);
OnPlayerStatsUpdate(i);
ResetPlayerWeapons(i);
TogglePlayerControllable(i, false);
}
SetTimer("SaveMaintenance", 10000, false);
return 1;
}