Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- forward OneSec();
- public OneSec( )
- {
- UpdateSpeedo();
- foreach(Player, playerid) {
- new Float:Health;
- GetPlayerHealth(playerid, Health);
- SetProgressBarValue(healthbar[playerid], Health);
- UpdateProgressBar(healthbar[playerid], playerid);
- UpdateMoney(playerid);
- if(GetPVarInt(playerid, "Engine_Progress") > 0){
- SetPVarInt(playerid, "Engine_Progress", GetPVarInt(playerid, "Engine_Progress") + 1);
- }
- if(GetPVarInt(playerid, "Engine_Progress") == 4){
- SetPVarInt(playerid, "Engine_Progress", 0);
- format(string, sizeof(string), "Engine starts (( %s ))", AccountData[playerid][PlayerName]);
- SendLocalMessage(playerid, string, 10.0, COLOR_ME, COLOR_ME);
- new VehID = GetPlayerVehicleID(playerid);
- VehicleInfo[VehID][vEngine] = 1;
- TogglePlayerControllable(playerid, true);
- }
- if(GetPVarInt(playerid, "Been_Fuel") == 1) {
- TogglePlayerControllable(playerid, true);
- SetPVarInt(playerid, "Been_Fuel", 0);
- }
- if(IsPlayerInFishZone(playerid) == 1 && GetPVarInt(playerid, "FishZone") != 1) {
- SetPVarInt(playerid, "FishZone", 1);
- GameTextForPlayer(playerid, "~r~You have entered fish zone 1.", 9000, 5);
- //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 1, here you can catch~n~~y~Steel Pompano | Salema | Freckled porcupinefish | Blacksmith");
- }
- else
- if(IsPlayerInFishZone(playerid) == 2 && GetPVarInt(playerid, "FishZone") != 2) {
- SetPVarInt(playerid, "FishZone", 2);
- GameTextForPlayer(playerid, "~r~You have entered fish zone 2.", 9000, 5);
- //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 2, here you can catch~n~~y~Connie's Damsel | Black perch | Black tetra | Salema");
- }
- else
- if(IsPlayerInFishZone(playerid) == 3 && GetPVarInt(playerid, "FishZone") != 3) {
- SetPVarInt(playerid, "FishZone", 3);
- GameTextForPlayer(playerid, "~r~You have entered fish zone 3.", 9000, 5);
- //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 3, here you can catch~n~~y~Black perch | Yellow longnose butterflyfish | White-tailed damselfish | Panther grouper");
- }
- else
- if(IsPlayerInFishZone(playerid) == 4 && GetPVarInt(playerid, "FishZone") != 4) {
- SetPVarInt(playerid, "FishZone", 4);
- GameTextForPlayer(playerid, "~r~You have entered fish zone 4.", 9000, 5);
- // EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 4, here you can catch~n~~y~Harlequin tuskfish | Pacific spadefish | Blue-spotted jack | Green jack");
- }
- else
- if(IsPlayerInFishZone(playerid) == 5 && GetPVarInt(playerid, "FishZone") != 5) {
- SetPVarInt(playerid, "FishZone", 5);
- GameTextForPlayer(playerid, "~r~You have entered fish zone 5.", 9000, 5);
- //EUM_ShowForPlayer(playerid, 1, "~g~Fish zone", "You have entered fish zone 5, here you can catch~n~~y~Ornate Cowfish | Clown anemonefish | Zebra perch");
- }
- if(GetPVarInt(playerid, "Refueling") > -1) {
- if(GasInfo[GetPVarInt(playerid, "Refueling")][gAmount] < 0) {
- SendError(playerid, "There's no gas left!");
- TogglePlayerControllable(playerid, true);
- SetPVarInt(playerid, "Refueling", -1);
- }
- if(GetPlayerMoney(playerid) > GasInfo[GetPVarInt(playerid, "Refueling")][gPrice]) {
- new VehID = GetPlayerVehicleID(playerid);
- GivePlayerMoney(playerid, -1);
- VehicleInfo[VehID][Fuel] += 3;
- GasInfo[GetPVarInt(playerid, "Refueling")][gAmount] -= 3;
- GameTextForPlayer(playerid, "~r~Refueling!~n~Press ENTER to stop refueling.", 9000, 5);
- BusinessInfo[GasInfo[GetPVarInt(playerid, "Refueling")][gLinked]][bBank] += GasInfo[GetPVarInt(playerid, "Refueling")][gPrice]*3;
- SavePlayerGasStation(GetPVarInt(playerid, "Refueling"));
- if(VehicleInfo[VehID][Fuel] > 100) {
- VehicleInfo[VehID][Fuel] = 100;
- }
- }
- else {
- SendError(playerid, "You don't have enough money!");
- TogglePlayerControllable(playerid, true);
- SetPVarInt(playerid, "Refueling", -1);
- }
- }
- if(IsPlayerInAnyVehicle(playerid)) {
- new VehID = GetPlayerVehicleID(playerid);
- if(VehicleInfo[VehID][Fuel] == 0) {
- GameTextForPlayer(playerid, "~r~This vehicle has no fuel!~n~Press ENTER to get out of it.", 3000, 5);
- //SendClientMessage(playerid, COLOR_GREY, "The vehicle is out of fuel, you should buy a gas can or you should call a mechanic!");
- TogglePlayerControllable(playerid, false);
- }
- }
- if(GetPVarInt(playerid, "Hotwire_Progress") > 0) {
- if(GetPVarInt(playerid, "Hotwire_Progress") == 30) {
- new Success = random(100);
- if(Success < 70) {
- SendClientMessage(playerid, COLOR_GREY, "You didn't succed to hotwire this vehicle, you can try again!");
- return 1;
- }
- new VehID;
- VehID = GetPlayerVehicleID(playerid);
- SetPVarInt(playerid, "Hotwire_Progress", 0);
- TogglePlayerControllable(playerid, true);
- VehicleInfo[VehID][vHotwired] = 1;
- format(string, sizeof(string), "Engine starts (( %s ))", AccountData[playerid][PlayerName]);
- SendLocalMessage(playerid, string, 10.0, COLOR_ME, COLOR_ME);
- //SendFormattedMessage(playerid, COLOR_YELLOW, "Progress %d ", GetPVarInt(playerid, "Hotwire_Progress"));
- return 1;
- //ClearAnimations(playerid);
- }
- SetPVarInt(playerid, "Hotwire_Progress", GetPVarInt(playerid, "Hotwire_Progress") + 1);
- GameTextForPlayer(playerid, "~g~Hotwiring...", 9000, 5);
- //SendFormattedMessage(playerid, COLOR_YELLOW, "Progress %d ", GetPVarInt(playerid, "Hotwire_Progress"));
- }
- if(AccountData[playerid][Other] > 0) {
- new FactoryID = GetPVarInt(playerid, "InFactory");
- if(IsPlayerInRangeOfPoint(playerid, 20.0, FactoryInfo[FactoryID][fPos][0],FactoryInfo[FactoryID][fPos][1],FactoryInfo[FactoryID][fPos][2]) != 1) return AccountData[playerid][Other] = 0;
- }
- foreach(House, h) {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])) {
- if(HouseInfo[h][hSQLIDowner] == -1) {
- format(string, sizeof(string), "~w~House For Sale~n~~w~Level:~r~ %d~n~~w~Sell Price:~r~ %s~n~~w~Rent Cost:~r~ %d", HouseInfo[h][hLevel], FormatMoney(HouseInfo[h][hSell]), HouseInfo[h][hRent]);
- EUM_ShowForPlayer(playerid, 1, "~g~House for sale!", string);
- //GameTextForPlayer(playerid, string, 3000, 4);
- Houseinfo[playerid] = 1;
- }
- if(HouseInfo[h][hSQLIDowner] != - 1) {
- format(string, sizeof(string), "~w~Owned House~n~~w~Level:~r~ %d~n~~w~Rent Cost:~r~ %d", HouseInfo[h][hLevel], HouseInfo[h][hRent]);
- EUM_ShowForPlayer(playerid, 1, "~r~Owned house!", string);
- //GameTextForPlayer(playerid, string, 3000, 4);
- Houseinfo[playerid] = 1;
- }
- }
- }
- new descriptionstring[128];
- foreach(Business, b) {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, BusinessInfo[b][bPos][0], BusinessInfo[b][bPos][1], BusinessInfo[b][bPos][2])) {
- if(BusinessInfo[b][bType] == 1) { format(descriptionstring, 128, "This is a business what sells ~g~weapons."); }
- if(BusinessInfo[b][bType] == 2) { format(descriptionstring, 128, "This is business is a restaurant business."); }
- if(/*BusinessInfo[b][bSQLIDowner] == -1 &&*/ BusinessInfo[b][bSell] > 1 && BusinessInfo[b][bStatus] == 1) {
- format(string, sizeof(string), "~w~Business for sale~n~~w~Description:~n~%s~n~~n~~w~Base Price:~r~ %d~n~",descriptionstring, BusinessInfo[b][bSell]);
- //GameTextForPlayer(playerid, string, 3000, 4);
- EUM_ShowForPlayer(playerid, 1, "~g~Business for sale!", string);
- }
- if(BusinessInfo[b][bSQLIDowner] != -1) {
- format(string, sizeof(string), "~w~Owned Business~n~~w~Description:~n~%s",descriptionstring, BusinessInfo[b][bSell]);
- EUM_ShowForPlayer(playerid, 1, "~y~Owned Business!", string);
- //GameTextForPlayer(playerid, string, 3000, 4);
- }
- }
- foreach(Jobs, j) {
- if(IsPlayerInRangeOfPoint(playerid, 3.0, JobInfo[j][jPos][0], JobInfo[j][jPos][1], JobInfo[j][jPos][2])) {
- new JobString[24];
- format(string, sizeof(string), "~y~%s~n~~n~%s~n~Agreement:%i hours",JobInfo[j][jName], JobInfo[j][jDescription], JobInfo[j][jHours]);
- EUM_ShowForPlayer(playerid, 1, "~y~ ~<~ Job Information ~>~", string);
- }
- }
- new vehicleid;
- new trailerid;
- vehicleid = GetPlayerVehicleID(playerid);
- trailerid = GetVehicleTrailer(vehicleid);
- if(AccountData[playerid][Other] == 1) {
- if(TrailerInfo[trailerid][tType] == 1 && TrailerInfo[trailerid][pAmount] < 30) {
- if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
- new TakeOff = 1;
- if(TrailerInfo[trailerid][pAmount] == 29) {
- SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
- AccountData[playerid][Other] = 0;
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Weapons~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
- EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
- return 1;
- }
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- TrailerInfo[trailerid][pAmount] ++;
- format(string, sizeof(string), "~w~~n~Type:~y~Weapons~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
- SendFormattedMessage(playerid, COLOR_YELLOW, " AN: %f", FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- return 1;
- }
- }
- if(GetPVarInt(playerid, "PlayerInBooth") < -1) {
- new i = GetPVarInt(playerid, "PlayerInBooth");
- if(IsPlayerInRangeOfPoint(playerid, 1.5,PhoneBooth[i][pbC][0], PhoneBooth[i][pbC][1], PhoneBooth[i][pbC][2]) == 1) {
- SendClientMessage(Caller[playerid], COLOR_GREY, "The caller has dropped the call!");
- SendClientMessage(playerid, COLOR_GREY, "You have dropped the call!");
- Pickup[playerid] = 0;
- Pickup[Caller[playerid]] = 0;
- Caller[playerid] = 0;
- Caller[Caller[playerid]] = 0;
- SetPVarInt(playerid, "PlayerInBooth", 0);
- PhoneBooth[i][Active] = 1;
- return 1;
- }
- }
- vehicleid = GetPlayerVehicleID(playerid);
- trailerid = GetVehicleTrailer(vehicleid);
- if(AccountData[playerid][Other] == 3) {
- if(TrailerInfo[trailerid][tType] == 3 && TrailerInfo[trailerid][pAmount] < 100) {
- if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
- new TakeOff = 1;
- if(TrailerInfo[trailerid][pAmount] == 99) {
- SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
- AccountData[playerid][Other] = 0;
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Electronics~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
- EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
- return 1;
- }
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Electronics~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
- return 1;
- }
- }
- vehicleid = GetPlayerVehicleID(playerid);
- trailerid = GetVehicleTrailer(vehicleid);
- if(AccountData[playerid][Other] == 2) {
- if(TrailerInfo[trailerid][tType] == 2 && TrailerInfo[trailerid][pAmount] < 200) {
- if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
- new TakeOff = 1;
- if(TrailerInfo[trailerid][pAmount] == 199) {
- SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
- AccountData[playerid][Other] = 0;
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Food~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
- EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
- return 1;
- }
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Food~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
- return 1;
- }
- }
- vehicleid = GetPlayerVehicleID(playerid);
- trailerid = GetVehicleTrailer(vehicleid);
- if(AccountData[playerid][Other] == 4) {
- if(TrailerInfo[trailerid][tType] == 4 && TrailerInfo[trailerid][pAmount] < 50) {
- if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
- new TakeOff = 1;
- if(TrailerInfo[trailerid][pAmount] == 49) {
- SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
- AccountData[playerid][Other] = 0;
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Other~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
- EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
- return 1;
- }
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Other~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
- //SendFormattedMessage(playerid, COLOR_YELLOW, " AN: %0.2f", FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- return 1;
- }
- }
- vehicleid = GetPlayerVehicleID(playerid);
- trailerid = GetVehicleTrailer(vehicleid);
- if(AccountData[playerid][Other] == 5) {
- if(TrailerInfo[trailerid][tType] == 5 && TrailerInfo[trailerid][pAmount] < 300) {
- if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
- new TakeOff = 1;
- if(TrailerInfo[trailerid][pAmount] == 299) {
- SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
- AccountData[playerid][Other] = 0;
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Drinks~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
- EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
- return 1;
- }
- TrailerInfo[trailerid][pAmount] ++;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Drinks~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
- SendFormattedMessage(playerid, COLOR_YELLOW, " AN: %0.2f", FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- return 1;
- }
- }
- vehicleid = GetPlayerVehicleID(playerid);
- trailerid = GetVehicleTrailer(vehicleid);
- if(AccountData[playerid][Other] == 6) {
- if(TrailerInfo[trailerid][tType] == 6 && TrailerInfo[trailerid][pAmount] < 500) {
- if(FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] < 1) { AccountData[playerid][Other] = 0; SendError(playerid, "Error: There are no products available!"); return 1; }
- new TakeOff = 4;
- if(TrailerInfo[trailerid][pAmount] == 499) {
- SendClientMessage(playerid, COLOR_YELLOW, "The workers have filled your trailer, you now can go deliver the products!");
- AccountData[playerid][Other] = 0;
- TrailerInfo[trailerid][pAmount] += 4;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Oil (litres)~w~~n~Amount:~y~ %d",TrailerInfo[trailerid][pAmount]);
- EUM_ShowForPlayer(playerid, 1, "~y~Trailer Info", string);
- return 1;
- }
- TrailerInfo[trailerid][pAmount] += 4;
- FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock] -= float(TakeOff);
- format(string, sizeof(string), "~w~~n~Type:~y~Oil~w~~n~Amount:~y~ %d~n~~w~In Stock:~y~%0.2f",TrailerInfo[trailerid][pAmount],FactoryInfo[GetPVarInt(playerid, "InFactory")][fStock]);
- EUM_ShowForPlayer(playerid, 1, "~y~Factory", string);
- return 1;
- }
- }
- foreach(Factory, f) {
- if(FactoryInfo[f][fBank] < 2) { continue; }
- FactoryInfo[f][fStock] += FactoryInfo[f][ProduceRate];
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement