16.08.2013, 20:25
i made the payday in dialog.so at payday he gets dialog.at each payday he gets "Nu ai jucat suficient de mult pentru a obtine un cec" translate: you havent player much to get payday!
PHP код:
public PayDay()
{
new string[128];
new account,interest;
new rent = 0;
for(new i = 0; i < MAX_PLAYERS; i++) // this bothering?
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pLevel] > 0)
{
if(MoneyMessage[i]==1)
{
SendClientMessage(i, COLOR_RED, "Tu nu ai reusit sa platesti datoriile tale, treci la inchisoare.");
GameTextForPlayer(i, "~r~Busted!", 2000, 1);
SetPlayerInterior(i, 6);
PlayerInfo[i][pInt] = 6;
new rand = random(sizeof(gJailSpawns));
SetPlayerPos(i, gJailSpawns[rand][0], gJailSpawns[rand][1], gJailSpawns[rand][2]); // Warp the player
PlayerInfo[i][pJailed] = 1;
ResetPlayerWeapons(i);
ResetPlayerCash(i);
WantedPoints[i] = 0;
PlayerInfo[i][pJailTime] = 1200;
format(string, sizeof(string), "You are jailed for %d seconds. Bail: Unable", PlayerInfo[i][pJailTime]);
SendClientMessage(i, COLOR_LIGHTBLUE, string);
}
new playername2[MAX_PLAYER_NAME];
GetPlayerName(i, playername2, sizeof(playername2));
account = PlayerInfo[i][pAccount];
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 > GetPlayerCash(i))
{
PlayerInfo[i][pPhousekey] = 255;
SendClientMessage(i, COLOR_WHITE, "You have been evicted.");
rent = 0;
}
HouseInfo[key][hTakings] = HouseInfo[key][hTakings]+rent;
}
new tmpintrate;
if (key != 255 && strcmp(playername2, HouseInfo[key][hOwner], true) == 0)
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = intrate+4; }
else { tmpintrate = intrate+2; }//HouseInfo[key][hLevel]
}
else
{
if(PlayerInfo[i][pDonateRank] > 0) { tmpintrate = 3; }
else { tmpintrate = 1; }
}
if(PlayerInfo[i][pPayDay] >= 5)//
{
Tax += TaxValue;//Should work for every player online
PlayerInfo[i][pAccount] -= TaxValue;
new checks = PlayerInfo[i][pPayCheck] / 9; // 9
if(PlayerInfo[i][pDonateRank] > 0)
{
new bonus = PlayerInfo[i][pPayCheck] / 10;
checks += bonus;//where is the givecash thing
}
new ebill = (PlayerInfo[i][pAccount]/750)*(PlayerInfo[i][pLevel]); //10000 750
new gbill = (PlayerInfo[i][pAccount]/500)*(PlayerInfo[i][pLevel]);
ConsumingMoney[i] = 1;
PlayerInfo[i][pAccount]=checks+PlayerInfo[i][pAccount];
if(PlayerInfo[i][pAccount] > 0)
{
PlayerInfo[i][pAccount] -= ebill;
PlayerInfo[i][pAccount] -= gbill;
SBizzInfo[4][sbTill] += ebill;
SBizzInfo[4][sbTill] += gbill;
}
else
{
ebill = 0;
gbill = 0;
}
interest = (PlayerInfo[i][pAccount]/10000)*(tmpintrate); //1000
PlayerInfo[i][pExp]++;
PlayerPlayMusic(i);
PlayerInfo[i][pAccount] = account+interest;//where it shows the dialog
new coordsstring[1400],paydaydialogstring[1060]; // this botheringggg
format( paydaydialogstring, sizeof( paydaydialogstring ),"{FF0000}|=======================| Salariul |=======================|\n");strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Salariul: %dLei\n", checks);strcat(coordsstring,paydaydialogstring);
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Curentul: -%dLei\n", ebill);strcat(coordsstring,paydaydialogstring);
}
if(PlayerInfo[i][pPhousekey] != 255 || PlayerInfo[i][pPbiskey] != 255)
{
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Gazul: -%dLei\n", gbill);strcat(coordsstring,paydaydialogstring);//only i see it not every one here
}
if(PlayerInfo[i][pCredit] > 0)
{
new getmoney = GetPlayerCash(i);
new creditoffer = (((PlayerInfo[i][pAccount]) + getmoney)/9500) * (PlayerInfo[i][pLevel]); //750
new creditt = PlayerInfo[i][pCredit];
PlayerInfo[i][pCredit] = (creditt - creditoffer);
GivePlayerCash(i, -creditoffer);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Credit: -%dLei\n", creditoffer);strcat(coordsstring,paydaydialogstring);
}
/*new veh = GetVehicleModel(GetPlayerVehicleID(i));//GetPlayerVehicleID(i);
if(CarInfo[veh][cModel] == 560 || CarInfo[veh][cModel] == 451) // i will add more.
{
if(CarInfo[i][cDescription] == veh || CarInfo[i][cDescription] == veh || CarInfo[i][cDescription] == veh) //veh ok?
{
GivePlayerCash(i, -100000); //but i think you have a payday like you get 5000 in so much time?nope
SendClientMessage(i, COLOR_WHITE, " Asigurare Vehicule: -100000Lei");
}
}*/
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Balanta: %dLei\n", account - checks);strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Dobanda: 0.%d la suta\n",tmpintrate);strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Dobanzile %dLei\n", interest);strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Balanta Noua: %dLei\n", PlayerInfo[i][pAccount]);strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Chirie: -%dLei\n", rent);strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring )," {AA80FF}Impozitul: -%dLei\n", TaxValue);strcat(coordsstring,paydaydialogstring);
format( paydaydialogstring, sizeof( paydaydialogstring ),"{FF0000}|==========================================================|\n");strcat(coordsstring,paydaydialogstring);
ShowPlayerDialog(i ,1, DIALOG_STYLE_MSGBOX,"PayDay",coordsstring,"Inchide","");
rent = 0;
PlayerInfo[i][pPayDay] = 0;
PlayerInfo[i][pPayCheck] = 0;
PlayerInfo[i][pConnectTime] += 1;
if(PlayerInfo[i][pDonateRank] > 0)
{
PlayerInfo[i][pPayDayHad] += 1;
if(PlayerInfo[i][pPayDayHad] >= 5)
{
PlayerInfo[i][pExp]++;
PlayerInfo[i][pPayDayHad] = 0;
}
}
}
else
{
SendClientMessage(i, COLOR_RED, "* Nu ai jucat suficient de mult pentru a obtine un cec !"); // i type /test i see payday but they get
}
}
}
}
SaveAccounts();
return 1;
}