23.07.2013, 01:19
Dae galera queria ajude de voces pra ageitar minha public payday todas vezes que acontece uma payday trava tudo olhem a public abaixo.
pawn Код:
public PayDay()
{
new Conta,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_LIGHTRED, "voce Nгo pagou a sua dнvida e foi preso.");
GameTextForPlayer(i, "~r~Preso!", 2000, 1);
SetPlayerInterior(i, 6);
SetPlayerPos(i, 264.6288,77.5742,1001.0391);
PlayerInfo[i][pJailed] = 1;
ResetPlayerWeaponsEx(i);
WantedPoints[i] = 0;
SetPlayerWantedLevel(i, 0);
PlayerInfo[i][pJailTime] = 600;
format(gstring, sizeof(gstring), "voce foi preso por %d segundos.", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, gstring);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
Conta = PlayerInfo[i][pConta];
new key = PlayerInfo[i][pPHousekey];
if(key != 255)
{
rent = HouseInfo[key][hRent];
if(strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
rent = 0;
}
else if(rent > GetPlayerMoneyEx(i))
{
PlayerInfo[i][pPHousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "voce foi expulso(a).");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if(PlayerInfo[i][pVIP] == 1) { tmpintrate = 3; }
else if(PlayerInfo[i][pVIP] == 2) { tmpintrate = 4; }
else if(PlayerInfo[i][pVIP] == 3) { tmpintrate = 6; }
else if(PlayerInfo[i][pVIP] == 4) { tmpintrate = 8; }
else { tmpintrate = 1; }
if(PlayerInfo[i][pPayDay] >= 3)
{
Tax += TaxValue;//Shorld work for every player online
PlayerInfo[i][pConta] -= TaxValue;
new checks = PlayerInfo[i][pSalario];
new ebill = (PlayerInfo[i][pConta]/5000)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
GivePlayerMoneyEx(i, checks);
if(PlayerInfo[i][pConta] > 0)
{
PlayerInfo[i][pConta] -= ebill;
SBizzInfo[4][sbTill] += ebill;
ExtortionSBiz(4, ebill);
}
else
{
ebill = 0;
}
interest = (PlayerInfo[i][pConta]/1000)*(tmpintrate);
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pConta] = Conta+interest;
SendClientMessage(i, COLOR_WHITE, "|_B_M_G_| Pagamento|_B_M_G_|");
format(gstring, sizeof(gstring), "salбrio: {00FF00}[R$%d]", checks);
SendClientMessage(i, COLOR_WHITE, gstring);
if(PlayerInfo[i][pPHousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format(gstring, sizeof(gstring), "Energia: {FF0000}[-R$%d]", ebill);
SendClientMessage(i, COLOR_WHITE, gstring);
}
format(gstring, sizeof(gstring), "Juros: {00FF00}[0.%dpor cento]",tmpintrate);
SendClientMessage(i, COLOR_WHITE, gstring);
format(gstring, sizeof(gstring), "Antigo Saldo Bancбrio:{FF0000}[R$%d]{FF0000}{FFFFFF}|Novo Saldo Bancбrio:{00FF00}[R$%d]", Conta,PlayerInfo[i][pConta]);
SendClientMessage(i, COLOR_WHITE, gstring);
PlayerPlaySound(i, 1185, 0.0, 0.0, 0.0);
format(gstring, sizeof(gstring), "~y~-==- ~g~ Salario ~y~ -==-");
GameTextForPlayer(i, gstring, 5000, 1);
OnPlayerSave(i);
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pSalario] = 0;
PlayerInfo[i][pConnectTime] += 1;
PlayerInfo[i][pCaixinha] = 0;
pban[i] = 0;
PassadoUmDia++;
new lolbagui;
lolbagui = PlayerInfo[i][pExp];
new nxtlevel = PlayerInfo[i][pLevel]+1;
if(lolbagui >= nxtlevel*levelexp)
{
GameTextForPlayer(i, "~g~Respeito Adquirido!~n~~r~Digite /comprarnivel!", 5000, 1);
}
if(PassadoUmDia >= 24)//DiaPassado
{
}
if(PlayerInfo[i][pVIP] == 1)
{
PlayerInfo[i][pExp] += 2;
GivePlayerMoney(i, 1000);
SendClientMessage(i, -1, "{9C9C9C}voce Ganhou 1000 e 2 de Respeito por ser Vip-Prata!.");
}
if(PlayerInfo[i][pVIP] == 2)
{
PlayerInfo[i][pExp] += 3;
GivePlayerMoney(i, 2000);
SendClientMessage(i, -1, "{EEEE00}voce Ganhou 2000 e 3 de Respeito por ser Vip-Ouro!.");
}
if(PlayerInfo[i][pVIP] == 3)
{
PlayerInfo[i][pExp] += 4;
GivePlayerMoney(i, 3000);
SendClientMessage(i, -1, "{00F5FF}voce Ganhou 3000 e 4 de Respeito por ser Socio-Prata!.");
}
if(PlayerInfo[i][pVIP] == 4)
{
PlayerInfo[i][pExp] += 6;
GivePlayerMoney(i, 5000);
SendClientMessage(i, -1, "{00F5FF}voce Ganhou 5000 e 6 de Respeito por ser Socio-Ouro!.");
}
if(PlayerInfo[i][pVIP] == 1 || PlayerInfo[i][pVIP] == 2 || PlayerInfo[i][pVIP] == 3 || PlayerInfo[i][pVIP] == 4)
{
SBizzInfo[10][sbTill] += 500;
ExtortionSBiz(10, 500);
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 1)
{
HouseInfo[h][hTakings] -= 30;
OnPropUpdate();
}
if(HouseInfo[h][hTakings] <= 0)
{
HouseInfo[h][hTakings] = 0;
OnPropUpdate();
}
}
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(HouseInfo[h][hOwned] == 1)
{
if(HouseInfo[h][hTakings] <= 0)
{
HouseInfo[h][hHel] = 0;
HouseInfo[h][hArm] = 0;
HouseInfo[h][hHealthx] = 0;
HouseInfo[h][hHealthy] = 0;
HouseInfo[h][hHealthz] = 0;
HouseInfo[h][hArmorrx] = 0;
HouseInfo[h][hArmorry] = 0;
HouseInfo[h][hArmorrz] = 0;
HouseInfo[h][hLock] = 1;
HouseInfo[h][hOwned] = 0;
HouseInfo[h][hVec] = 545;
HouseInfo[h][hVcol1] = -1;
HouseInfo[h][hVcol2] = -1;
PlayerInfo[i][pPHousekey] = 255;
strmid(HouseInfo[h][hOwner], "O estado", 0, strlen("O estado"), 255);
Atualizar3Dtexts();
OnPropUpdate();
format(gstring, sizeof(gstring), "SERVER: A Casa %d Foi vendida por falta de dinheiro no Cofre!", h);
SendClientMessageToAll(COLOR_LIGHTRED,gstring);
}
}
}
if(PlayerInfo[i][pEmprego] > 0)
{
if(PlayerInfo[i][pContractTime] < 25)
{
PlayerInfo[i][pContractTime] ++;
}
}
}
else
{
SendClientMessage(i, COLOR_LIGHTRED, "* voce Nгo jogou tempo suficiente para receber salбrio!.");
}
}
}
}
OOCNews(COLOR_WHITE, "Loterica: Ja comecou a loteria.");
new rand = random(80);
if(rand < 77) { rand += 3; }
Lotto(rand);
return 1;
}