Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //----------------------------------------------------------
- //
- // Play Brasil v2.0
- // Divirta-s no nosso servidor
- //
- //----------------------------------------------------------
- #include a_samp
- #include dini
- #include DOF2
- #include <YSI\y_commands>
- #include <YSI\y_va>
- #include <core>
- #include <float>
- #include "../include/gl_common.inc"
- #include "../include/gl_spawns.inc"
- #define GREEN 0x21DD00FF
- #define RED 0xE60000FF
- #define ADMIN_RED 0xFB0000FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define LIGHTBLUE 0x00C2ECFF
- #define PURPLE 0xB360FDFF
- #define PLAYER_COLOR 0xFFFFFFFF
- #define BLUE 0x1229FAFF
- #define LIGHTGREEN 0x38FF06FF
- #define DARKPINK 0xE100E1FF
- #define DARKGREEN 0x008040FF
- #define ANNOUNCEMENT 0x6AF7E1FF
- #define COLOR_SYSTEM 0xEFEFF7AA
- #define GREY 0xCECECEFF
- #define PINK 0xD52DFFFF
- #define DARKGREY 0x626262FF
- #define AQUAGREEN 0x03D687FF
- #define NICESKY 0x99FFFFAA
- #define WHITE 0xFFFFFFFF
- #define ACCOUNTS_FOLDER "Contas/%s.ini"
- #define LOGIN_DELAY 3
- #define COLOR_RED 0xAA3333AA
- #define COLOR_GREEN 0x33AA33AA
- #define PATH "Armas"
- #define COLOR_WHITE 0xFFFFFFFF
- #define COLOR_NORMAL_PLAYER 0xFFBB7777
- #define CITY_LOS_SANTOS 0
- #define CITY_SAN_FIERRO 1
- #define CITY_LAS_VENTURAS 2
- #pragma tabsize 0
- new bool:AlreadyGiveWeapons[MAX_PLAYERS];
- SaveWeaponsToFile(playerid)
- {
- new i, path[50], string[128], weaponid, ammo;
- path = GetPlayerFormattedName(playerid);
- if (!dini_Exists(path)) dini_Create(path);
- for (i=0; i<13; i++)
- {
- GetPlayerWeaponData(playerid,i,weaponid,ammo);
- format(string,sizeof(string),"Arma - %d",i);
- dini_IntSet(path,string,weaponid);
- format(string,sizeof(string),"Municao - %d",i);
- dini_IntSet(path,string,ammo == 65535 ? 0 : ammo);
- }
- }
- forward LoadArmasToFile(playerid);
- public LoadArmasToFile(playerid)
- {
- new i, path[50], string[128], weaponid, ammo;
- path = GetPlayerFormattedName(playerid);
- ResetPlayerWeapons(playerid);
- for (i=0; i<13; i++)
- {
- format(string,sizeof(string),"Arma - %d",i);
- weaponid = dini_Int(path,string);
- format(string,sizeof(string),"Municao - %d",i);
- ammo = dini_Int(path,string);
- GivePlayerWeapon(playerid,weaponid,ammo);
- }
- AlreadyGiveWeapons[playerid] = true;
- }
- GetPlayerFormattedName(playerid)
- {
- new name[24], full[50];
- GetPlayerName(playerid,name,sizeof(name));
- format(full,sizeof(full),"%s/%s.txt",PATH,name);
- return full;
- }
- //----------------------------------------------------------
- new total_vehicles_from_files=0;
- // Class selection globals
- new gPlayerCitySelection[MAX_PLAYERS];
- new gPlayerHasCitySelected[MAX_PLAYERS];
- new gPlayerLastCitySelectionTick[MAX_PLAYERS];
- new Text:txtClassSelHelper;
- new Text:txtLosSantos;
- new Text:txtSanFierro;
- new Text:txtLasVenturas;
- new thisanimid=0;
- new lastanimid=0;
- //----------------------------------------------------------
- main()
- {
- print("\n---------------------------------------");
- print("Iniciando Play Brasil v2.0\n");
- print("---------------------------------------\n");
- }
- //----------------------------------------------------------
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new playercash;
- gPlayerHasCitySelected[playerid] = 0;
- if(killerid == INVALID_PLAYER_ID) {
- ResetPlayerMoney(playerid);
- } else {
- playercash = GetPlayerMoney(playerid);
- if(playercash > 0) {
- GivePlayerMoney(killerid, playercash);
- ResetPlayerMoney(playerid);
- }
- }
- return 1;
- }
- //----------------------------------------------------------
- ClassSel_InitCityNameText(Text:txtInit)
- {
- TextDrawUseBox(txtInit, 0);
- TextDrawLetterSize(txtInit,1.25,3.0);
- TextDrawFont(txtInit, 0);
- TextDrawSetShadow(txtInit,0);
- TextDrawSetOutline(txtInit,1);
- TextDrawColor(txtInit,0xEEEEEEFF);
- TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
- }
- //----------------------------------------------------------
- ClassSel_InitTextDraws()
- {
- // Init our observer helper text display
- txtLosSantos = TextDrawCreate(10.0, 380.0, "Los Santos");
- ClassSel_InitCityNameText(txtLosSantos);
- txtSanFierro = TextDrawCreate(10.0, 380.0, "San Fierro");
- ClassSel_InitCityNameText(txtSanFierro);
- txtLasVenturas = TextDrawCreate(10.0, 380.0, "Las Venturas");
- ClassSel_InitCityNameText(txtLasVenturas);
- // Init our observer helper text display
- txtClassSelHelper = TextDrawCreate(10.0, 415.0,
- " Press ~b~~k~~GO_LEFT~ ~w~or ~b~~k~~GO_RIGHT~ ~w~to switch cities.~n~ Press ~r~~k~~PED_FIREWEAPON~ ~w~to select.");
- TextDrawUseBox(txtClassSelHelper, 1);
- TextDrawBoxColor(txtClassSelHelper,0x222222BB);
- TextDrawLetterSize(txtClassSelHelper,0.3,1.0);
- TextDrawTextSize(txtClassSelHelper,400.0,40.0);
- TextDrawFont(txtClassSelHelper, 2);
- TextDrawSetShadow(txtClassSelHelper,0);
- TextDrawSetOutline(txtClassSelHelper,1);
- TextDrawBackgroundColor(txtClassSelHelper,0x000000FF);
- TextDrawColor(txtClassSelHelper,0xFFFFFFFF);
- }
- //----------------------------------------------------------
- ClassSel_SetupSelectedCity(playerid)
- {
- if(gPlayerCitySelection[playerid] == -1) {
- gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
- }
- if(gPlayerCitySelection[playerid] == CITY_LOS_SANTOS) {
- SetPlayerInterior(playerid,0);
- SetPlayerCameraPos(playerid,1630.6136,-2286.0298,110.0);
- SetPlayerCameraLookAt(playerid,1887.6034,-1682.1442,47.6167);
- TextDrawShowForPlayer(playerid,txtLosSantos);
- TextDrawHideForPlayer(playerid,txtSanFierro);
- TextDrawHideForPlayer(playerid,txtLasVenturas);
- }
- else if(gPlayerCitySelection[playerid] == CITY_SAN_FIERRO) {
- SetPlayerInterior(playerid,0);
- SetPlayerCameraPos(playerid,-1300.8754,68.0546,129.4823);
- SetPlayerCameraLookAt(playerid,-1817.9412,769.3878,132.6589);
- TextDrawHideForPlayer(playerid,txtLosSantos);
- TextDrawShowForPlayer(playerid,txtSanFierro);
- TextDrawHideForPlayer(playerid,txtLasVenturas);
- }
- else if(gPlayerCitySelection[playerid] == CITY_LAS_VENTURAS) {
- SetPlayerInterior(playerid,0);
- SetPlayerCameraPos(playerid,1310.6155,1675.9182,110.7390);
- SetPlayerCameraLookAt(playerid,2285.2944,1919.3756,68.2275);
- TextDrawHideForPlayer(playerid,txtLosSantos);
- TextDrawHideForPlayer(playerid,txtSanFierro);
- TextDrawShowForPlayer(playerid,txtLasVenturas);
- }
- }
- //----------------------------------------------------------
- ClassSel_SwitchToNextCity(playerid)
- {
- gPlayerCitySelection[playerid]++;
- if(gPlayerCitySelection[playerid] > CITY_LAS_VENTURAS) {
- gPlayerCitySelection[playerid] = CITY_LOS_SANTOS;
- }
- PlayerPlaySound(playerid,1052,0.0,0.0,0.0);
- gPlayerLastCitySelectionTick[playerid] = GetTickCount();
- ClassSel_SetupSelectedCity(playerid);
- }
- //----------------------------------------------------------
- ClassSel_SwitchToPreviousCity(playerid)
- {
- gPlayerCitySelection[playerid]--;
- if(gPlayerCitySelection[playerid] < CITY_LOS_SANTOS) {
- gPlayerCitySelection[playerid] = CITY_LAS_VENTURAS;
- }
- PlayerPlaySound(playerid,1053,0.0,0.0,0.0);
- gPlayerLastCitySelectionTick[playerid] = GetTickCount();
- ClassSel_SetupSelectedCity(playerid);
- }
- //----------------------------------------------------------
- ClassSel_HandleCitySelection(playerid)
- {
- new Keys,ud,lr;
- GetPlayerKeys(playerid,Keys,ud,lr);
- if(gPlayerCitySelection[playerid] == -1) {
- ClassSel_SwitchToNextCity(playerid);
- return;
- }
- // only allow new selection every ~500 ms
- if( (GetTickCount() - gPlayerLastCitySelectionTick[playerid]) < 500 ) return;
- if(Keys & KEY_FIRE) {
- gPlayerHasCitySelected[playerid] = 1;
- TextDrawHideForPlayer(playerid,txtClassSelHelper);
- TextDrawHideForPlayer(playerid,txtLosSantos);
- TextDrawHideForPlayer(playerid,txtSanFierro);
- TextDrawHideForPlayer(playerid,txtLasVenturas);
- TogglePlayerSpectating(playerid,0);
- return;
- }
- if(lr > 0) {
- ClassSel_SwitchToNextCity(playerid);
- }
- else if(lr < 0) {
- ClassSel_SwitchToPreviousCity(playerid);
- }
- }
- //----------------------------------------------------------
- public OnGameModeInit()
- {
- SendRconCommand("reloadfs Seifistration");
- SetGameModeText("Play Brasil v2.0");
- ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL);
- ShowNameTags(1);
- SetNameTagDrawDistance(40.0);
- EnableStuntBonusForAll(0);
- DisableInteriorEnterExits();
- SetWeather(2);
- SetWorldTime(11);
- //UsePlayerPedAnims();
- //ManualVehicleEngineAndLights();
- //LimitGlobalChatRadius(300.0);
- ClassSel_InitTextDraws();
- //Estacionamento Começo
- AddStaticVehicleEx(451,1560.6752,-2308.8251,13.3847,89.7603,-1,-1,-1);//Turismo
- AddStaticVehicleEx(496,1560.6705,-2312.1889,13.3851,90.0159,-1,-1,-1);//Blista Compact
- AddStaticVehicleEx(522,1560.6695,-2315.4543,13.3858,90.3470,-1,-1,-1);//NRG-500
- AddStaticVehicleEx(535,1560.5975,-2318.7077,13.3869,90.4286,-1,-1,-1);//Slamvan
- AddStaticVehicleEx(536,1560.5722,-2322.0429,13.3872,90.0234,-1,-1,-1);//Blade
- AddStaticVehicleEx(571,1560.5582,-2325.2968,13.3868,91.6376,-1,-1,-1);//Kart
- AddStaticVehicleEx(602,1560.5460,-2328.5771,13.3868,91.2366,-1,-1,-1);//Alpha
- AddStaticVehicleEx(424,1560.5727,-2331.8737,13.3865,91.1397,-1,-1,-1);//BF Injection
- AddStaticVehicleEx(426,1560.6219,-2335.1589,13.3850,90.4296,-1,-1,-1);//Premier
- AddStaticVehicleEx(463,1560.6428,-2338.4057,13.3850,89.9542,-1,-1,-1);//Freeway
- AddStaticVehicleEx(468,1556.1920,-2361.2795,13.3926,358.7655,-1,-1,-1);//Sanchez
- AddStaticVehicleEx(494,1552.8095,-2361.3000,13.3926,0.8178,-1,-1,-1);//Hotring Racer
- AddStaticVehicleEx(534,1549.4101,-2361.4143,13.3603,359.5743,-1,-1,-1);//Remington
- AddStaticVehicleEx(541,1546.2360,-2361.4167,13.3926,359.6683,-1,-1,-1);//Bullet
- AddStaticVehicleEx(545,1542.9621,-2361.4099,13.3926,0.1327,-1,-1,-1);//Hustler
- AddStaticVehicleEx(560,1539.7258,-2361.3950,13.3926,1.2470,-1,-1,-1);//Sultan
- AddStaticVehicleEx(568,1536.3930,-2361.3400,13.3926,0.9429,-1,-1,-1);//Bandito
- AddStaticVehicleEx(579,1533.0325,-2361.3640,13.3928,0.8261,-1,-1,-1);//Huntley
- AddStaticVehicleEx(477,1529.8009,-2361.3803,13.3927,0.0713,-1,-1,-1);//ZR-350
- AddStaticVehicleEx(603,1526.4805,-2361.3305,13.3926,358.9965,-1,-1,-1);//Phoenix
- CreateObject(987,1565.90002441,-2308.19995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (2)
- CreateObject(987,1565.90002441,-2320.10009766,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (4)
- CreateObject(987,1566.00000000,-2331.80004883,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (5)
- CreateObject(987,1565.90002441,-2343.69995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (7)
- CreateObject(987,1565.90002441,-2355.69995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (8)
- CreateObject(987,1566.00000000,-2367.69995117,12.50000000,0.00000000,0.00000000,90.00000000); //object(elecfence_bar) (10)
- CreateObject(987,1554.30004883,-2368.00000000,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (11)
- CreateObject(987,1542.30004883,-2368.00000000,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (12)
- CreateObject(987,1530.30004883,-2368.10009766,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (14)
- CreateObject(987,1518.30004883,-2368.10009766,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (15)
- CreateObject(987,1506.50000000,-2367.89990234,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (16)
- CreateObject(987,1494.50000000,-2367.89990234,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (18)
- CreateObject(987,1484.40002441,-2367.89990234,12.50000000,0.00000000,0.00000000,0.00000000); //object(elecfence_bar) (19)
- CreateObject(987,1484.50000000,-2356.30004883,12.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (20)
- CreateObject(987,1484.50000000,-2344.30004883,12.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (21)
- CreateObject(987,1484.59997559,-2342.39990234,12.50000000,0.00000000,0.00000000,270.00000000); //object(elecfence_bar) (22)
- CreateObject(987,1496.19995117,-2340.39990234,12.50000000,0.00000000,0.00000000,190.00000000); //object(elecfence_bar) (23)
- CreateObject(987,1508.09997559,-2340.30004883,12.50000000,0.00000000,0.00000000,180.00000000); //object(elecfence_bar) (24)
- CreateObject(987,1520.09997559,-2340.30004883,12.50000000,0.00000000,0.00000000,179.99450684); //object(elecfence_bar) (25)
- CreateObject(987,1532.00000000,-2340.30004883,12.50000000,0.00000000,0.00000000,179.99450684); //object(elecfence_bar) (26)
- CreateObject(987,1538.19995117,-2340.50000000,12.50000000,0.00000000,0.00000000,177.99450684); //object(elecfence_bar) (27)
- CreateObject(987,1538.50000000,-2328.80004883,12.50000000,0.00000000,0.00000000,269.99450684); //object(elecfence_bar) (28)
- CreateObject(987,1538.50000000,-2316.89990234,12.50000000,0.00000000,0.00000000,269.98901367); //object(elecfence_bar) (29)
- CreateObject(987,1538.40002441,-2307.80004883,12.50000000,0.00000000,0.00000000,269.98901367); //object(elecfence_bar) (30)
- CreateObject(987,1538.30004883,-2296.69995117,12.50000000,0.00000000,0.00000000,269.98901367); //object(elecfence_bar) (31)
- CreateObject(987,1565.69995117,-2296.60009766,12.60000038,0.00000000,0.00000000,179.98901367); //object(elecfence_bar) (32)
- CreateObject(1324,1542.19995117,-2295.39990234,14.00000000,0.00000000,0.00000000,68.00000000 ); //object(ws_roadwarning_04) (1)
- CreateObject(3881,1562.50000000,-2301.69995117,14.39999962,0.00000000,0.00000000,0.00000000 ); //object(airsecbooth_sfse) (1)
- CreateObject(3749,1547.890,-2297.051,18.548,0.000,0.000,0.000); //object(clubgate01_lax) (1)
- //Estacionamento Fim
- //Não tirar Começo
- AddPlayerClass(281,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(282,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(283,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(284,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(285,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(286,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(287,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(288,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(265,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(266,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(267,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(268,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(269,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(270,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(1,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(2,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(3,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(4,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(5,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(6,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(8,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(42,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(65,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- //AddPlayerClass(74,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(86,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(119,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(149,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(208,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(273,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(289,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(47,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(48,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(49,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(50,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(51,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(52,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(53,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(54,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(55,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(56,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(57,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(58,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(68,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(69,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(70,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(71,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(72,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(73,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(75,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(76,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(78,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(79,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(80,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(81,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(82,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(83,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(84,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(85,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(87,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(88,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(89,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(91,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(92,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(93,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(95,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(96,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(97,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(98,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- AddPlayerClass(99,1759.0189,-1898.1260,13.5622,266.4503,-1,-1,-1,-1,-1,-1);
- //Não tirar Fim
- // SPECIAL
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
- // LAS VENTURAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
- // SAN FIERRO
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
- // LOS SANTOS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
- // OTHER AREAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
- printf("Total de veículos carregados: %d",total_vehicles_from_files);
- return 1;
- }
- enum aInfo
- {
- aSenha[128],
- aLogged,
- }
- ;
- new AccountInfo[MAX_PLAYERS][aInfo];
- new registro[MAX_PLAYERS];
- new login[MAX_PLAYERS];
- forward LogIn(playerid);
- forward OnPlayerUpdate(playerid);
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if (response == 1)
- {
- if(dialogid == 12345)
- {
- if(strlen(inputtext))
- {
- Encrypt(inputtext);
- new player[MAX_PLAYER_NAME];
- GetPlayerName(playerid, player, 50);
- new string3[32];
- new playername3[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername3, sizeof(playername3));
- format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
- new ip[20];
- GetPlayerIp(playerid,ip,sizeof(ip));
- new File: hFile = fopen(string3, io_write);
- if (hFile)
- {
- strmid(AccountInfo[playerid][aSenha], inputtext, 0, strlen(inputtext), 255);
- new var[128];
- format(var, 128, "Senha=%s\n", AccountInfo[playerid][aSenha]);fwrite(hFile, var);
- format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
- fclose(hFile);
- printf("%s is signed up.",playername3);
- SendClientMessage(playerid, GREEN, "|- Voce já esta registrado, faça login. -|");
- new girismsg[256];
- format(girismsg,256,"Seja Bem Vindo\n\nNick: %s\n\nSenha:",playername3);
- ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
- registro[playerid] = 0;
- login[playerid] = 1;
- }
- }
- else if(!strlen(inputtext))
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- new kayitmsg[256];
- format(kayitmsg,256,"Seja Bem Vindo\n\n%s Por favor, se registre!\n\nSenha:",name);
- ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",kayitmsg,"Registrar","Sair");
- registro[playerid] = 1;
- login[playerid] = 0;
- }
- }
- if(dialogid == 12346)
- {
- Encrypt(inputtext);
- new string2[128];
- new playername2[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername2, sizeof(playername2));
- format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
- new File: UserFile = fopen(string2, io_read);
- if ( UserFile )
- {
- new PassData[256];
- new keytmp[256], valtmp[256];
- fread( UserFile , PassData , sizeof( PassData ) );
- keytmp = ini_GetKey( PassData );
- if( strcmp( keytmp , "Senha" , true ) == 0 )
- {
- valtmp = ini_GetValue( PassData );
- strmid(AccountInfo[playerid][aSenha], valtmp, 0, strlen(valtmp)-1, 255);
- }
- if(strcmp(AccountInfo[playerid][aSenha],inputtext, true ) == 0)
- {
- if(strlen(inputtext))
- {
- for(new p = 0; p < strlen(AccountInfo[playerid][aSenha]); p++)
- {
- inputtext[p] = '?';
- }
- SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
- printf("%s esta logando.",playername2);
- new key[256];
- new Data[256];
- while ( fread( UserFile , Data , sizeof( Data ) ) )
- {
- key = ini_GetKey( Data );
- /*if(strcmp(key, "AdminLevel", true) == 0) // This is only an example if you want to add more stuff to store in a file.
- {
- val = ini_GetValue( Data );
- AccountInfo[playerid][AdminLevel] = strval(val); // Uncommenting this will give you errors if the variable isn't defined.
- }
- */
- }
- fclose(UserFile);
- }
- }
- else
- {
- if(strlen(inputtext))
- {
- new girismsg[256];
- printf("%s esta usando senha errada.",playername2);
- format(girismsg,256,"SENHA ERRADA\n\nSenha:");
- ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
- login[playerid] = 1;
- registro[playerid] = 0;
- fclose(UserFile);
- return 1;
- }
- }
- if(!strlen(inputtext))
- {
- new girismsg[256];
- printf("%s nao esta entrando com senha.",playername2);
- format(girismsg,256,"SENHA ERRADA\n\nSenha:");
- ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
- login[playerid] = 1;
- registro[playerid] = 0;
- fclose(UserFile);
- return 1;
- }
- }
- }
- if(dialogid == 12347)
- {
- Encrypt(inputtext);
- new string2[128];
- new playername2[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername2, sizeof(playername2));
- format(string2, sizeof(string2), ACCOUNTS_FOLDER, playername2);
- new File: UserFile = fopen(string2, io_read);
- if ( UserFile )
- {
- new PassData[256];
- new keytmp[256], valtmp[256];
- fread( UserFile , PassData , sizeof( PassData ) );
- keytmp = ini_GetKey( PassData );
- if( strcmp( keytmp , "Senha" , true ) == 0 )
- {
- valtmp = ini_GetValue( PassData );
- strmid(AccountInfo[playerid][aSenha], valtmp, 0, strlen(valtmp)-1, 255);
- }
- if(strcmp(AccountInfo[playerid][aSenha],inputtext, true ) == 0)
- {
- if(strlen(inputtext))
- {
- for(new p = 0; p < strlen(AccountInfo[playerid][aSenha]); p++)
- {
- inputtext[p] = '?';
- }
- SetTimerEx("LogIn", LOGIN_DELAY*1000, 0, "d", playerid);
- printf("%s esta logando.",playername2);
- new key[256];
- new Data[256];
- while ( fread( UserFile , Data , sizeof( Data ) ) )
- {
- key = ini_GetKey( Data );
- /*if(strcmp(key, "AdminLevel", true) == 0) // Este é apenas um exemplo, se você quiser acrescentar mais coisas para guardar em um arquivo.
- {
- val = ini_GetValue( Data );
- AccountInfo[playerid][AdminLevel] = strval(val); // Descomentando isso vai lhe dar erros se a variável não está definida.
- }
- */
- }
- fclose(UserFile);
- }
- }
- else
- {
- if(strlen(inputtext))
- {
- new girismsg[256];
- printf("%s esta errando a senha.",playername2);
- format(girismsg,256,"SENHA ERRADA\n\nSenha:");
- ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
- login[playerid] = 1;
- registro[playerid] = 0;
- fclose(UserFile);
- return 1;
- }
- }
- if(!strlen(inputtext))
- {
- new girismsg[256];
- printf("%s did not enter the Senha.",playername2);
- format(girismsg,256,"SENHA ERRADA\n\nSenha:");
- ShowPlayerDialog(playerid,12347,DIALOG_STYLE_INPUT,"Login",girismsg,"Login","Quit");
- login[playerid] = 1;
- registro[playerid] = 0;
- fclose(UserFile);
- return 1;
- }
- }
- }
- }
- else return Kick(playerid);
- return 0;
- }
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- stock ini_GetKey( line[] )
- {
- new keyRes[256];
- keyRes[0] = 0;
- if ( strfind( line , "=" , true ) == -1 ) return keyRes;
- strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
- return keyRes;
- }
- stock ini_GetValue( line[] )
- {
- new valRes[256];
- valRes[0]=0;
- if ( strfind( line , "=" , true ) == -1 ) return valRes;
- strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
- return valRes;
- }
- public LogIn(playerid)
- {
- AccountInfo[playerid][aLogged] = 1;
- registro[playerid] = 0;
- login[playerid] = 0;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(!IsPlayerConnected(playerid)) return 0;
- if(IsPlayerNPC(playerid)) return 1;
- // changing cities by inputs
- if( !gPlayerHasCitySelected[playerid] &&
- GetPlayerState(playerid) == PLAYER_STATE_SPECTATING ) {
- ClassSel_HandleCitySelection(playerid);
- return 1;
- }
- // No weapons in interiors
- if(GetPlayerInterior(playerid) != 0 && GetPlayerWeapon(playerid) != 0) {
- SetPlayerArmedWeapon(playerid,0); // fists
- return 0; // no syncing until they change their weapon
- }
- // Don't allow minigun
- if(GetPlayerWeapon(playerid) == WEAPON_MINIGUN) {
- Kick(playerid);
- return 0;
- }
- /* No jetpacks allowed
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) {
- Kick(playerid);
- return 0;
- }*/
- /* For testing animations
- new msg[128+1];
- new animlib[32+1];
- new animname[32+1];
- thisanimid = GetPlayerAnimationIndex(playerid);
- if(lastanimid != thisanimid)
- {
- GetAnimationName(thisanimid,animlib,32,animname,32);
- format(msg, 128, "anim(%d,%d): %s %s", lastanimid, thisanimid, animlib, animname);
- lastanimid = thisanimid;
- SendClientMessage(playerid, 0xFFFFFFFF, msg);
- }*/
- if(IsPlayerConnected(playerid))
- {
- if(AccountInfo[playerid][aLogged] == 1)
- {
- new string3[128];
- new playername3[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername3, sizeof(playername3));
- format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3);
- new ip[20];
- GetPlayerIp(playerid,ip,sizeof(ip));
- new File: hFile = fopen(string3, io_write);
- if (hFile)
- {
- new var[128];
- format(var, 128, "Senha=%s\n", AccountInfo[playerid][aSenha]);fwrite(hFile, var);
- format(var, 128, "IP=%s\n",ip);fwrite(hFile, var);
- fclose(hFile);
- }
- }
- }
- return 1;
- }
- Encrypt(string[])
- {
- for(new x=0; x < strlen(string); x++)
- {
- string[x] += (3^x) * (x % 15);
- if(string[x] > (0xff))
- {
- string[x] -= 256;
- }
- }
- }
- //----------------------------------------------------------
- #include <a_samp>
- #include <DOF2>
- #include <YSI\y_commands>
- #include <YSI\y_va>
- #define PLAYER_FILE "Spawn/%s.ini"
- #define SPAWN_MODE 1
- #define SPAWN_TIME 20//utilize em segundos, no caso 10 = 10 segundos.
- #define SPAWN_COMMAND_STYLE 2
- #define SPAWN_COMMAND "continuar"
- #define SPAWN_DIALOG 1380
- #if SPAWN_MODE == 2
- new
- timeCheck[MAX_PLAYERS],
- timerCheckSpawn[MAX_PLAYERS],
- bool: spawningPlayer[MAX_PLAYERS];
- #endif
- new
- bool: playerConnected[MAX_PLAYERS];
- forward CheckSpawnPos(playerid);
- forward CheckSpawnPosTime(playerid);
- public OnFilterScriptInit()
- {
- printf("|------------------------------------------------|");
- printf("|-------- Sistema de armas editado por caio --------|");
- printf("|------------------------------------------------|");
- print("Sistema de salvar dinheiro carregado ....");
- #if SPAWN_MODE == 2
- #if SPAWN_COMMAND_STYLE == 2
- Command_AddAltNamed("8b89cef034928dc", SPAWN_COMMAND);
- #endif
- #endif
- return 1;
- }
- public OnFilterScriptExit()
- {
- printf("|------------------------------------------------|");
- printf("|--------- Sistema de salvar armas editado por caio ---------|");
- printf("|------------------------------------------------|");
- new i, Nome[25], Diretorio[40];
- for ( i = 0; i < MAX_PLAYERS; ++i ) {
- if ( IsPlayerConnected(i) ) {
- GetPlayerName(i, Nome, 25);
- format (Diretorio, sizeof Diretorio, "Dinheiro/%s.ini", Nome);
- DOF2_SetInt(Diretorio, "Quantia", GetPlayerMoney(i));
- DOF2_SaveFile();
- }
- }
- DOF2_Exit();
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, 0xFF8C00, "Sempre use /capacete ou /cinto");
- AlreadyGiveWeapons[playerid] = false;
- GameTextForPlayer(playerid,"~w~Play Brasil v2.0",3000,4);
- SendClientMessage(playerid,COLOR_WHITE,"Bem vindo ao {88AA88}P{FFFFFF}lay {88AA88}B{FFFFFF}rasil");
- // class selection init vars
- gPlayerCitySelection[playerid] = -1;
- gPlayerHasCitySelected[playerid] = 0;
- gPlayerLastCitySelectionTick[playerid] = GetTickCount();
- //Tirar postes no ponto de taxi Começo
- RemoveBuildingForPlayer(playerid, 1226, 1774.7578, -1931.3125, 16.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1226, 1806.4297, -1931.6016, 16.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1226, 1774.7578, -1901.5391, 16.3750, 0.25);
- RemoveBuildingForPlayer(playerid, 1226, 1806.4297, -1901.8281, 16.3750, 0.25);
- //Tirar postes no ponto de taxi Fim
- //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
- //Kick(playerid);
- /*
- Removes vending machines
- RemoveBuildingForPlayer(playerid, 1302, 0.0, 0.0, 0.0, 6000.0);
- RemoveBuildingForPlayer(playerid, 1209, 0.0, 0.0, 0.0, 6000.0);
- RemoveBuildingForPlayer(playerid, 955, 0.0, 0.0, 0.0, 6000.0);
- RemoveBuildingForPlayer(playerid, 1775, 0.0, 0.0, 0.0, 6000.0);
- RemoveBuildingForPlayer(playerid, 1776, 0.0, 0.0, 0.0, 6000.0);
- */
- /*
- new ClientVersion[32];
- GetPlayerVersion(playerid, ClientVersion, 32);
- printf("Player %d reports client version: %s", playerid, ClientVersion);*/
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- new string[128];
- format(string, sizeof(string), ACCOUNTS_FOLDER, name);
- if (AccountInfo[playerid][aLogged] == 0)
- {
- if (!fexist(string))
- {
- new kayitmsg[256];
- format(kayitmsg,256,"Seja Bem Vindo\n\n%s Por favor, se registre!\n\nSenha:",name);
- ShowPlayerDialog(playerid,12345,DIALOG_STYLE_INPUT,"Registrar",kayitmsg,"Registrar","Sair");
- GivePlayerMoney(playerid, 30000);
- registro[playerid] = 1;
- login[playerid] = 0;
- }
- else if (fexist(string))
- {
- new girismsg[256];
- format(girismsg,256,"Seja Bem Vindo\n\nNick: %s\n\nSenha:",name);
- ShowPlayerDialog(playerid,12346,DIALOG_STYLE_INPUT,"Logar",girismsg,"Logar","Sair");
- registro[playerid] = 0;
- login[playerid] = 1;
- }
- }
- playerConnected[playerid]= true;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
- if (!AlreadyGiveWeapons[playerid]) SetTimerEx("LoadArmasToFile",250,false,"i",playerid);
- new Diretorio[40], Nome[25];
- GetPlayerName(playerid, Nome, 25);
- format (Diretorio, sizeof Diretorio, "Dinheiro/%s.ini", Nome);
- if ( fexist(Diretorio) )
- GivePlayerMoney(playerid, DOF2_GetInt(Diretorio, "Quantia"));
- else {
- DOF2_CreateFile(Diretorio);
- DOF2_SetInt(Diretorio, "Quantia", 0);
- DOF2_SaveFile();
- }
- if(IsPlayerNPC(playerid))
- return true;
- new randSpawn = 0;
- SetPlayerInterior(playerid,0);
- TogglePlayerClock(playerid,0);
- //SetPlayerColor(playerid,COLOR_NORMAL_PLAYER);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_PISTOL_SILENCED,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_DESERT_EAGLE,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SHOTGUN,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SAWNOFF_SHOTGUN,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SPAS12_SHOTGUN,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_MICRO_UZI,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_MP5,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_AK47,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_M4,200);
- SetPlayerSkillLevel(playerid,WEAPONSKILL_SNIPERRIFLE,200);
- GivePlayerWeapon(playerid,WEAPON_COLT45,100);
- //GivePlayerWeapon(playerid,WEAPON_MP5,100);
- TogglePlayerClock(playerid, 0);
- if(playerConnected[playerid])
- {
- new
- playerFileFormatted[62];
- format(playerFileFormatted, 62, PLAYER_FILE, GetPlayerNameEx(playerid));
- if(!DOF2_FileExists(playerFileFormatted))
- return DOF2_CreateFile(playerFileFormatted);
- #if SPAWN_MODE == 1
- return SetTimerEx("CheckSpawnPos", 500, false, "i", playerid);
- #elseif SPAWN_MODE == 2
- timerCheckSpawn[playerid] = SetTimerEx("CheckSpawnPosTime", 1000, true, "i", playerid);
- spawningPlayer[playerid] = true;
- return 1;
- #elseif SPAWN_MODE == 3
- ShowDialog(playerid, SPAWN_DIALOG);
- #endif
- playerConnected[playerid] = false;
- }
- return 1;
- }
- #if SPAWN_MODE == 2
- #if SPAWN_COMMAND_STYLE == 1
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if ((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
- if(spawningPlayer[playerid]) {
- BreakLine(playerid);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Enviado à última posição salva.");
- KillTimer(timerCheckSpawn[playerid]);
- spawningPlayer[playerid] = false;
- return CheckSpawnPos(playerid);
- }
- return 1;
- }
- #endif
- #elseif SPAWN_MODE == 3
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case SPAWN_DIALOG:
- {
- if(!response)
- return 1;
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Enviado à última posição salva.");
- CheckSpawnPos(playerid);
- return 1;
- }
- }
- return 0;
- }
- #endif
- public OnPlayerDisconnect(playerid)
- {
- SaveWeaponsToFile(playerid);
- new Diretorio[40], Nome[25];
- GetPlayerName(playerid, Nome, 25);
- format (Diretorio, sizeof Diretorio, "Dinheiro/%s.ini", Nome);
- DOF2_SetInt(Diretorio, "Quantia", GetPlayerMoney(playerid) );
- DOF2_SaveFile();
- OnPlayerUpdate(playerid);
- AccountInfo[playerid][aLogged] = 0;
- registro[playerid] = 0;
- login[playerid] = 0;
- new
- Float: flo_player_pos[3],
- Float: flo_player_fa,
- int_player_int = GetPlayerInterior(playerid),
- playerFileFormatted[62];
- GetPlayerPos(playerid, flo_player_pos[0], flo_player_pos[1], flo_player_pos[2]);
- GetPlayerFacingAngle(playerid, flo_player_fa);
- format(playerFileFormatted, 62, PLAYER_FILE, GetPlayerNameEx(playerid));
- if(!DOF2_FileExists(playerFileFormatted))
- DOF2_CreateFile(playerFileFormatted);
- DOF2_SetFloat(playerFileFormatted, "Last Pos X", flo_player_pos[0]);
- DOF2_SetFloat(playerFileFormatted, "Last Pos Y", flo_player_pos[1]);
- DOF2_SetFloat(playerFileFormatted, "Last Pos Z", flo_player_pos[2]);
- DOF2_SetFloat(playerFileFormatted, "Last Pos FA", flo_player_fa);
- DOF2_SetInt(playerFileFormatted, "Last Int", int_player_int);
- DOF2_SaveFile();
- return 1;
- }
- public CheckSpawnPos(playerid)
- {
- new
- Float: oldPlayerPos[3],
- Float: oldPlayerPosFA,
- oldPlayerPosInt,
- playerFileFormatted[62];
- playerConnected[playerid] = false;
- format(playerFileFormatted, 62, PLAYER_FILE, GetPlayerNameEx(playerid));
- oldPlayerPos[0] = DOF2_GetFloat(playerFileFormatted, "Last Pos X");
- oldPlayerPos[1] = DOF2_GetFloat(playerFileFormatted, "Last Pos Y");
- oldPlayerPos[2] = DOF2_GetFloat(playerFileFormatted, "Last Pos Z");
- oldPlayerPosFA = DOF2_GetFloat(playerFileFormatted, "Last Pos FA");
- oldPlayerPosInt = DOF2_GetInt(playerFileFormatted, "Last Int");
- SetPlayerPos(playerid, oldPlayerPos[0], oldPlayerPos[1], oldPlayerPos[2]);
- SetPlayerFacingAngle(playerid, oldPlayerPosFA);
- SetPlayerInterior(playerid, oldPlayerPosInt);
- return 1;
- }
- #if SPAWN_MODE == 2
- public CheckSpawnPosTime(playerid)
- {
- timeCheck[playerid]++;
- if (timeCheck[playerid] == 1)
- {
- #if SPAWN_COMMAND_STYLE == 1
- va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para apertar a tecla {64DCFF}Y {FFFFFF}e continuar aonde", SPAWN_TIME);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
- #elseif SPAWN_COMMAND_STYLE == 2
- va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para digitar o comando {64DCFF}/%s {FFFFFF}e continuar aonde", SPAWN_TIME, SPAWN_COMMAND);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
- #endif
- }
- else if (timeCheck[playerid] == SPAWN_TIME/2)
- {
- #if SPAWN_COMMAND_STYLE == 1
- BreakLine(playerid);
- va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para apertar a tecla {64DCFF}Y {FFFFFF}e continuar aonde", SPAWN_TIME/2);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
- #elseif SPAWN_COMMAND_STYLE == 2
- BreakLine(playerid);
- va_SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Você tem {64DCFF}%d {FFFFFF}segundos para digitar o comando {64DCFF}/%s {FFFFFF}e continuar aonde", SPAWN_TIME/2, SPAWN_COMMAND);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}estava quando se desconectou do servidor pela última vez.");
- #endif
- }
- else if (timeCheck[playerid] == SPAWN_TIME)
- {
- BreakLine(playerid);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}O tempo acabou e você vai continuar aonde está.");
- timeCheck[playerid] = 0;
- spawningPlayer[playerid] = false;
- KillTimer(timerCheckSpawn[playerid]);
- return 1;
- }
- return 1;
- }
- #endif
- #if SPAWN_MODE == 2
- #if SPAWN_COMMAND_STYLE == 2
- YCMD:8b89cef034928dc(playerid, params[], help)
- {
- if(!spawningPlayer[playerid])
- return 0;
- BreakLine(playerid);
- SendClientMessage(playerid, 0x6491FFFF, "| LSpawn | {FFFFFF}Enviado à última posição salva.");
- KillTimer(timerCheckSpawn[playerid]);
- spawningPlayer[playerid] = false;
- return CheckSpawnPos(playerid);
- }
- #endif
- #elseif SPAWN_MODE == 3
- ShowDialog(playerid, dialogid)
- {
- switch(dialogid)
- {
- case SPAWN_DIALOG:
- {
- new
- formatMsg[128];
- BreakLine(playerid);
- format(formatMsg, sizeof formatMsg, "{FFFFFF}Olá {64DCFF}%s{FFFFFF}, gostaria de continuar de onde você parou na sua última sessão?", GetPlayerNameEx(playerid));
- ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_MSGBOX, "Spawn...", formatMsg, "Sim", "Não");
- return 1;
- }
- }
- return 1;
- }
- #endif
- GetPlayerNameEx(playerid)
- {
- new
- playerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playerName, MAX_PLAYER_NAME);
- return playerName;
- }
- BreakLine(playerid) {
- return SendClientMessage(playerid, -1, " ");
- }
- //----------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement