Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ====[Á FAZER]====
- ARRUMAR OS SPAWNS NOVOS PARA OS ALIADOS!
- TEXTDRAW
- ENTRADA NOVA PARA DIGITAR /ESCOLHER
- ====[BUGS]======
- NENHUM ENCONTRADO!
- Feito por: Fábio Stralioti
- www.fabiostralioti.esy.es
- */
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <dof2>
- #define COR_AZUL 0x2641FEAA
- #define COR_ERRO 0xFF0000FF
- #define COR_VERDE 0x33AA33AA
- #define COR_AMARELO 0xFFFF00AA
- #define COR_LARANJA 0xFF8000FF
- #define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
- #define Ban(%0) SetTimerEx("Bana", 100, false, "i", %0)
- #define banido "Banidos\\%s.ini"
- #define ESCOLHA 1
- #define ALIADOS 2
- #define EIXO 3
- #define LOJA 4
- #define LOJAARMAS 5
- #define LOJAVEICULOS 6
- #define LOJAMUNICAO 7
- #define DIALOG_LOGAR 8
- #define DIALOG_REGISTRO 9
- #define VALOR 500
- #define TEMPO 30
- enum pInfo {
- pStaff,
- pNacao,
- pSenha[35],
- pSkin,
- pDinheiro,
- pScore
- };
- new Stralioti[MAX_PLAYERS][pInfo];
- new id;
- new Float:FX, Float:FY, Float:FZ;
- new Float:X, Float:Y, Float:Z, Float: Angle;
- new Erro[MAX_PLAYERS];
- main() {
- print("GameMode War Feito por: Fábio Stralioti");
- }
- public OnGameModeInit() {
- SetGameModeText("War[0.1]");
- AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
- DisableInteriorEnterExits();
- /* SPAWN ALIADOS */
- AddStaticVehicleEx(433,2828.7000000,927.4000200,11.3000000,0.0000000,95,10,15); //Barracks
- AddStaticVehicleEx(470,2811.2000000,929.0000000,10.9000000,0.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(470,2808.1001000,929.0000000,10.9000000,0.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(470,2804.6001000,929.0000000,10.9000000,0.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(500,2817.5000000,928.7000100,11.0000000,0.0000000,38,55,15); //Mesa
- AddStaticVehicleEx(433,2823.7000000,927.5000000,11.3000000,0.0000000,95,10,15); //Barracks
- AddStaticVehicleEx(433,2834.2000000,927.5000000,11.3000000,0.0000000,95,10,15); //Barracks
- AddStaticVehicleEx(500,2814.2002000,928.7998000,11.0000000,0.0000000,38,55,15); //Mesa
- AddStaticVehicleEx(500,2820.7000000,928.5999800,11.0000000,0.0000000,38,55,15); //Mesa
- AddStaticVehicleEx(468,2827.5000000,939.7000100,10.5000000,0.0000000,22,34,15); //Sanchez
- AddStaticVehicleEx(468,2833.5000000,940.5996100,10.5000000,0.0000000,22,34,15); //Sanchez
- AddStaticVehicleEx(468,2830.7002000,940.2998000,10.5000000,0.0000000,22,34,15); //Sanchez
- /* SPAWN EIXO */
- AddStaticVehicleEx(470,-2127.8999000,-113.6000000,35.4000000,0.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(470,-2131.3000000,-113.7000000,35.4000000,0.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(470,-2124.5000000,-113.7000000,35.4000000,0.0000000,95,10,15); //Patriot
- AddStaticVehicleEx(500,-2120.5000000,-114.5000000,35.5000000,0.0000000,115,46,15); //Mesa
- AddStaticVehicleEx(500,-2114.8000000,-114.7000000,35.5000000,0.0000000,115,46,15); //Mesa
- AddStaticVehicleEx(500,-2117.7002000,-114.5996100,35.5000000,0.0000000,115,46,15); //Mesa
- AddStaticVehicleEx(433,-2116.7000000,-129.8999900,35.9000000,272.0000000,95,10,15); //Barracks
- AddStaticVehicleEx(433,-2116.7000000,-125.1000000,35.9000000,272.0000000,95,10,15); //Barracks
- AddStaticVehicleEx(433,-2116.5000000,-135.3000000,35.9000000,272.0000000,95,10,15); //Barracks
- AddStaticVehicleEx(468,-2113.2000000,-141.6000100,35.1000000,274.0000000,132,4,15); //Sanchez
- AddStaticVehicleEx(468,-2113.3999000,-140.7000000,35.1000000,273.9990000,132,4,15); //Sanchez
- AddStaticVehicleEx(468,-2113.3000000,-142.3999900,35.1000000,273.9990000,132,4,15); //Sanchez
- /* PICKUP ALIADOS */
- CreatePickup(1239,1,2812.457031,893.352233,10.757797);
- Create3DTextLabel("Para se equipar\nAperte F", COR_AZUL,2812.457031,893.352233,10.757797,25.0,0);
- /* PICKUP EIXO */
- CreatePickup(1239,1,-2135.262207,-137.921279,35.320312);
- Create3DTextLabel("Para se equipar\nAperte F", COR_AMARELO,-2135.262207,-137.921279,35.320312,25.0,0);
- /* PICKUP LOJAS*/
- CreatePickup(1252,1,-1989.306762,1040.454956,55.726562);
- Create3DTextLabel("Para abrir a loja\nAperte F", COR_AZUL,-1989.306762,1040.454956,55.726562,25.0,0);
- SetTimer("payday", TEMPO * 60000, true);
- return 1;
- }
- public OnGameModeExit() {
- DOF2_Exit();
- return 1;
- }
- public OnPlayerConnect(playerid) {
- SendClientMessage(playerid, COR_AZUL,"Bem Vindo ao servidor War, Divirta-se");
- new admin[34];
- format(admin, sizeof(admin), "Jogadores/%s.ini", nome(playerid));
- new arquivo[40];
- format(arquivo, 40, "Jogadores/%s.ini", nome(playerid));
- if(DOF2_FileExists(arquivo)) {
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "fsWAR - Login", "Status da conta : Registrada\n digite sua senha para logar!\nSe errar 5 vezes sua conta será banida!", "Logar", "Cancelar");
- }
- else {
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "fsWAR - Registro", "Status da conta : Não Registrada\n digite uma senha para se registrar!", "Registrar", "Cancelar");
- }
- carregararmas(playerid);
- Stralioti[playerid][pNacao] = 0;
- SetPlayerMapIcon(playerid,0,-1989.540527,1040.333007,55.726562,6,0);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- new admin[34];
- format(admin, sizeof(admin), "Jogadores/%s.ini", nome(playerid));
- if (!DOF2_FileExists(admin)) {
- DOF2_CreateFile(admin);
- DOF2_SetInt(admin, "Level", Stralioti[playerid][pStaff]);
- DOF2_SaveFile();
- }
- else {
- DOF2_SetInt(admin, "Level", Stralioti[playerid][pStaff]);
- DOF2_SaveFile();
- }
- new arquivo[40];
- format(arquivo, 40, "Jogadores/%s.ini", nome(playerid));
- if(DOF2_FileExists(arquivo)) {
- DOF2_SetInt(arquivo, "Senha", Stralioti[playerid][pSenha]);
- DOF2_SetInt(arquivo, "Skin", Stralioti[playerid][pSkin]);
- Stralioti[playerid][pDinheiro] = GetPlayerMoney(playerid);
- DOF2_SetInt(arquivo, "Dinheiro", Stralioti[playerid][pDinheiro]);
- Stralioti[playerid][pScore] = GetPlayerScore(playerid);
- DOF2_SetInt(arquivo, "Score", Stralioti[playerid][pScore]);
- DOF2_SaveFile();
- }
- salvararmas(playerid);
- Stralioti[playerid][pNacao] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- SetPlayerSkin(playerid, Stralioti[playerid][pSkin]);
- if(Stralioti[playerid][pNacao] == 1) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,2375.8696,-1910.2778,13.3828);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* Reino Unido /\*/
- if(Stralioti[playerid][pNacao] == 2) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,2070.6306,-1601.3375,13.5379);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* França /\ */
- if(Stralioti[playerid][pNacao] == 3) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,1648.1343,-1447.4480,13.5469);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* União Sovietica /\ */
- if(Stralioti[playerid][pNacao] == 4) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,1471.4244,-1148.5503,24.4108);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* EUA /\ */
- if(Stralioti[playerid][pNacao] == 5) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,1339.2661,-918.9778,35.7952);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* China /\ */
- if(Stralioti[playerid][pNacao] == 6) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,-1523.6552,879.1005,7.1875);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* BR /\ */
- /* EIXO \/ */
- if(Stralioti[playerid][pNacao] == 7) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,1956.2843,1369.1185,9.2578);
- SetPlayerColor(playerid, COR_AZUL);
- }
- /* Alemanha */
- if(Stralioti[playerid][pNacao] == 8) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AMARELO);
- }
- /* Japão */
- if(Stralioti[playerid][pNacao] == 9) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,2507.6912,2410.8088,10.6719);
- SetPlayerColor(playerid, COR_AMARELO);
- }
- /* Itália */
- if(Stralioti[playerid][pNacao] == 10) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,2358.9517,2575.5854,10.8203);
- SetPlayerColor(playerid, COR_AMARELO);
- }
- /* Romênia */
- if(Stralioti[playerid][pNacao] == 11) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,1789.8973,2468.5222,7.3221);
- SetPlayerColor(playerid, COR_AMARELO);
- }
- /* Tailândia */
- if(Stralioti[playerid][pNacao] == 12) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,1734.5414,1789.8710,10.8203);
- SetPlayerColor(playerid, COR_AMARELO);
- }
- /* Hungria */
- if(Stralioti[playerid][pNacao] == 13) {
- TogglePlayerControllable(playerid, 1);
- SetPlayerPos(playerid,-2023.5206, 156.3955, 28.8359);
- SetPlayerColor(playerid, COR_AMARELO);
- }
- /* Bulgaria */
- return 1;
- }
- forward MensagemAdmins(const fstralioti[]);
- public MensagemAdmins(const fstralioti[]) {
- for(new i; i <GetPlayerPoolSize() + 1; i++) {
- if(IsPlayerConnected(i) == 1) {
- if(Stralioti[i][pStaff] >= 1) {
- SendClientMessage(i, COR_VERDE, fstralioti);
- }
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason) {
- new arma[32], stralioti[100];
- GetWeaponName(reason, arma, sizeof(arma));
- format(stralioti, sizeof(stralioti), "%s matou o %s com a arma: %s", nome(playerid), nome(killerid), arma);
- SendClientMessageToAll(COR_LARANJA, stralioti);
- return 1;
- }
- payday();
- public payday() {
- new hora, minuto, segundo, playerid;
- gettime(hora, minuto, segundo);
- if(!minuto) {
- for(new i; i <GetPlayerPoolSize() + 1; i++) { if(IsPlayerConnected(i)) {
- GivePlayerMoney(i, VALOR);
- SetPlayerScore(i, GetPlayerScore(i) + 1);
- new arquivo[40];
- format(arquivo, 40, "Jogadores/%s.ini", nome(playerid));
- if(DOF2_FileExists(arquivo)) {
- SendClientMessageToAll(COR_LARANJA, "Você recebeu o PAYDAY!");
- DOF2_SetInt(arquivo, "Dinheiro", Stralioti[playerid][pDinheiro]);
- Stralioti[playerid][pScore] = GetPlayerScore(playerid);
- DOF2_SetInt(arquivo, "Score", Stralioti[playerid][pScore]);
- DOF2_SaveFile();
- }
- }
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
- new arquivo[40];
- format(arquivo, 40, "Jogadores/%s.ini", nome(playerid));
- if(dialogid == DIALOG_REGISTRO) {
- if(!strval(inputtext)) {
- ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_PASSWORD, "fsWAR - Registro", "Status da conta : Não Registrada\n digite uma senha para se registrar!", "Registrar", "Cancelar");
- SendClientMessage(playerid, COR_ERRO, "Erro, Digite apenas números para se registrar.");
- return 1;
- }
- if(!response) {
- Kick(playerid);
- return 1;
- }
- else {
- Stralioti[playerid][pSenha] = strval(inputtext);
- DOF2_CreateFile(arquivo);
- DOF2_SetInt(arquivo, "Senha", Stralioti[playerid][pSenha]);
- DOF2_SetInt(arquivo, "Skin", 0);
- DOF2_SaveFile();
- SendClientMessage(playerid, COR_ERRO, "Sua Conta foi Registrada, Agora digite sua senha novamente para logar!");
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "fsWAR - Login", "Status da conta : Registrada\n digite sua senha para logar!\nSe errar 5 vezes sua conta será banida!", "Logar", "Cancelar");
- }
- }
- if(dialogid == DIALOG_LOGAR) {
- if(!strval(inputtext)){
- SendClientMessage(playerid, COR_ERRO, "Erro, Digite apenas números para se logar.");
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "fsWAR - Login", "Status da conta : Registrada\n digite sua senha para logar!\nSe errar 5 vezes sua conta será banida!", "Logar", "Cancelar");
- return 1;
- }
- if(!response) {
- Kick(playerid);
- return 1;
- }
- else {
- Stralioti[playerid][pSenha] = DOF2_GetInt(arquivo, "Senha");
- if(strval(inputtext) == Stralioti[playerid][pSenha]) {
- new stralioti[100];
- Stralioti[playerid][pSkin] = DOF2_GetInt(arquivo, "Skin");
- SetPlayerSkin(playerid, Stralioti[playerid][pSkin]);
- Stralioti[playerid][pDinheiro] = DOF2_GetInt(stralioti, "Dinheiro");
- GivePlayerMoney(playerid, Stralioti[playerid][pDinheiro]);
- Stralioti[playerid][pScore] = DOF2_GetInt(stralioti, "Score");
- SetPlayerScore(playerid, Stralioti[playerid][pScore]);
- SpawnPlayer(playerid);
- }
- else {
- ShowPlayerDialog(playerid, DIALOG_LOGAR, DIALOG_STYLE_PASSWORD, "fsWAR - Login", "Status da conta : Registrada\n digite sua senha para logar!\nSe errar 5 vezes sua conta será banida!", "Logar", "Cancelar");
- Erro[playerid]++;
- if(Erro[playerid] == 5) {
- SendClientMessage(playerid, COR_ERRO, "Sua conta está banida por errar 5 vezes a sua senha, contacte o Admin para retirar seu Ban!");
- Ban(playerid);
- return 1;
- }
- }
- }
- }
- if(dialogid == ESCOLHA) {
- if(response) {
- if(listitem == 0) {
- ShowPlayerDialog(playerid, ALIADOS, DIALOG_STYLE_LIST, "Guerra", "Reino Unido\nFrança\nUnião Soviética\nEstados Unidos\nChina\nBrasil", "Escolher", "Sair");
- }
- if(listitem == 1) {
- ShowPlayerDialog(playerid, EIXO, DIALOG_STYLE_LIST, "Guerra", "Alemanha\nJapão\nItália\nRomênia\nTailândia\nHungria\nBulgária", "Escolher", "Sair");
- }
- }
- }
- if(dialogid == ALIADOS)
- {
- if(response)
- {
- if(listitem == 0) {
- Stralioti[playerid][pNacao] = 1;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AZUL);
- SendClientMessage(playerid, COR_AZUL,"Você escolheu o Reino Unido");
- }
- if(listitem == 1) {
- Stralioti[playerid][pNacao] = 2;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AZUL);
- SendClientMessage(playerid, COR_AZUL,"Você escolheu a França");
- }
- if(listitem == 2) {
- Stralioti[playerid][pNacao] = 3;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AZUL);
- SendClientMessage(playerid, COR_AZUL,"Você escolheu a União Sovietica");
- }
- if(listitem == 3) {
- Stralioti[playerid][pNacao] = 4;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AZUL);
- SendClientMessage(playerid, COR_AZUL,"Você escolheu o Estados Unidos");
- }
- if(listitem == 4) {
- Stralioti[playerid][pNacao] = 5;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AZUL);
- SendClientMessage(playerid, COR_AZUL,"Você escolheu a China");
- }
- if(listitem == 5) {
- Stralioti[playerid][pNacao] = 6;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AZUL);
- SendClientMessage(playerid, COR_AZUL,"Você escolheu o Brasil");
- }
- }
- }
- if(dialogid == EIXO)
- {
- if(response)
- {
- if(listitem == 0) {
- Stralioti[playerid][pNacao] = 7;
- SetPlayerPos(playerid,2156.7830,2209.8657,10.8203);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu a Alemanha");
- }
- if(listitem == 1) {
- Stralioti[playerid][pNacao] = 8;
- SetPlayerPos(playerid,2507.6912,2410.8088,10.6719);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu o Japão");
- }
- if(listitem == 2) {
- Stralioti[playerid][pNacao] = 9;
- SetPlayerPos(playerid,2358.9517,2575.5854,10.8203);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu a Itália");
- }
- if(listitem == 3) {
- Stralioti[playerid][pNacao] = 10;
- SetPlayerPos(playerid,1789.8973,2468.5222,7.3221);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu a Romênia");
- }
- if(listitem == 4) {
- Stralioti[playerid][pNacao] = 11;
- SetPlayerPos(playerid,1734.5414,1789.8710,10.8203);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu a Tailândia");
- }
- if(listitem == 5) {
- Stralioti[playerid][pNacao] = 12;
- SetPlayerPos(playerid,-2023.5206, 156.3955, 28.8359);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu a Hungria");
- }
- if(listitem == 6) {
- Stralioti[playerid][pNacao] = 13;
- SetPlayerPos(playerid,-1523.6552,879.1005,7.1875);
- SetPlayerColor(playerid, COR_AMARELO);
- SendClientMessage(playerid, COR_AMARELO,"Você escolheu a Bulgária");
- }
- }
- }
- if(dialogid == LOJA) {
- if(response) {
- if(listitem == 0) {
- ShowPlayerDialog(playerid, LOJAARMAS, DIALOG_STYLE_TABLIST_HEADERS, "ARMAS",
- "Armas\tValor\tMunição\n\
- Granada\tR$500\t10\n\
- AK-K7\tR$800\t100\n\
- RPG\tR$1000\t10\n\
- HS Rocket\tR$1500\t10\n\
- Minigun\tR$2500\t100\n\
- Satchel Charge\tR$300\t5",
- "Escolher", "Sair");
- }
- if(listitem == 1) {
- ShowPlayerDialog(playerid, LOJAVEICULOS, DIALOG_STYLE_TABLIST_HEADERS, "VEÍCULOS",
- "Veículo\tValor\n\
- Hydra\tR$5000\n\
- Cargobob\tR$6000\n\
- Hunter\tR$6500\n\
- Rhino\tR$7000",
- "Escolher", "Sair");
- }
- if(listitem == 2) {
- ShowPlayerDialog(playerid, LOJAMUNICAO, DIALOG_STYLE_TABLIST_HEADERS, "MUNIÇÃO",
- "Munição\tValor\tQuantidade\n\
- Granada\tR$100\t10\n\
- AK-K7\tR$200\t300\n\
- RPG\tR$450\t30\n\
- HS Rocket\tR$650\t30\n\
- Minigun\tR$1000\t300\n\
- Satchel Charge\tR$50\t10",
- "Escolher", "Sair");
- }
- }
- }
- if(dialogid == LOJAARMAS) {
- if(response) {
- if(listitem == 0) {
- if(GetPlayerMoney(playerid) >= 500) {
- GivePlayerWeapon(playerid, 16, 10);
- GivePlayerMoney(playerid, -500);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 1) {
- if(GetPlayerMoney(playerid) >= 800) {
- GivePlayerWeapon(playerid, 30, 100);
- GivePlayerMoney(playerid, -800);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 2) {
- if(GetPlayerMoney(playerid) >= 1000) {
- GivePlayerWeapon(playerid, 35, 10);
- GivePlayerMoney(playerid, -1000);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 3) {
- if(GetPlayerMoney(playerid) >= 1500) {
- GivePlayerWeapon(playerid, 36, 10);
- GivePlayerMoney(playerid, -1500);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 4) {
- if(GetPlayerMoney(playerid) >= 2500) {
- GivePlayerWeapon(playerid, 38, 100);
- GivePlayerMoney(playerid, -2500);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 5) {
- if(GetPlayerMoney(playerid) >= 300) {
- GivePlayerWeapon(playerid, 39, 10);
- GivePlayerWeapon(playerid, 40, 10);
- GivePlayerMoney(playerid, -300);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- }
- }
- if(dialogid == LOJAVEICULOS) {
- if(response) {
- if(listitem == 0) {
- if(GetPlayerMoney(playerid) >= 5000) {
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- CreateVehicle(520, X+5, Y, Z+1, Angle, random(100), random(100), -1);
- SendClientMessage(playerid, -1,"Você comprou um Hydra por R$ 5000");
- GivePlayerMoney(playerid, -5000);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 1) {
- if(GetPlayerMoney(playerid) >= 6000) {
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- CreateVehicle(548, X+5, Y, Z+1, Angle, random(100), random(100), -1);
- SendClientMessage(playerid, -1,"Você comprou um CargoBob por R$ 6000");
- GivePlayerMoney(playerid, -6000);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 2) {
- if(GetPlayerMoney(playerid) >= 6500) {
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- CreateVehicle(425, X+5, Y, Z+1, Angle, random(100), random(100), -1);
- SendClientMessage(playerid, -1,"Você comprou um Hunter por R$ 6500");
- GivePlayerMoney(playerid, -6500);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 3) {
- if(GetPlayerMoney(playerid) >= 7000) {
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, Angle);
- CreateVehicle(432, X+5, Y, Z+1, Angle, random(100), random(100), -1);
- SendClientMessage(playerid, -1,"Você comprou um Rhino por R$ 7000");
- GivePlayerMoney(playerid, -7000);
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- }
- }
- if(dialogid == LOJAMUNICAO) {
- if(response) {
- if(listitem == 0) {
- if(GetPlayerMoney(playerid) >= 100) {
- SetPlayerAmmo(playerid, 16, 10);
- GivePlayerMoney(playerid, -100);
- SendClientMessage(playerid, COR_VERDE,"Você comprou 10 munições para Granada");
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 1) {
- if(GetPlayerMoney(playerid) >= 200) {
- SetPlayerAmmo(playerid, 30, 300);
- GivePlayerMoney(playerid, -200);
- SendClientMessage(playerid, COR_VERDE,"Você comprou 300 munições para AK-K7");
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 2) {
- if(GetPlayerMoney(playerid) >= 450) {
- SetPlayerAmmo(playerid, 35, 30);
- GivePlayerMoney(playerid, -450);
- SendClientMessage(playerid, COR_VERDE,"Você comprou 30 munições para RPG");
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 3) {
- if(GetPlayerMoney(playerid) >= 650) {
- SetPlayerAmmo(playerid, 36, 30);
- GivePlayerMoney(playerid, -650);
- SendClientMessage(playerid, COR_VERDE,"Você comprou 30 munições para HS-ROCKET");
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 4) {
- if(GetPlayerMoney(playerid) >= 1000) {
- SetPlayerAmmo(playerid, 38, 300);
- GivePlayerMoney(playerid, -1000);
- SendClientMessage(playerid, COR_VERDE,"Você comprou 300 munições para Minigun");
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- if(listitem == 5) {
- if(GetPlayerMoney(playerid) >= 50) {
- SetPlayerAmmo(playerid, 39, 10);
- SetPlayerAmmo(playerid, 40, 10);
- GivePlayerMoney(playerid, -50);
- SendClientMessage(playerid, COR_VERDE,"Você comprou 10 munições para Satchel Charge");
- return 1;
- }
- else {
- return SendClientMessage(playerid, COR_ERRO,"Você não tem dinheiro suficiente!");
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
- if ((newkeys == KEY_SECONDARY_ATTACK)) {
- cmd_equipar(playerid);
- cmd_equipar1(playerid);
- cmd_lojinha(playerid);
- }
- return 1;
- }
- CMD:setstaff(playerid, params[]) {
- new stralioti[128];
- new level;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_ERRO, "Você não está logado na RCON");
- if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COR_ERRO,"Use: /setstaff [id] [level]");
- if(level < 0 || level > 5) return SendClientMessage(playerid, COR_ERRO,"Level inválido de 1 á 5");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "Este jogador não está online!");
- format(stralioti, sizeof(stralioti),"O %s setou o %s de Administrador Level %d", nome(playerid), nome(id), level);
- MensagemAdmins(stralioti);
- format(stralioti, sizeof(stralioti),"O %s setou você de Administrador Level %d", nome(playerid), level);
- SendClientMessage(id, COR_VERDE, stralioti);
- Stralioti[id][pStaff] = level;
- return 1;
- }
- CMD:vidatodos(playerid) {
- new stralioti[100];
- if(Stralioti[playerid][pStaff] > 1) {
- for(new i; i <GetPlayerPoolSize() + 1; i++) {
- SetPlayerHealth(i, 100);
- }
- format(stralioti, sizeof(stralioti),"O Administrador %s deu vida para todos do servidor!", nome(playerid));
- SendClientMessageToAll(COR_VERDE, stralioti); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:coletetodos(playerid) {
- new stralioti[100];
- if(Stralioti[playerid][pStaff] >= 1) {
- for(new i; i <GetPlayerPoolSize() + 1; i++) {
- SetPlayerArmour(i, 100);
- }
- format(stralioti, sizeof(stralioti),"O Administrador %s deu colete para todos do servidor!", nome(playerid));
- SendClientMessageToAll(COR_VERDE, stralioti); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:spawnaliados(playerid) {
- SetPlayerPos(playerid, 2810.9599609375, 950.88635253906, 16.699615478516);
- return 1;
- }
- CMD:spawneixo(playerid) {
- SetPlayerPos(playerid, -2066.2482910156, -208.53169250488, 36.62845993042);
- return 1;
- }
- CMD:vida(playerid, params[]) {
- new qntd, stralioti[100];
- if(Stralioti[playerid][pStaff] >= 1) {
- if(sscanf(params, "ud", id, qntd)) return SendClientMessage(playerid, COR_ERRO,"Use: /vida [id] [quantidade]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO,"Este jogador não se encontra online");
- if(qntd < 0 || qntd > 100) return SendClientMessage(playerid, COR_ERRO,"Quantidade inválida, de 0 á 100");
- format(stralioti, sizeof(stralioti),"O Administrador %s setou a vida do %s para: %d", nome(playerid), nome(id), qntd);
- SendClientMessageToAll(COR_VERDE, stralioti);
- SetPlayerHealth(id, qntd); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:colete(playerid, params[]) {
- new qntd, stralioti[100];
- if(Stralioti[playerid][pStaff] >= 1) {
- if(sscanf(params, "ud", id, qntd)) return SendClientMessage(playerid, COR_ERRO,"Use: /colete [id] [quantidade]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO,"Este jogador não se encontra online");
- if(qntd < 0 || qntd > 100) return SendClientMessage(playerid, COR_ERRO,"Quantidade inválida, de 0 á 100");
- format(stralioti, sizeof(stralioti),"O Administrador %s setou o colete do %s para: %d", nome(playerid), nome(id), qntd);
- SendClientMessageToAll(COR_VERDE, stralioti);
- SetPlayerArmour(id, qntd); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:tr(playerid, params[])
- return cmd_trazer(playerid, params);
- CMD:trazer(playerid, params[]) {
- new stralioti[100];
- if(Stralioti[playerid][pStaff] >= 1) {
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COR_ERRO,"Use: /trazer [id]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO,"Este jogador não se encontra online");
- GetPlayerPos(playerid, FX, FY, FZ);
- SetPlayerPos(id, FX, FY, FZ);
- format(stralioti, sizeof(stralioti),"O Administrador %s puxou o %s até ele!", nome(playerid), nome(id));
- SendClientMessageToAll(COR_VERDE, stralioti); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:ir(playerid, params[]) {
- new stralioti[100];
- if(Stralioti[playerid][pStaff] >= 1){
- if(sscanf(params, "u", id)) return SendClientMessage(playerid, COR_ERRO,"Use: /trazer [id]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO,"Este jogador não se encontra online");
- GetPlayerPos(id, FX, FY, FZ);
- SetPlayerPos(playerid, FX, FY, FZ);
- format(stralioti, sizeof(stralioti),"O Administrador %s foi até o %s!", nome(playerid), nome(id));
- SendClientMessageToAll(COR_VERDE, stralioti); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:kick(playerid, params[]) {
- new motivo, stralioti[120];
- if(Stralioti[playerid][pStaff] >= 1) {
- if(sscanf(params, "us", id, motivo)) return SendClientMessage(playerid, COR_ERRO,"Use: /kick [id] [motivo]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO,"Este jogador não se encontra online");
- format(stralioti, sizeof(stralioti),"O Administrador %s kikou o %s motivo: %s", nome(playerid), nome(id), motivo);
- SendClientMessageToAll(COR_ERRO, stralioti);
- Kick(id); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:ban(playerid, params[]) {
- new motivo, stralioti[120];
- if(Stralioti[playerid][pStaff] >= 1) {
- if(sscanf(params, "us", id, motivo)) return SendClientMessage(playerid, COR_ERRO,"Use: /ban [id] [motivo]");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO,"Este jogador não se encontra online");
- format(stralioti, sizeof(stralioti), "O Administrador %s baniu o %s motivo: %s", nome(playerid), nome(id), motivo);
- format(stralioti,sizeof(stralioti),banido,nome(id));
- SendClientMessageToAll(COR_ERRO, stralioti);
- DOF2_CreateFile(stralioti);
- Ban(id); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:escolher(playerid) {
- ShowPlayerDialog(playerid, ESCOLHA, DIALOG_STYLE_LIST, "GUERRA", "Aliados\nEixo", "Escolher", "Sair");
- return 1;
- }
- CMD:comandosstaff(playerid) {
- if(Stralioti[playerid][pStaff] > 1) {
- SendClientMessage(playerid, COR_AZUL,"=========[COMANDOS STAFF]=========");
- SendClientMessage(playerid, COR_ERRO,"[LEVEL 1]: /vidatodos, /coletetodos, /vida, /colete, /trazer, /ir, /kick, /ban"); }
- else SendClientMessage(playerid, COR_ERRO,"Você não tem permissão!");
- return 1;
- }
- CMD:comandos(playerid) {
- SendClientMessage(playerid, COR_AZUL,"=========[COMANDOS]=========");
- SendClientMessage(playerid, COR_ERRO,"/escolher, /spawnaliados, /spawneixo, /loja");
- return 1;
- }
- CMD:equipar(playerid) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, 2812.457031, 893.352233, 10.757797)) {
- GivePlayerWeapon(playerid, 23, 300);
- GivePlayerWeapon(playerid, 25, 300);
- GivePlayerWeapon(playerid, 29, 300);
- GivePlayerWeapon(playerid, 34, 300);
- GivePlayerWeapon(playerid, 4, 1);
- }
- return 1;
- }
- CMD:equipar1(playerid) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, -2135.262207,-137.921279,35.320312)) {
- GivePlayerWeapon(playerid, 23, 300);
- GivePlayerWeapon(playerid, 25, 300);
- GivePlayerWeapon(playerid, 29, 300);
- GivePlayerWeapon(playerid, 34, 300);
- GivePlayerWeapon(playerid, 4, 1);
- }
- return 1;
- }
- CMD:teste(playerid) {
- GivePlayerMoney(playerid, 100000000);
- return 1;
- }
- CMD:lojinha(playerid) {
- if(IsPlayerInRangeOfPoint(playerid, 2.0, -1989.306762,1040.454956,55.726562)) {
- ShowPlayerDialog(playerid, LOJA, DIALOG_STYLE_LIST, "LOJA", "Armas Pesadas\nVeículos Fortes\nMunição", "Escolher", "Sair");
- }
- return 1;
- }
- CMD:loja(playerid) {
- ShowPlayerDialog(playerid, LOJA, DIALOG_STYLE_LIST, "LOJA", "Armas Pesadas\nVeículos Fortes\nMunição", "Escolher", "Sair");
- return 1;
- }
- CMD:creditos(playerid) {
- SendClientMessage(playerid, COR_VERDE,"GameMode feito por: Fábio Stralioti");
- SendClientMessage(playerid, COR_VERDE,"www.fabiostralioti.esy.es");
- return 1;
- }
- nome(playerid) {
- new nomee[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nomee, sizeof(nomee));
- return nomee;
- }
- stock salvararmas(playerid) {
- new Armas[13][2], straliotii[100], stralioti2[64];
- for(new i = 0; i < 13; i++){
- GetPlayerWeaponData(playerid, i, Armas[i][0], Armas[i][1]);
- }
- format(straliotii, sizeof straliotii, "/Armas/%s.txt", nome(playerid));
- for(new i = 0; i < 13; i++) {
- format(stralioti2, sizeof stralioti2, "Arma %d", i);
- DOF2_SetInt(straliotii, stralioti2, Armas[i][0]);
- format(stralioti2, sizeof stralioti2, "Municao %d", i);
- DOF2_SetInt(straliotii, stralioti2, Armas[i][1]);
- }
- return 1;
- }
- stock carregararmas(playerid) {
- new straliotii[100], fabio[100], martins[100];
- GetPlayerName(playerid, straliotii, 24);
- format(straliotii, sizeof straliotii, "/Armas/%s.txt", straliotii);
- if(!fexist(straliotii)) return DOF2_CreateFile(straliotii);
- for(new i = 0; i < 13; i++) {
- format(fabio, sizeof fabio, "Arma %d", i);
- format(martins, sizeof martins, "Municao %d", i);
- GivePlayerWeapon(playerid, DOF2_GetInt(straliotii, fabio), DOF2_GetInt(straliotii, martins));
- }
- return 1;
- }
- forward Kicka(p); public Kicka(p) {
- #undef Kick
- Kick(p);
- #define Kick(%0) SetTimerEx("Kicka", 100, false, "i", %0)
- return 1;
- }
- forward Bana(p); public Bana(p) {
- #undef Ban
- Ban(p);
- #define Ban(%0) SetTimerEx("Bana", 100, false, "i", %0)
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment