hamhamCartita got a reaction from
gogu in [REZOLVAT] Probleme rentcar
December 2, 2018
!Sterge sistemul tau inainte si fa backup la GM!
Du-te la "public OnGamemodeInit" si adauga asta:
SetTimer("RentCar", 20000, true);
Apoi adauga asta unde ai tu functions:
function RentCar() {
new carid, string[180], query[256], result[MAX_PLAYERS];
foreach(Player, i) {
if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER) {
carid = GetPlayerVehicleID(i);
result = 0;
if(carid == rentls[1] || carid == rentls[2] || carid == rentls[3] || carid == rentls[4] || carid == rentls[5] || carid == rentls[6] || carid == rentls[7] || carid == rentls[8] || carid == rentls[9] || carid == rentls[10]) {
RentPrice += BizzInfo[16][bFee];
BizzInfo[16][bBalance] += BizzInfo[16][bFee];
format(query, sizeof(query),"UPDATE `bizz` SET `Till`='%d' WHERE `ID`='16'",BizzInfo[16][bBalance]);
mysql_query(SQL,query);
if(GetPlayerCash(i) < BizzInfo[16][bFee]) {
RemovePlayerFromVehicleEx(i);
PlayerTextDrawHide(i, FareTD);
RentPrice = 0;
HireCar = 0;
SCM(i, COLOR_GREY, "Ai fost dat afara din vehicul deoarece nu ai banii necesari!");
result = 1;
}
GivePlayerCash(i, -BizzInfo[16][bFee]);
}
else if(carid == scooter[1] || carid == scooter[2] || carid == scooter[3] || carid == scooter[4] || carid == scooter[5]) {
RentPrice += BizzInfo[15][bFee];
BizzInfo[15][bBalance] += BizzInfo[15][bFee];
format(query, sizeof(query),"UPDATE `bizz` SET `Till`='%d' WHERE `ID`='15'",BizzInfo[15][bBalance]);
mysql_query(SQL,query);
if(GetPlayerCash(i) < BizzInfo[15][bFee]) {
RemovePlayerFromVehicleEx(i);
PlayerTextDrawHide(i, FareTD);
RentPrice = 0;
HireCar = 0;
SCM(i, COLOR_GREY, "Ai fost dat afara din vehicul deoarece nu ai banii necesari!");
result = 1;
}
GivePlayerCash(i, -BizzInfo[15][bFee]);
}
else result = 1;
if(result == 0) {
format(string, sizeof(string), " Rent car: ~g~$%s", FormatNumber(RentPrice));
PlayerTextDrawSetString(i, FareTD, string);
PlayerTextDrawShow(i, FareTD);
}
}
}
return 1;
}