#include <a_samp>
#pragma tabsize 0
#include <a_samp> // samp
#include <core> // core samp
#include <float> // float minipulation
// many values and functions are in included scripts
// some need to be ran from a timer, or at specific events
#include "base" // holds base script values
#include "utils\gtoutils" // misc used utils
#include "utils\gtodudb" // old db handler
#include "utils\dini" // db handler
#include "utils\dutils" // more used tools
#include "lang"
#include "account" // account handler
#include "player" // holds player values
#include "weapons" // weapons and ammunation shop
#include "vehicles" // vehicles
#include "world" // functions for zone, location, world, etc
#include "commandhandler" // command handler
#include "gang" // gang handler
#include "business" // business handler
#include "housing" // housing handler
#include "logging" // logging handler
#include "race" // race handler, manages and runs all rasces
#include "deathmatch" // deathmatch handler
#include "bank" // bank money to keep it on death
#include "payday" // pay players money based on level
#include "groundhold" // hold ground to gain money, pirate ship, etc
#include "admin\admin_commands" // admin commands
#include "admin\admin_commands_race" // admin commands for race creation/minipulation
#include "admin\admin_commands_dm" // admin commands for deathmatch creation/minipulation
#include "admin\admin_commands_sys"
#include "admin\adm_commands"
#include "admin\mod_commands"
//ADDED
//static ServerTime;
//static ServerMinute;
new ServerSecond;
#include <time>
#tryinclude "testserver" // testserver specific functions
// Chat fix
#define fixchars(%1) for(new charfixloop=0;charfixloop<strlen(%1);charfixloop++)if(%1[charfixloop]<0)%1[charfixloop]+=256
// Races
#tryinclude "races\race_monstertruck" // Race: Monstertruck Madness
#tryinclude "races\race_thestrip" // Race: Burnin Down The Strip. - Just a strait sprint down the strip and back
#tryinclude "races\race_riversiderun" // Race: Riverside Run. - Beat the clock down a riverside dirt track.
#tryinclude "races\race_fleethecity" // Race: Flee The City. - race to air strip
#tryinclude "races\race_lostinsmoke" // Race: Lost in Smoke - a quick race around the city.
#tryinclude "races\race_backstreetbang" // Race: Backstreet bang
#tryinclude "races\race_flyingfree" // Race: Flying Free
#tryinclude "races\race_murderhorn" // Race: Murderhorn - by |Insane|
#tryinclude "races\race_roundwego" // Race: Airport Round We Go - by |Insane|
#tryinclude "races\race_striptease" // Race: Strip Tease - by |Insane|
#tryinclude "races\race_countrycruise" // Race: Countryside cruise
#tryinclude "races\race_thegrove" // Race: Tearin Up The Grove
#tryinclude "races\race_mullholland" // Race: Mullholland Getaway
#tryinclude "races\race_scal1" // RACE: BIG CIRCLE OF 3
// Deathmatches
#tryinclude "deathmatches\dm_air" // Deathmatch - Base Jump
#tryinclude "deathmatches\dm_area51" // Deathmatch - Area 51
#tryinclude "deathmatches\dm_badandugly" // Deathmatch - The Bad and the Ugly
#tryinclude "deathmatches\dm_bluemountains" // Deathmatch - Blue Mountains
#tryinclude "deathmatches\dm_cargoship" // Deathmatch - Cargo Ship
#tryinclude "deathmatches\dm_dildo" // Deathmatch - Dildo Farm Revenge
#tryinclude "deathmatches\dm_mbase" // Deathmatch - Millitary Base
#tryinclude "deathmatches\dm_minigunmadness"// Deathmatch - Minigun Madness
#tryinclude "deathmatches\dm_poolday" // Deathmatch - fy_poolday
#tryinclude "deathmatches\dm_usnavy" // Deathmatch - The US Navy
//#tryinclude "vehicles_extras" // vehicles extras,fuel,speedometer
#tryinclude "taxi" // taxi system
//v0.5.9.b.4
#define MAX_SWEARS 100
#define STR 100
new Swears[MAX_SWEARS][STR];
new num_words = 0;
#tryinclude "objects\mapicon" //Radar Icones
#tryinclude "objects\lottery" //Lottery
forward Lottery();
#tryinclude "objects\minerun" //MineRun
forward MineRun();
forward MineRun2();
forward MineRun3();
forward SetupPlayerForClassSelection(playerid);
forward GameModeExitFunc();
forward OnPlayerEnterVehicle();
//native settime(hour=12, minute=00, second=11);
//native settimer(2000, bool: singleshot=false);
//forward @timer();
//ADDED
forward WeatherUpdate();
//new Text:Clocka;
//forward SendClock();
//------------------------------------------------------------------------------
#define COLOR_RED 0xAA3333AA
#define COLOR_YELLOW 0xAA3333AA
#define tmp 0xAA3333AA
#define cmd 0xAA3333AA
#define COLOR_WHITE 0xAA3333AA
//------------------------------------------------------------------------------
main()
{
print(" Running LASVENTURAS Real city ");
print(" Running LASVENTURAS Real city");
print(" Coded By");
print(" Sector");
print("><><><><><><><><><><><><><><><><><");
}
//------------------------------------------------------------------------------
// Console Message
print(" ");
print(" ");
print("\n----------------------------------\n");
printf(" Running %s\n",LASVENTURAS Real city );
print(" ");
print(" Created by: Iain Gilbert (Bogart)");
print(" Continued by: Peter Steenbergen (j1nx)");
print(" Robin Kikkert (Dejavu)");
print(" Lajos Pacsek (asturel)");
print(" ");
print(" Translated to Dutch by FirstName LastName (Kraay)");
print(" Translated to Hungarian by Adam Arato (addam)");
print(" Translated to Norwegian by Jim C. Flaten (Inf3rn0)");
print(" Translated to Russian by Dmitry Borisoff (Beginner)");
print(" Translated to Spanish by FirstName LastName (capitanazo)");
print(" ");
print(" Visit us at
http://gto.gtaonline.eu ");
print("\n----------------------------------\n");
// Initialize everything that needs it
LoggingInit();
BaseLoadConfig();
AccountLoadConfig();
PlayerLoadConfig();
GangLoadConfig();
PaydayLoadConfig();
LoggingLoadConfig();
// fuelconfig();
WeaponLoadAll();
VehicleLoadAll();
RaceLoadAll();
DeathmatchLoadAll();
BusinessLoadAll();
HousesLoadAll();
AmmunationInit();
BankInit();
GroundholdInit();
BusinessInit();
HousesInit();
LanguageInit();
EnableTirePopping(1);
EnableZoneNames(1);
UsePlayerPedAnims();
AllowAdminTeleport(1);
// Races
#if defined _race_thestrip_included
race_thestrip_init();
#endif
#if defined _race_riversiderun_included
race_riversiderun_init();
#endif
#if defined _race_fleethecity_included
race_fleethecity_init();
#endif
#if defined _race_lostinsmoke_included
race_lostinsmoke_init();
#endif
#if defined _race_backstreetbang_included
race_backstreetbang_init();
#endif
#if defined _race_flyingfree_included
race_flyingfree_init();
#endif
#if defined _race_murderhorn_included
race_murderhorn_init();
#endif
#if defined _race_roundwego_included
race_roundwego_init();
#endif
#if defined _race_striptease_included
race_striptease_init();
#endif
#if defined _race_monstertruck_included
race_monstertruck_init();
#endif
#if defined _race_countrycruise_included
race_countrycruise_init();
#endif
#if defined _race_thegrove_included
race_thegrove_init();
#endif
#if defined _race_mullholland_included
race_mullholland_init();
#endif
#if defined _race_scal1_included
race_scal1_init();
#endif
// Deathmatches
#if defined _dm_air_included
dm_air_init();
#endif
#if defined _dm_area51_included
dm_area51_init();
#endif
#if defined _dm_badandugly_included
dm_badandugly_init();
#endif
#if defined _dm_bluemountains_included
dm_bluemountains_init();
#endif
#if defined _dm_cargoship_included
dm_cargoship_init();
#endif
#if defined _dm_dildo_included
dm_dildo_init();
#endif
#if defined _dm_mbase_included
dm_mbase_init();
#endif
#if defined _dm_minigunmadness_included
dm_minigunmadness_init();
#endif
#if defined _dm_poolday_included
dm_poolday_init();
#endif
#if defined _dm_usnavy_included
dm_usnavy_init();
#endif
// Fuel system
// #if defined _vehicles_extras_included
// for(new c=0;c<MAX_VEHICLES;c++)
// {
// Petrol[c] = float(Petrol_Amount);
// }
// SetTimer("CheckFuel", Petrol_Time, 1);
// SetTimer("checkpointUpdate", 1100, 1);
// #endif
// Taxi system
#if defined _taxi_included
SetTimer("taxischeck",TAXI_TIMER,1);
#endif
printf("SERVER: Racing, DM and Taxi scripts init");
#tryinclude "objects\new_pickups" //new pickups
#tryinclude "objects\new_objects" //new objects
#tryinclude "objects\lv_freebase" //Las Venturas FreeBase
printf("SERVER: New Objects and Pickups init");
//ADDED
WorldTime = 12;
// ServerTime = 12;
// ServerTime = WorldTime;
// ServerMinute = 0;
ServerSecond = 0;
SetWorldTime(WorldTime);
print(" \n");
printf("SERVER: Worldtime set as %d:0%d",WorldTime,ServerSecond);
SetWeather(10);
// Set timers for anything that needs constant checking
SetTimer("SpawnTimer", 1000, 1);
SetTimer("SyncPlayers", PLAYER_SYNC_DELAY, 1);
SetTimer("PlayerHealthRegen", HEALTH_REGEN_SPEED, 1);
SetTimer("TextScroller",TEXT_SCROLL_SPEED,1);
SetTimer("WorldSave", WorldSaveDelay, 1);
SetTimer("SyncTime", 60000, 1); //ADDED CLOCK WORLD
// SetTimer("SendClock", 120000, 1); //ADDED CLOCK WORLD
SetTimer("SyncActiveCP", 2600, 1);
SetTimer("CheckRace", 2000, 1);
SetTimer("CheckDM", 2000, 1);
SetTimer("PayDay", PayDayDelay, 1);
SetTimer("CheckAllGround", GROUNDHOLD_DELAY, 1);
SetTimer("TurnAround", TurnAroundDelay, 1);
SetTimer("HouseKeepUp",HOUSE_DELAY,1);
// SetTimer("WeatherUpdate",5000, 1);
//LOTERRY'S
SetTimer("Lottery",1200000,1);
// SetTimer("LotteryMoney",350000,1);
printf("SERVER: Lottery script init.");
SetTimer("MineRun",2000,1);
SetTimer("MineRun2",1000,1);
SetTimer("MineRun3",2500,1);
printf("SERVER: Military Base Bombing script init.");
// АНТИМАТ ИНИЦИАЛИЗАЦИЯ
new string[STR], File:file;
if((file = fopen("antiswear.cfg",io_read)))
{
while(fread(file,string))
{
for(new i = 0, j = strlen(string); i < j; i++) if(string[i] == '\n' || string[i] == '\r') string[i] = '\0';
Swears[num_words] = string;
// printf("%s", string);
num_words++;
}
fclose(file);
}
printf("SERVER: AntiSwear script init.");
//ADDED
// Spawn the world
ShowPlayerMarkers(1);
ShowNameTags(1);
SpawnWorld();
// WorldTime = 12;
if ((VerboseSave == 1) || (VerboseSave == -1))
{
WorldSave();
if (VerboseSave == -1) VerboseSave = 0;
}
// new string[MAX_STRING];
new hour,minute,second;
gettime(hour,minute,second);
if ( (hour <= 9) && (minute <= 9) ) {format(string,sizeof(string),"0%d:0%d",hour,minute);}
if ( (hour <= 9) && (minute > 9) ) {format(string,sizeof(string),"0%d:%d",hour,minute);}
if ( (hour > 9) && (minute <= 9) ) {format(string,sizeof(string),"%d:0%d",hour,minute);}
if ( (hour > 9) && (minute > 9) ) {format(string,sizeof(string),"%d:%d",hour,minute);}
printf("SERVER: %s initialization complete [%s].",gamemode, string);
new logstring[256];
format(logstring, sizeof (logstring), "SERVER: %s initialization complete [%s].",gamemode, string);
WriteLog(logstring);
return 1;
}
// When a player connect
return 1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid, COLOR_RED,"здарова чуваг");
SendClientMessage(playerid, COLOR_RED,"Ты попал на клёвый серв спасибо что зашёл");
SendClientMessage(playerid, COLOR_RED,"coded by Sector");
return 1;
}
public OnPlayerDisconnect(playerid)
{
SendClientMessage(playerid,COLOR_RED,"покинул серв");
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerFacingAngle(playerid,270);
SetPlayerCameraPos(playerid, 1960.9960,1343.0198,16.0);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
ShowScore(playerid)
{
new tmpTotal[128];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(tmpTotal, sizeof(tmpTotal), "<> %s's Статистика: Смертей: %d | Убито: %d | Ratio: %0.2f | Деньги: $%d | Тим Киллы: %d",playername,MyKills[playerid],MyDeaths[playerid], (Float:MyKills[playerid]/Float:MyDeaths[playerid]),GetPlayerMoney(playerid),TeamKills[playerid]);
SendClientMessage(playerid,green, tmpTotal);
}
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/kill", cmdtext, true, 10) == 0)
{//Открываешь команду
SetPlayerHealth(playerid, 0);
return 1;
}//Закрываешь комадну
if(strcmp(cmd, "/givemoney", true) == 0)
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)
SendClientMessage(playerid, COLOR_WHITE, "Используй: /givemoney [playerid] [количество]");
return 1;
}
giveplayerid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)
SendClientMessage(playerid, COLOR_WHITE, "Используй: /givemoney [playerid] [количество]");
return 1;
}
moneys = strval(tmp);
printf("givecash_command: %d %d",giveplayerid,moneys);
if (IsPlayerConnected(giveplayerid)
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
playermoney = GetPlayerMoney(playerid);
if (moneys > 0 && playermoney >= moneys) {
GivePlayerMoney(playerid, (0 - moneys);
GivePlayerMoney(giveplayerid, moneys);
format(string, sizeof(string), "Ты передал %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Тебе передали $%d от %s(player: %d).", moneys, sendername, playerid);
SendClientMessage(giveplayerid, COLOR_YELLOW, string);
printf("%s(playerid:%d) has transfered %d to %s(playerid:%d)",sendername, playerid, moneys, giveplayer, giveplayerid);
}
else {
SendClientMessage(playerid, COLOR_RED, "Такой суммы не возможно передать!");
}
}
else {
format(string, sizeof(string), "%d не активный игрок", giveplayerid);
SendClientMessage(playerid, COLOR_YELLOW, string);
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
//Debug("GTO.pwn > OnPlayerEnterCheckpoint(playerid) - Start");
OnPlayerEnterAmmoCheckpoint(playerid);
OnPlayerEnterRaceCheckpoint(playerid);
OnPlayerEnterDMCheckpoint(playerid);
OnPlayerEnterBankCheckpoint(playerid);
OnPlayerEnterBusinessCheckpoint(playerid);
OnPlayerEnterHousesCheckpoint(playerid);
// OnPlayerEnterFuelCheckpoint(playerid);
//Debug("GTO.pwn > OnPlayerEnterCheckpoint(playerid) - Stop");
}
public OnPlayerDeath(playerid, killerid, reason) // loose xp, give money, deaths++
{
//Debug("GTO.pwn > OnPlayerDeath(playerid, killerid, reason) - Start");
if (!IsPlayerConnected(playerid))
{
//Debug("GTO.pwn > OnPlayerDeath(playerid, killerid, reason) - Stop(308)");
return 1;
}
if (killerid == INVALID_PLAYER_ID)
{
new logstring[256];
format(logstring, sizeof (logstring), "player: %d: %s: has died > Reason: (%d)",playerid,oGetPlayerName(playerid),reason);
WriteLog(logstring);
}
else
{
new logstring[256];
format(logstring, sizeof (logstring), "player: %d: %s: has killed player %s(%d)> Reason: (%d)",killerid,oGetPlayerName(killerid),oGetPlayerName(playerid),playerid,reason);
WriteLog(logstring);
}
SendDeathMessage(killerid,playerid,reason);
if (!IsPlayerInAnyDM(playerid))
{
PlayerDeath(playerid, killerid, reason);
}
else
{
OnPlayerDMDeath(playerid,killerid);
}
if (killerid == INVALID_PLAYER_ID)
{
//Debug("GTO.pwn > OnPlayerDeath(playerid, killerid, reason) - Stop(323)");
return 1;
}
if (!IsPlayerInAnyDM(playerid);
{
PlayerKill(killerid, playerid, reason);
}
else
{
OnPlayerDMKill(killerid,playerid,reason);
}
//Debug("GTO.pwn > OnPlayerDeath(playerid, killerid, reason) - Stop");
return 1;
}
// When a player spwans