Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //======================================[ INCLUDE ]====================================||
- #include a_samp
- #include DOF2
- #include zcmd
- #include sscanf2
- #include sii
- //======================================[ DEFINE ]====================================||
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 50
- #define Controle TogglePlayerControllable
- #define DarMoney(%0,%1) ResetPlayerMoney(%0) && GivePlayerMoney(%0,%1)
- #define VDaOrg(%0,%1,%2) GetPlayerVehicleID(playerid) >= %0[%1] && GetPlayerVehicleID(playerid) <= %0[%2]
- //======================================[ DIALOG ]====================================||
- #define DIALOG_REGISTER 0
- #define DIALOG_LOGIN 1
- #pragma tabsize 0
- // CORES
- #define COLOR_RG 0xA8F0F4FF
- #define Color_Admin 0xFF80FFFF
- #define COR_PM 0x8470FFFF //0x5C3CE8F6
- #define COR_BOPE 0x19197096
- #define COR_BOPE2 0x408080FF
- #define COR_SWAT 0x7D03FFFF
- #define COR_EXE 0x00660CF6
- #define COR_Medicos 0xFF8282FF
- #define COR_AZULZAO 0x005FFFFF
- #define ROXO 0xC2A2DAAA
- #define COR_CINZA1 0xB4B5B7FF
- #define RED1 0xE60000FF
- #define GREEN1 0x21DD00FF
- #define COR_AZTECAS 0x2641FEAA
- #define COR_BOP 0x330099AA
- #define COR_Rifa 0xC599C8AA
- #define COR_BOMBEIROS 0xF05353AA //0xFF0000FF
- #define COR_PRE 0x6699FFFF
- #define COR_HITMAN 0x696969FF //0xB4B5B7FF
- #define COR_REPORTER 0xFF9900FF
- #define COR_TAXI 0x33FFFFFF //0xEE4000AA
- #define COR_PF 0x91766296
- #define COR_PRp 0x996600FF
- #define COR_YAK 0x00483AF6
- #define COLOR_BARZ 0x00483AAA
- #define COLOR_RIFA 0xFBC63FAA //0xF09F50AA
- #define COR_GRO 0x33FF00FF
- #define COR_FARC 0x676767FF
- #define COR_PC 0x666699FF
- #define COR_BALLAS 0x9900CCFF
- #define COR_VAGOS 0xFFFF00FF
- #define COR_CVSF 0xB60000AA
- #define COR_PR 0xF09F50FF
- #define COR_HELPER 0x55F6ACFF
- #define CORGZ_COPS 0x5B88ACAA
- #define COR_TRIADS 0xB0DDF3FF //0xBCD2EEFF antiga cor by info
- #define COR_GI 0x33CCFFAA
- #define COR_GIC 0xFE005DFF
- #define COR_WHITE 0xFFF8F8AA
- #define VERDE2 0x33FF00FF
- #define COLOR_CORLEONE 0xFF6200AA
- #define COLOR_VERDE2 0x33FF00FF
- #define COLOR_DEPTH 0x993333FF
- #define COR_ADMIN -10043754
- #define COLOR_ADMIN 0xF64CCAFF
- #define COR_PCC 0x9ACD32AA
- #define COR_CRIPS 0xFFFF99AA
- #define COR_MERCENARIOS 0xFF333365
- #define COR_TALIBAN 0xFF1493AA
- #define COR_COSANOSTRA 0x33FFFFAA
- #define COLOR_WHITE 0xFFFFFFFF
- #define COR_MAYAN 0x8B2252AA
- #define COLOR_CHAT_PCC 0x9ACD32FF
- #define LARANJA 0xFF6600AA
- #define VERDECLARO 0x00FF0CAA
- #define COLOR_ALIANCA 0xA9A9A9FF
- #define VERDEFRACO 0x80cf80AA
- #define COLOR_AMARELOR 0xFFFF00AA
- #define VERDEFRACOR 0x80cf80AA
- #define COR_3DLABEL 0x0FFFC8FF
- #define COLOR_AZULBB 0xE6D4D1FF
- #define TEAM_CYAN_COLOR 0xA92BF6F6
- #define TEAM_CYAN_COLOR2 0xFF8282AA
- #define GCOP_COLOR 0x6666FFC8
- #define COLOR_LIGHTRED 0xFF6347AA
- #define COLORGZ_BARZINI 0x006699C8
- #define COLORGZ_PF 0x000000C8
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define TEAM_GROVE_COLOR 0x00D900AA
- #define TEAM_BALLAS_COLOR 0x9900FFAA
- #define TEAM_AZTECAS_COLOR 0x2641FEAA
- #define COLOR_GRAD1 0xB4B5B7FF
- #define COLOR_GRAD2 0xBFC0C2FF
- #define COLOR_GRAD3 0xBFC0C2FF
- #define COLOR_GRAD4 0xD8D8D8FF
- #define COLOR_GRAD5 0xF0F0F0FF
- #define COLOR_GRAD6 0xF0F0F0FF
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_DBLUE 0x2641FEAA
- #define COLOR_SAMP 0xACCBF1FF
- #define COLOR_YELLOW 0xFFFF00FF
- #define COLOR_YELLOWF 0xFFFF00FF
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_LIGHTGREEN 0x9ACD32AA
- #define TEAM_VAGOS_COLOR 0xFFC801AA
- #define CINZA 0xAFAFAFAA
- #define PRETO 0x000000FF
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_RCARRO 0x80FF8096
- #define TEAM_HIT_COLOR 0xFFFFFF00
- #define CINZA2 0xBFC0C2FF
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_NEWS 0xFFA500AA
- #define COLOR_NEWS 0xFFA500AA
- #define COLOR_ALLDEPT 0xFF8282AA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_R 0x6666CCFF
- #define COLORGZ_ALCAIDA 0x10100FAA
- #define COLOR_MSG 0x934FF6F6
- #define COLORGZ_Rifa 0xC599C8AA
- #define COLORGZ_GI 0x00ECF6AA
- #define AZUL3 0x33CCFFAA
- #define CINZA1 0xB4B5B7FF
- #define AN_COLOR 0x00E7C6F6
- #define COLOR_YELLOW2 0xF5DEB3AA
- #define COLOR_TAXISTA 0xF68E00F6
- #define TEAM_BLUE_COLOR 0x8D8DFF00
- #define COLORGZ_LH 0x00E7C6C8
- #define COLORGZ_EXE 0x33AA33C8
- #define COLOR_EXE 0x33AA33C8
- // GANGZONES
- new GZhospital1;
- // NEWS
- new Text:textmorte[2];
- new MEGAString[2500];
- new Texto[256]; //Lembrando, é uma variável global, não deve ser posta dentro de qualquer estrutura que use chaves.
- // /chatkill
- new bool:ChatKill[MAX_PLAYERS];
- stock SendDeathMessageBPW(killerid,playerid,reason)
- {
- foreach(Player, i){
- if(ChatKill[i]){
- SendDeathMessageToPlayer(i, killerid,playerid,reason);
- }
- }
- }
- #define SendDeathMessage SendDeathMessageBPW
- stock ResetVars(playerid)
- {
- ChatKill[playerid] = false;
- return true;
- }
- //======================================[ Start ]======================================||
- main(){}
- enum Info
- {
- Membro, //Identifica de que organização o player é membro. 0 para civil.
- Cargo, //Identifica qual o cargo do player. 10 para líder.
- };
- new ProgressaoInfo[MAX_PLAYERS][Info]; //Utilizaremos essa variável com arrays em conjunto com o enum
- enum pInfo
- {
- pAdmin,
- pSkin,
- pScore,
- pMoney,
- Float:pPosX,
- Float:pPosY,
- Float:pPosZ,
- Float:pPosA,
- pInterior,
- pVW,
- bool:pLogado
- }
- new
- Player[MAX_PLAYERS][pInfo],reset[pInfo],
- Conta[256]
- ;
- new Nomeorgs[5][128] = //[5] representa o numero de linhas iniciando do 0 e [128] o numero de caracters máximo de cada string.
- {
- "Civil", //Org [0]: Como dito no enum, a org 0 é civil, não é propriamente uma org mas é necessário ter pois o player será automaticamente membro da org 0 caso não definido.
- "Assassinos", //Org [1]: Assassinos por contrato, Hitmans.
- "Aeronautica", //Org [2]: Aeronautica, controle aéreo.
- "Drifters", //Org [3]: Drifters, corredores de derrapagem.
- "Policial Federal" //Org [4]: Policiais Federais, casos de escala nacional.
- };
- const C_Civil = 0xFFFFFFFF; //Cor dos civis, branco.
- const C_Assassinos = 0x000000FF; //Cor dos assassinos, preto.
- const C_Aeronautica = 0x1E90FF99; //Cor da aeronautica, azul.
- const C_Drifters = 0x1E90AA99; //Cor dos drifters, verde.
- const C_PFederal = 0x6C7B8BFF; //Cor da Policia Federal, azul escuro.
- new VCivil[3]; //Os Civis tem 3 veículos
- new VAssassinos[5]; //Os Assassinos tem 5 veículos.
- new VAeronautica[7]; //A Aeronautica tem 7 veículos.
- new VDrifters[4]; //Os Drifters tem 4 veículos.
- new VPFederal[6]; //A Policia Federal tem 6 veículos.
- //=====================================[ CALLBACKS ]====================================||
- public OnGameModeInit()
- {
- print("\n ====================================================================");
- print(" | |");
- print(" | GameMode Base DOF2 Version 1.5 Started... |");
- print(" | |");
- print(" | * By KinG7. * |");
- print(" | |");
- print(" ====================================================================\n");
- SetGameModeText("by KinG7");
- DisableInteriorEnterExits();
- UsePlayerPedAnims();
- ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED);
- ShowNameTags(1);
- SetNameTagDrawDistance(100.0);
- // GANGZONES
- GZhospital1 = GangZoneCreate(1249.3438,-1288.7474, 1069.0786,-1387.2887);
- // TEXTDRAW
- textmorte[0] = TextDrawCreate(655.000000, 0.000000, "_");
- TextDrawBackgroundColor(textmorte[0], 255);
- TextDrawFont(textmorte[0], 1);
- TextDrawLetterSize(textmorte[0], 0.500000, 49.600021);
- TextDrawColor(textmorte[0], -1);
- TextDrawSetOutline(textmorte[0], 0);
- TextDrawSetProportional(textmorte[0], 1);
- TextDrawSetShadow(textmorte[0], 1);
- TextDrawUseBox(textmorte[0], 1);
- TextDrawBoxColor(textmorte[0], 180);
- TextDrawTextSize(textmorte[0], -10.000000, 0.000000);
- TextDrawSetSelectable(textmorte[0], 0);
- textmorte[1] = TextDrawCreate(140.000000, 205.000000, "voce morreu");
- TextDrawBackgroundColor(textmorte[1], 255);
- TextDrawFont(textmorte[1], 3);
- TextDrawLetterSize(textmorte[1], 1.550000, 4.800002);
- TextDrawColor(textmorte[1], -16776961);
- TextDrawSetOutline(textmorte[1], 1);
- TextDrawSetProportional(textmorte[1], 1);
- TextDrawSetSelectable(textmorte[1], 0);
- // CARROS
- //**********************************[ Veículos Civis]*************************************************
- VCivil[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VCivil[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VCivil[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- //******************************[ Veículos dos Assassinos]*************************************************
- VAssassinos[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VAssassinos[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VAssassinos[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- //E assim vai até criar todos os veículos pra completar as arrays da variável.
- //******************************[ Veículos da Aeronautica]*************************************************
- VAeronautica[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VAeronautica[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VAeronautica[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- //E assim vai até criar todos os veículos pra completar as arrays da variável.
- //******************************[ Veículos dos Drifters]*************************************************
- VDrifters[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VDrifters[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VDrifters[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- //E assim vai até criar todos os veículos pra completar as arrays da variável.
- //***************************[ Veículos da Policia Federal]**********************************************
- VPFederal[0] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VPFederal[1] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- VPFederal[2] = CreateVehicle(462,1142.7998000,-1750.7002000,13.2000000,357.9950000,21,231,15);
- //E assim vai até criar todos os veículos pra completar as arrays da variável.
- //============ Carros extras
- AddStaticVehicleEx(400,2293.6978,-1671.7883,14.7966,359.0262,-1,-1,-1); //
- AddStaticVehicleEx(401,2568.5051,-1724.2327,13.3263,89.8617,-1,-1,-1); // 2
- AddStaticVehicleEx(402,1857.4216,-1759.2261,13.3784,90.4204,-1,-1,-1); // 3
- AddStaticVehicleEx(403,1820.8308,-1467.8524,14.1557,269.8344,-1,-1,-1); // 4
- AddStaticVehicleEx(404,1755.3098,-1344.1333,15.4895,268.9281,-1,-1,-1);// 5
- AddStaticVehicleEx(405,1958.3906,-1333.3604,22.6108,270.2152,-1,-1,-1); // 6
- AddStaticVehicleEx(412,1081.9503,-1703.7773,13.3845,270.0951,-1,-1,-1); // 7
- AddStaticVehicleEx(415,1381.1915,-1848.0261,13.3185,178.8771,-1,-1,-1); // 8
- AddStaticVehicleEx(419,1745.2642,-1860.0833,13.2886,270.6426,-1,-1,-1); // 9
- AddStaticVehicleEx(421,1867.1594,-1036.5278,23.7917,242.8647,-1,-1,-1); // 10
- AddStaticVehicleEx(429,2740.9465,-1143.8796,44.9619,271.0641,-1,-1,-1); // 11
- AddStaticVehicleEx(434,2790.1929,-1883.4969,11.0383,89.0240,-1,-1,-1); // 12
- AddStaticVehicleEx(439,-2843.5898,387.3704,4.3959,0.8420,-1,-1,-1); // 13
- AddStaticVehicleEx(442,925.1368,-1122.3147,23.8355,359.8628,0,0,80); // 14 cemiterio
- AddStaticVehicleEx(442,936.0014,-1122.5574,23.8264,359.5724,0,0,80); // 15 cemiterio
- AddStaticVehicleEx(443,-2217.4207,-258.7235,36.1471,180.6103,-1,-1,-1); // 16
- AddStaticVehicleEx(458,-2103.2908,-560.2798,32.1236,231.4280,-1,-1,-1); // 17
- AddStaticVehicleEx(466,-1461.6459,-567.2202,13.8901,200.7890,-1,-1,-1); // 18
- AddStaticVehicleEx(513,-1461.0604,-521.4478,14.8829,205.9236,-1,-1,-1); // 19
- AddStaticVehicleEx(593,-1433.8032,-507.8747,14.9001,208.0814,-1,-1,-1); // 20
- AddStaticVehicleEx(500,-1317.9556,-495.7501,14.2491,29.0032,-1,-1,-1); // 21
- AddStaticVehicleEx(504,-1287.7189,-313.0418,13.9409,201.9427,-1,-1,-1); // 22
- AddStaticVehicleEx(566,2657.2393,-1691.9628,9.0937,269.5798,13,13,-1); // carro 13
- AddStaticVehicleEx(578,2792.8848,-1673.7758,10.5196,179.8651,1,1,-1); // carro 14
- AddStaticVehicleEx(560,1400.5226,-2262.8608,13.2517,358.3562,3,3,-1); // carro aero
- AddStaticVehicleEx(475,1552.7026,-2361.6294,13.3589,358.4216,9,39,-1); // carro aero
- AddStaticVehicleEx(526,1385.0472,-2347.6960,13.3057,358.8528,5,5,-1); // carro aero
- AddStaticVehicleEx(418,1838.0145,-1871.1613,13.4829,359.4306,7,7,-1); // carro 2
- AddStaticVehicleEx(405,1564.19995117,-1445.69995117,13.39999962,89.99993896,0,0,-1); //Sentinel
- AddStaticVehicleEx(560,1388.3287,-1454.3060,13.2515,342.0545,0,0,-1); // carro extra
- AddStaticVehicleEx(526,1425.0472,-1143.3719,23.6817,178.8585,182,182,-1); // ao lado da zip perto do banco
- //Trem
- AddStaticVehicleEx(538,1698.0930,-1953.8319,13.5469,0.0,0,0,256);
- return 1;
- }
- public OnGameModeExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- IsPlayerLogged(playerid);
- return false;
- }
- public OnPlayerRequestSpawn(playerid) return IsPlayerLogged(playerid);
- IsPlayerLogged(playerid)
- {
- if(Player[playerid][pLogado] == true)
- {
- SetSpawnInfo(playerid,-1,Player[playerid][pSkin],Player[playerid][pPosX],Player[playerid][pPosY],Player[playerid][pPosZ],Player[playerid][pPosA],0,0,0,0,0,0);
- SpawnPlayer(playerid);
- SetPlayerInterior(playerid, 0);
- SetCameraBehindPlayer(playerid);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- TextDrawShowForPlayer(playerid, textmorte[0]);
- TextDrawShowForPlayer(playerid, textmorte[1]);
- //hospital
- Player[playerid][pPosX]=2034.1435;
- Player[playerid][pPosY]=-1402.1190;
- Player[playerid][pPosZ]=16.6299;
- Player[playerid][pPosA]=90.0;
- return 1;
- }
- public OnPlayerText(playerid, text[]) {
- if(Player[playerid][pLogado] == false) return SendClientMessage(playerid,-1,"[ERRO] Você não está logado!"),false;
- new i, Float:Pos[3], str[128], Nome[MAX_PLAYER_NAME];
- GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
- GetPlayerName(playerid, Nome, MAX_PLAYER_NAME);
- format (str, 128, "%s diz: %s", Nome, text);
- for ( i = 0; i < MAX_PLAYERS; ++i) {
- if ( IsPlayerConnected(i) && IsPlayerInRangeOfPoint(playerid, 10.0, Pos[0], Pos[1], Pos[2]) ) {
- SendClientMessage(i, -1, str);
- }
- }
- return 0;
- }
- public OnPlayerConnect(playerid)
- {
- GangZoneShowForPlayer(playerid, GZhospital1, 0x00FFFFFF);
- Player[playerid][pLogado]=false;
- //=================================[ LOGIN/REGISTRO ]===============================||
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- if(!DOF2_FileExists(Conta))
- {
- ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Escreva uma senha, para se registrar!", "Registrar", "Sair");
- }
- else
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LOGIN", "Bem vindo ! \nEscreva uma senha abaixo para entrar em sua conta.", "Entrar", "Sair");
- }
- //==================================================================================|
- new nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, sizeof(nome));
- format(Texto, 35, "Jogadores/%s", nome); //Formatará na variável Texto o caminho onde fica o arquivo com os dados do player.
- if(fexist(Texto)) //Verificará se o arquivo existe, caso exista executará o que vem entre as chaves abaixo.
- {
- INI_Open(Texto); //É necessário abrir o arquivo antes de tudo.
- ProgressaoInfo[playerid][Membro] = INI_ReadInt("Organização");
- ProgressaoInfo[playerid][Cargo] = INI_ReadInt("Cargo");
- INI_Close(); //É necessário apenas fechar o arquivo sem salvar, pois nada foi modificado nele.
- }
- return 1;
- }
- stock SalvarPlayer(playerid)
- {
- new nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, sizeof(nome));
- format(Texto, 35, "Jogadores/%s", nome); //Formatará na variável Texto o caminho onde ficará o arquivo com os dados do player.
- INI_Open(Texto); //Abrirá o arquivo para escrever as informações, caso não exista, ele criará automaticamente.
- INI_WriteInt("Organização", ProgressaoInfo[playerid][Membro]); //Setará na TAG Organização o valor inteiro da variável Membro do playerid(No caso o ID da org dele).
- INI_WriteInt("Cargo", ProgressaoInfo[playerid][Cargo]); //Setará na TAG Cargo o valor inteiro da variável Cargo do playerid(No caso, o cargo dele na org).
- INI_Save(); //Salvar é necessário, caso não salve, não verá nada escrito no arquivo.
- INI_Close(); //Também é necessário Fechar oa rquivo aberto.
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- SalvarConta(playerid);
- SalvarPlayer(playerid);
- //reset in variable's
- Player[playerid] = reset;
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- //=================================[ DIALOG_REGISTER ]==============================||
- if(dialogid == DIALOG_REGISTER)
- {
- if(!response) return Kick(playerid);
- if(strlen(inputtext) < 4) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Escreva uma senha, para se registrar!", "registrar", "sair");
- if(response)
- {
- if(strlen(inputtext))
- {
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- DOF2_CreateFile(Conta);
- DOF2_SetString(Conta, "Password", inputtext);
- DOF2_SaveFile();
- CriarConta(playerid);
- CarregarConta(playerid);
- }
- else ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, "Register", "Escreva uma senha, para se registrar!", "registrar", "Sair");
- }
- return 1;
- }
- //=================================[ DIALOGO LOGIN ]==============================||
- if(dialogid == DIALOG_LOGIN)
- {
- if(!response) return Kick(playerid);
- if(response)
- {
- if(!strlen(inputtext))
- {
- return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "LOGIN", "Bem vindo ! \nEscreva uma senha abaixo para entrar em sua conta.","entrar", "sair");
- }
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- if(strcmp(inputtext, DOF2_GetString(Conta, "Password"), true))
- {
- ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "LOGIN", "Bem vindo ! \nEscreva uma senha abaixo para entrar em sua conta.","entrar", "sair");
- SendClientMessage(playerid, -1, "[ SERVER ] a senha está errada!");
- }
- else //se acertar a senha
- {
- CarregarConta(playerid);
- }
- }
- return 1;
- }
- return 1;
- }
- // DIALOG ORGANIZAÇÃO
- if(dialogid == 100 && response) //100 é o ID do dialog que usamos no ShowPlayerDialog do comando /convidar. Response é a resposta ao primeiro botão do dialog, no caso, "Sim".
- {
- ProgressaoInfo[playerid][Membro] = GetPVarInt(playerid, "OrgConvidado"); //Setaremos a org do player = a org setada no PVar dele, que é a mesma do player que o convidou.
- ProgressaoInfo[playerid][Cargo] = 1; //Setaremos o cargo do player para 1 afinal ele acabou de entrar na nova organização.
- DeletePVar(playerid, "OrgConvidado"); //Deletaremos a PVar que usamos no comando /convidar.
- return true;
- }
- return true;
- }
- public OnPlayerSpawn(playerid)
- {
- SetPlayerSkin(playerid, Player[playerid][pSkin]);
- DarMoney(playerid,Player[playerid][pMoney]);
- TogglePlayerControllable(playerid,true);
- TextDrawHideForPlayer(playerid, textmorte[0]);
- TextDrawHideForPlayer(playerid, textmorte[1]);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate) //Verificará a mudança de estado do player
- {
- if(newstate == PLAYER_STATE_DRIVER) //O novo estado do player é de motorista.
- {
- if(VDaOrg(VCivil,0,2)) SendClientMessage(playerid, C_Civil, "Você entrou em um veículo Civil");
- if(VDaOrg(VAssassinos,0,4) && ProgressaoInfo[playerid][Membro] != 2) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Assassinos, "Você não é um Assassino");
- if(VDaOrg(VAeronautica,0,6) && ProgressaoInfo[playerid][Membro] != 3) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Aeronautica, "Você não é da Aeronautica");
- if(VDaOrg(VDrifters,0,3) && ProgressaoInfo[playerid][Membro] != 4) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_Drifters, "Você não é um Drifter");
- if(VDaOrg(VPFederal,0,5) && ProgressaoInfo[playerid][Membro] != 5) return RemovePlayerFromVehicle(playerid), SendClientMessage(playerid, C_PFederal, "Você não é um Policial Federal");
- }
- return true;
- }
- //=============================[Comandos]==============================================||
- cmd(membros, playerid, params[])
- {
- #pragma unused params //Não estamos usando parametros no comando, por isso o pragma.
- new corda[70];
- for(new i, PP = GetMaxPlayers(); i < PP; i++)
- {
- if(!IsPlayerConnected(PP)) continue; //Caso o player não esteja conectado ele dará continuidade no loop
- if(ProgressaoInfo[i][Membro] == ProgressaoInfo[playerid][Membro]) //Caso a org do player [i] for igual a org do player [playerid] Executará o que vem abaixo.
- {
- new nome[MAX_PLAYER_NAME]; //Criará a variável que acumulará o nome do player membro da org.
- GetPlayerName(playerid, nome, sizeof(nome)); //Pegará o nome do player membro da org pra acumular na variável acima.
- format(corda, sizeof(corda), "%s membro da org %s cargo %d\n", nome, Orgnome[ProgressaoInfo[i][Membro]], ProgressaoInfo[i][Cargo]); //Formatará a string corda com o nome, cargo e nome da org pertencente.
- strcat(Texto, corda, 70);
- }
- }
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Lista de membros online", Texto, "OK", ""); //Mostratá ao player o dialog com a lista de membros.
- strdel(Texto, 0, sizeof(Texto)); //Deletará os dados da string pra que ela possa ser reutilizada e evitando um 'bug' que repete as mensagens.
- return true;
- }
- cmd(equipar, playerid, params[])
- {
- #pragma unused params //Não estamos usando parametros no comando, por isso o pragma.
- if(ProgressaoInfo[playerid][Membro] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 1 = Assassinos
- {
- ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
- GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
- GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
- GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
- SendClientMessage(playerid, C_Assassinos, "Você foi equipado");
- return true;
- }
- else if(ProgressaoInfo[playerid][Membro] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 2 = Aeronautica
- {
- ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
- GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
- GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
- GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
- SendClientMessage(playerid, C_Aeronautica, "Você foi equipado");
- return true;
- }
- else if(ProgressaoInfo[playerid][Membro] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 3 = Drifters
- {
- ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
- GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
- GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
- GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
- SendClientMessage(playerid, C_Drifters, "Você foi equipado");
- return true;
- }
- else if(ProgressaoInfo[playerid][Membro] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, Float:X, Float:Y, Float:Z)) //No X, Y e Z as coordenadas do local de equipe da org 4 = Policia Federal
- {
- ResetPlayerWeapons(playerid); //Tirará as armas do player evitando que ele se equipe várias vezes pra conseguir munição infinita.
- GivePlayerWeapon(playerid, 31, 500); //Lhe equipará com uma M4 e 500 balas.
- GivePlayerWeapon(playerid, 24, 300); //Lhe equipará com uma Eagle e 300 balas.
- GivePlayerWeapon(playerid, 25, 250); //Lhe equipará com uma Shotgun e 250 balas.
- SendClientMessage(playerid, C_PFederal, "Você foi equipado");
- return true;
- }
- return true;
- }
- cmd(chatorg, playerid, params[])
- {
- //Usaremos parâmetros então não precisaremos do pragma.
- new corda[128];
- if(sscanf(params, "s[128]", corda)) return SendClientMessage(playerid, GetPlayerColor(playerid), "Uso correto: /ChatOrg [Mensagem]");
- if(ProgressaoInfo[playerid][Membro] == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "Civis não tem chat próprio"); //Caso o player tente utilizar chat sendo civil.
- new nome[MAX_PLAYER_NAME]; //Criamos a variável que acumulará o nome do player que está mandando a mensagem à org.
- GetPlayerName(playerid, nome, sizeof(nome)); //Getamos o nome do player e acoplamos à variável criada acima.
- format(Texto, 128, "%s[%d] diz: %s", nome, ProgressaoInfo[playerid][Cargo], corda); //Lembra da variável global chamada de Texto que criamos? Reutilizaremos ela para armazenar o texto que será mandado aos membros da org. Junto com o mandante e seu cargo.
- for(new PP, Progressao = GetMaxPlayers(); PP < Progressao; PP++)
- {
- if(!IsPlayerConnected(PP)) continue; //Caso o player do loop não esteja conectado ele dará continuidade no loop sem executar o que está abaixo.
- if(ProgressaoInfo[PP][Membro] == ProgressaoInfo[playerid][Membro]) //Verificará se o player no Loop é da mesma organização do player que mandou a mensagem à org.
- {
- SendClientMessage(PP, GetPlayerColor(playerid), Texto); //Mandará a mensagem ao player no loop com a cor do player que mandou que lógicamente será a cor da org dele.
- }
- }
- return true;
- }
- cmd(convidar, playerid, params[])
- {
- new PlayerB, nome[MAX_PLAYER_NAME]; //Criará as variáveis PlayerB que acumulará o ID do player convidado e nome que acumulará o nome de dois players(Um de cada vez, claro).
- if(sscanf(params, "d", PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Uso correto: /convidar [id]"); //Caso o player não digite o comando completo retornará à esta mensagem.
- if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não está online"); //Caso o jogador convidado não esteja online retornará à esta mensagem.
- GetPlayerName(PlayerB, nome, sizeof(nome)); //Pegará o nome do player convidado para usar ao formatar a variável Texto.
- format(Texto, 70, "Você convidou %s para sua organização", nome); //Formatará a variável texto com a mensagem e o nome do convidante.
- SendClientMessage(playerid, GetPlayerColor(playerid), Texto); //Mandará a mensagem ao convidante informando-o que ele convidou um player.
- GetPlayerName(playerid, nome, sizeof(nome)); //Pegará o nome do player convidante para usar ao formatar a variável Texto
- format(Texto, 128, "%s está lhe convidando para fazer parte da organização: %s \nDeseja aceitar?", nome, Nomeorgs[ProgressaoInfo[playerid][Membro]]); //Formatará a variável Texto com o nome do player convidante e o nome da organização
- ShowPlayerDialog(PlayerB, 100, DIALOG_STYLE_MSGBOX, "Convite para organização", Texto, "Sim", "Não"); //Mostrará ao player convidado o dialog de aceitação da org.
- SetPVarInt(PlayerB, "OrgConvidado", ProgressaoInfo[playerid][Membro]); //Setará a PVar do player convidado com o id da org que ele está sendo convidado, caso aceite, será setado.
- return true;
- }
- cmd(promover, playerid, params[])
- {
- new PlayerB, cargo;
- if(sscanf(params, "dd", PlayerB, Cargo)) return SendClientMessage(playerid, 0x1E90FF99, "Uso correto: /Promover [id] [cargo]");
- if(ProgressaoInfo[playerid][Cargo] != 10) return SendClientMessage(playerid, 0x1E90FF99, "Você não é líder");
- if(ProgressaoInfo[PlayerB][Membro] != ProgressaoInfo[playerid][Membro]) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não é da mesma organização que você.");
- ProgressaoInfo[playerid][Cargo] = cargo;
- return true;
- }
- cmd(demitir, playerid, params[])
- {
- new PlayerB;
- if(sscanf(params, "d", PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Uso correto: /Demitir [id]");
- if(!IsPlayerConnected(PlayerB)) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não está online");
- if(ProgressaoInfo[playerid][Membro] != ProgressaoInfo[PlayerB][Membro]) return SendClientMessage(playerid, 0x1E90FF99, "Este jogador não é da sua organização");
- if(ProgressaoInfo[playerid][Cargo] != 10) return SendClientMessage(playerid, 0x1E90FF99, "Você não é líder da organização");
- ProgressaoInfo[PlayerB][Membro] = 0; //Tornará o player demitido um civil novamente.
- ProgressaoInfo[PlayerB][Cargo] = 0; //Atribuirá o cargo 0 ao player demitido, afinal, agora ele não pertence à org alguma.
- SendClientMessage(PlayerB, C_Civil, "Você foi demitido");
- SetPlayerColor(playerid, C_Civil);
- SendClientMessage(playerid, 0x1E90FF99, "Jogador demitido");
- return true;
- }
- CMD:creditos(playerid, params[])
- {
- MEGAString[0] = EOS;
- strcat(MEGAString, "{33CCFF}| -------------------------------- Creditos do servidor -------------------------------- |\n\n\n");
- strcat(MEGAString, "{33CCFF}• Raayzeck & Fórum SA-MP:\n");
- strcat(MEGAString, "{FFFFFF} Por sistemas únicos.\n\n");
- strcat(MEGAString, "{33CCFF}• PeterLinkson & Fórum SA-MP:\n");
- strcat(MEGAString, "{FFFFFF} Por ajudar em diversos scripts.\n\n");
- strcat(MEGAString, "{33CCFF}• PeterLinkson:\n");
- strcat(MEGAString, "{FFFFFF} Por sempre me apoiar e me incentivar e também pela criação da base desta gamemode.\n\n");
- strcat(MEGAString, "{33CCFF}• Fórum SA-MP:\n");
- strcat(MEGAString, "{FFFFFF} Por ajudar em alguns bugs do servidor.\n\n");
- strcat(MEGAString, "{33CCFF}| -------------------------------- Creditos do servidor -------------------------------- |\n\n");
- ShowPlayerDialog(playerid, 999, DIALOG_STYLE_MSGBOX, "Creditos", MEGAString, "BPW", "");
- return true;
- }
- CMD:chatkill(playerid)
- {
- if(ChatKill[playerid]){
- ChatKill[playerid] = false;
- SendClientMessage(playerid, COLOR_GREY, "Você desligou o chat kill!");
- }
- else{
- ChatKill[playerid] = true;
- SendClientMessage(playerid, COLOR_GREY, "Você ligou o chat kill!");
- }
- return 1;
- }
- CMD:mudarsenha(playerid,params[])
- {
- new KinG1[48 + 42];
- if(isnull(params)) return SendClientMessage(playerid, -1, "[ERRO] Use: /MudarSenha [nova senha]");
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- DOF2_SetString(Conta, "Password", params);
- DOF2_SaveFile();
- format(KinG1, sizeof(KinG1), "[SERVER] Sua nova senha é {12FF05}'%s'",params);
- SendClientMessage(playerid, -1, KinG1);
- return 1;
- }
- CMD:setadming(playerid, params[])
- {
- new id;
- if(sscanf(params, "ud", id, Player[id][pAdmin])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetAdming [ID] [level-admin]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
- if(Player[id][pAdmin] > 3) return SendClientMessage(playerid,-1,"[ ERROR ] level-admin [0-3]");
- SendClientMessage(id,-1,"[ ADMIN ] you're an admin now!");
- return 1;
- }
- CMD:setskin(playerid ,params[])
- {
- if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins!");
- new id,KinG1[38 + 4];
- if(sscanf(params, "ud", id, Player[id][pSkin])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetSkin [ID] [skin]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
- if(Player[id][pSkin] > 311) return SendClientMessage(playerid,-1,"[ ERROR ] skin validas [0-311]");
- format(KinG1, sizeof(KinG1), "AdmCmd: sua skin foi setada para %d", Player[id][pSkin]);
- SendClientMessage(id, -1, KinG1);
- return SetPlayerSkin(id,Player[id][pSkin]);
- }
- CMD:setscore(playerid ,params[])
- {
- if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins");
- new id,KinG2[32 + 11];
- if(sscanf(params, "ud", id, Player[id][pScore])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetScore [ID] [score]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
- format(KinG2, sizeof(KinG2), "[ SERVER ] You received %d Score", Player[id][pScore]);
- SendClientMessage(id, -1, KinG2);
- return SetPlayerScore(id,Player[id][pScore]);
- }
- CMD:setmoney(playerid, params[])
- {
- if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins");
- new id,KinG1[28 + 11];
- if(sscanf(params, "ud", id, Player[id][pMoney])) return SendClientMessage(playerid,-1,"[ ERROR ] Use: /SetMoney [ID] [money]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"[ ERROR ] O Jogador não está conectado");
- format(KinG1, sizeof(KinG1), "[ SERVER ] You received $ %d", Player[id][pMoney]);
- SendClientMessage(id, -1, KinG1);
- DarMoney(id,Player[id][pMoney]);
- return 1;
- }
- CMD:limparchat(playerid)
- {
- if(Player[playerid][pAdmin] == 0) return SendClientMessage(playerid, -1, "[ ERROR ] Comando somente para admins");
- for(new i = 0; i < 50; i++) SendClientMessageToAll(-1,"");
- return 1;
- }
- public OnPlayerCommandReceived(playerid, cmdtext[])
- {
- if(Player[playerid][pLogado] == false) return SendClientMessage(playerid, -1, "[ ERROR ] Você não está logado!"),false;
- return 1;
- }
- public OnPlayerCommandPerformed(playerid, cmdtext[], success)
- {
- if(!success) return SendClientMessage(playerid, -1, "[ ERROR ] Comando invalido");
- return 1;
- }
- CMD:ajuda(playerid)
- {
- new ajudaz[500];
- strcat(ajudaz,"Comando para jogadores\n");
- strcat(ajudaz,"/ajuda, /MudarSenha, /MudarNick\n\n");
- strcat(ajudaz,"Comando para Admins\n");
- strcat(ajudaz,"/SetSkin, /SetScore, /SetMoney, /LimparChat\n\n");
- return ShowPlayerDialog(playerid,7984, DIALOG_STYLE_MSGBOX, "commands",ajudaz, "Exit", "");
- }
- //=====================================================================================||
- CriarConta(playerid)
- {
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- DOF2_SetInt(Conta, "Admin", 0);
- DOF2_SetInt(Conta, "Skin", 98);
- DOF2_SetInt(Conta, "Money", 500);
- DOF2_SetInt(Conta, "Score", 0);
- DOF2_SetFloat(Conta, "PosX", 2069.8767);
- DOF2_SetFloat(Conta, "PosY", -1766.6870);
- DOF2_SetFloat(Conta, "PosZ", 13.5621);
- DOF2_SetFloat(Conta, "PosA", 90.0);
- DOF2_SetInt(Conta, "Interior", 0);
- DOF2_SetInt(Conta, "VW", 0);
- DOF2_SaveFile();
- }
- CarregarConta(playerid)
- {
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- Player[playerid][pAdmin] = DOF2_GetInt(Conta, "Admin");
- Player[playerid][pSkin] = DOF2_GetInt(Conta, "Skin");
- Player[playerid][pMoney] = DOF2_GetInt(Conta, "Money");
- Player[playerid][pScore] = DOF2_GetInt(Conta, "Score");
- Player[playerid][pPosX] = DOF2_GetInt(Conta, "PosX");
- Player[playerid][pPosY] = DOF2_GetInt(Conta, "PosY");
- Player[playerid][pPosZ] = DOF2_GetInt(Conta, "PosZ");
- Player[playerid][pPosA] = DOF2_GetInt(Conta, "PosA");
- Player[playerid][pInterior] = DOF2_GetInt(Conta, "Interior");
- Player[playerid][pVW] = DOF2_GetInt(Conta, "VW");
- Player[playerid][pLogado]=true;
- SetPlayerScore(playerid, Player[playerid][pScore]);
- DarMoney(playerid, Player[playerid][pMoney]);
- SetPlayerInterior(playerid, Player[playerid][pInterior]);
- SetPlayerVirtualWorld(playerid, Player[playerid][pVW]);
- SetSpawnInfo(playerid, -1, Player[playerid][pSkin], Player[playerid][pPosX], Player[playerid][pPosY], Player[playerid][pPosZ], Player[playerid][pPosA],0,0,0,0,0,0);
- SpawnPlayer(playerid);
- }
- SalvarConta(playerid)
- {
- format(Conta, sizeof(Conta), "Contas/%s.ini", Name(playerid));
- DOF2_SetInt(Conta, "Admin", Player[playerid][pAdmin]);
- DOF2_SetInt(Conta, "Skin", Player[playerid][pSkin]);
- DOF2_SetInt(Conta, "Money", Player[playerid][pMoney]);
- DOF2_SetInt(Conta, "Score", Player[playerid][pScore]);
- DOF2_SetFloat(Conta, "PosX", Player[playerid][pPosX]);
- DOF2_SetFloat(Conta, "PosY", Player[playerid][pPosY]);
- DOF2_SetFloat(Conta, "PosZ", Player[playerid][pPosZ]);
- DOF2_SetFloat(Conta, "PosA", Player[playerid][pPosA]);
- DOF2_SetInt(Conta, "Interior", GetPlayerInterior(playerid));
- DOF2_SetInt(Conta, "VW", GetPlayerVirtualWorld(playerid));
- DOF2_SaveFile();
- }
- Name(playerid)
- {
- new pNome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pNome, 24);
- return pNome;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement