Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define PastaConcessionaria \
- "Concessionaria/Veiculos/Dono_%s.ini"
- #define AdicionarVIP \
- 0 // Restrição para VIP Comprar carros ! Bote 1 se quiser usar
- #define MaxCarros \
- 100 // MaxCarros = 50 + 1 NULL !!!!
- #define PrecoCarros \
- 10000 // Preço dos Carros ao Comprar
- #define GranaVenderCarro \
- 80000 // Grana ao Vender seu Carro !
- #define JFSQuantCarrosTextD \
- 98
- #define CARROSPAGINA \
- 21
- #define CARROSLINHA \
- 7
- #define jCOR_FUNDO \
- 0xF0F8FFFF
- #include <a_samp>
- #include <dof2>
- #include <zcmd>
- new Float:VRandSpawn[][4] =
- {
- {533.8918,-1319.3507,16.8116,95.7052},
- {533.8918,-1319.3507,16.8116,95.7052},
- {533.8918,-1319.3507,16.8116,95.7052},
- {533.8918,-1319.3507,16.8116,95.7052},
- {533.8918,-1319.3507,16.8116,95.7052},
- {533.8918,-1319.3507,16.8116,95.7052},
- {2533.8918,-1319.3507,16.8116,95.7052},
- {533.8918,-1319.3507,16.8116,95.7052}
- };
- new gItemLists[JFSQuantCarrosTextD] =
- {
- 400,401,402,404,405,410,411,412,413,414,415,418,419,421,422,424,426,429,434,436,439,440,442,
- 443,445, 451,458,459,461,462,463,466,467,468,471,474,475, 477,478,479,480,
- 482,483,485,489,491,492,494,495,496,500,502, 503, 504,505,506,507,508, 516,517,518,521,522,
- 526,527,529,533,534,535, 526, 540, 541,542,543, 547,549,550,551,555,559,560,561,562, 565,566,
- 567,575,576,579,579,580,581, 585,587,589,600,602,603,
- };
- enum JFSInformacoes
- {
- JFSModelo,
- JFSDono[MAX_PLAYER_NAME],
- Float:JFSCorX,
- Float:JFSCorY,
- Float:JFSCorZ,
- Float:JFSAngulo,
- JFSCor1,
- JFSCor2,
- JFSCofre,
- JFSPlaca
- };
- new
- JFSCarros[MaxCarros][JFSInformacoes],
- JFSID[MaxCarros],
- CarroJFS[MaxCarros],
- gTotalItems = JFSQuantCarrosTextD,
- PlayerText:gCurrentPageTextDrawIds[MaxCarros],
- PlayerText:gHeaderTextDrawIds[MaxCarros],
- PlayerText:gBackgroundTextDrawIds[MaxCarros],
- PlayerText:gNextButtonTextDrawIds[MaxCarros],
- PlayerText:gPrevButtonTextDrawIds[MaxCarros],
- PlayerText:gSelectionItemss[MaxCarros][CARROSPAGINA],
- gSelectionItemssTag[MaxCarros][CARROSPAGINA],
- gItemAts[MaxCarros],
- Celulas1[124],
- JFSCheck[MaxCarros]
- ;
- public OnFilterScriptInit()
- {
- Create3DTextLabel("Concessionária\nAperte 'Y' para utilizar", -1, 548.3907, -1287.7068, 16.7539, 40.0, 0);
- format(Celulas1, sizeof(Celulas1), "/Concessionaria");
- if(!DOF2::FileExists(Celulas1))
- {
- for(new x=0; x < 20; ++x) {
- print("[Concessionária] - NÃO EXISTE A PASTA Concessionaria NO SCRIPTFILES ! CRIE AGORA !");
- }
- SendRconCommand("exit");
- }
- format(Celulas1, sizeof(Celulas1), "/Concessionaria/Veiculos");
- if(!DOF2::FileExists(Celulas1))
- {
- for(new x=0; x < 20; ++x) {
- print("[Concessionária] - NÃO EXISTE A PASTA Veiculos EM Concessionaria NOS SCRIPTFILES ! CRIE AGORA !");
- }
- SendRconCommand("exit");
- }
- print("[Concessionária] - Carregado com Sucesso !");
- return true;
- }
- public OnFilterScriptExit()
- {
- DOF2::Exit();
- return true;
- }
- public OnPlayerConnect(playerid)
- {
- CarregarCarro(playerid);
- gHeaderTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gBackgroundTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gCurrentPageTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gNextButtonTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gPrevButtonTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- for(new x=0; x < CARROSPAGINA; x++) {
- gSelectionItemss[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
- }
- gItemAts[playerid] = 0;
- return true;
- }
- public OnPlayerDisconnect(playerid)
- {
- DestruiraoDesconectar(playerid);
- return true;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(GetPVarInt(playerid, "JFSTextAtivado") == 0) return false;
- if(clickedid == Text:INVALID_TEXT_DRAW) {
- DestroySelectionMenu(playerid);
- SetPVarInt(playerid, "JFSTextAtivado", 0);
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- return true;
- }
- return false;
- }
- public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
- {
- if(GetPVarInt(playerid, "JFSTextAtivado") == 0) return false;
- new curpage = GetPVarInt(playerid, "JFSPagina");
- if(playertextid == gNextButtonTextDrawIds[playerid])
- {
- if(curpage < (GETNumeroPaginas() - 1))
- {
- SetPVarInt(playerid, "JFSPagina", curpage + 1);
- ShowPlayerModelPreviews(playerid);
- UpdatePageTextDraw(playerid);
- PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
- } else {
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- }
- return true;
- }
- if(playertextid == gPrevButtonTextDrawIds[playerid])
- {
- if(curpage > 0)
- {
- SetPVarInt(playerid, "JFSPagina", curpage - 1);
- ShowPlayerModelPreviews(playerid);
- UpdatePageTextDraw(playerid);
- PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
- } else {
- PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
- }
- return true;
- }
- new x=0;
- while(x != CARROSPAGINA)
- {
- if(GetPlayerMoney(playerid) < PrecoCarros) return SendClientMessage(playerid, -1, "| ERRO | Você não tem dinheiro suficiente ! R$80.000");
- if(playertextid == gSelectionItemss[playerid][x])
- {
- JFSComprouVeiculo(playerid, x);
- PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
- DestroySelectionMenu(playerid);
- CancelSelectTextDraw(playerid);
- SetPVarInt(playerid, "JFSTextAtivado", 0);
- return true;
- }
- x++;
- }
- return false;
- }
- public OnPlayerCommandText(playerid, cmdtext[]) return false;
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if (PRESSED(KEY_YES))
- {
- if(IsPlayerInRangeOfPoint(playerid, 1.0, 548.3907, -1287.7068, 16.7539))
- {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "| ERRO | Você Não comprar veiculo dentro de um.");
- if((CarroJFS[playerid] == 1)) return SendClientMessage(playerid, -1, "| ERRO | Você Já Tem um Veiculo.");
- #if(AdicionarVIP == 1)
- if(VariavelVIP < 1) return SendClientMessage(playerid, -1, "| ERRO | Você Não é VIP.");
- #endif
- DestroySelectionMenu(playerid);
- SetPVarInt(playerid, "JFSTextAtivado", 1);
- CreateSelectionMenu(playerid);
- SelectTextDraw(playerid, 0xACCBF1FF);
- }
- }
- return true;
- }
- CMD:excluirveiculo(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xDEEE20FF, "| ERRO | Comando inválido");
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- if(!DOF2::FileExists(Celulas1)) return SendClientMessage(playerid, -1, "Esse Úsuario não tem veiculo!");
- format(Celulas1, sizeof(Celulas1), "Arquivo Veiculo_%s.ini Excluido com Sucesso dos ScriptFiles !", PlayerN(playerid));
- SendClientMessage(playerid, -1, Celulas1);
- DOF2::RemoveFile(Celulas1);
- DOF2::SaveFile();
- if(IsPlayerConnected(strlen(PlayerN(playerid))))
- {
- JFSID[strlen(params)] = 0;
- DestroyVehicle(JFSID[strlen(PlayerN(playerid))]);
- }
- return true;
- }
- CMD:menuveiculo(playerid, params[])
- {
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- if (!DOF2::FileExists(Celulas1)) return SendClientMessage ( playerid , -1 , "| ERRO | Você não tem um veiculo!" ) ;
- if (!IsPlayerInVehicle(playerid, JFSID[playerid])) return SendClientMessage (playerid , -1 , "Você não está em seu veiculo." ) ;
- ShowPlayerDialog(playerid, 7337, DIALOG_STYLE_LIST, "Menu Veiculo", "Estacionar Aqui\nCor do Veiculo\nVender Veiculo\nPlaca do Veiculo", "Selecionar", "Cancelar");
- return true;
- }
- CMD:localizarveiculo(playerid, params[])
- {
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- if (!DOF2::FileExists(Celulas1)) return SendClientMessage ( playerid , -1 , "| ERRO | Você não tem um veiculo!" ) ;
- JFSCheck[playerid] = 1;
- static Float:CordX, Float:CordY, Float:CordZ;
- GetVehiclePos(JFSID[playerid], CordX, CordY, CordZ);
- SetPlayerCheckpoint (playerid , CordX, CordY, CordZ, 10.0);
- SendClientMessage(playerid , -1, "| INFO | O Seu Veículo foi Marcado no Mapa!");
- return true;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 7337)
- {
- if(response)
- {
- if(listitem == 0)
- {
- new VeiculoID = JFSID[playerid];
- static Float:CordX, Float:CordY, Float:CordZ, Float:Angulo;
- GetVehiclePos(VeiculoID, CordX, CordY, CordZ);
- GetVehicleZAngle(VeiculoID, Angulo);
- JFSCarros[playerid][JFSCorX] = CordX;
- JFSCarros[playerid][JFSCorY] = CordY;
- JFSCarros[playerid][JFSCorZ] = CordZ;
- JFSCarros[playerid][JFSAngulo] = Angulo;
- DestroyVehicle(VeiculoID);
- JFSID[playerid] = CreateVehicle(JFSCarros[playerid][JFSModelo], JFSCarros[playerid][JFSCorX], JFSCarros[playerid][JFSCorY], JFSCarros[playerid][JFSCorZ], JFSCarros[playerid][JFSAngulo], JFSCarros[playerid][JFSCor1] , JFSCarros[playerid][JFSCor2], 0);
- PutPlayerInVehicle(playerid, JFSID[playerid], 0);
- SendClientMessage(playerid, -1, "| INFO | Seu Veiculo vai da Spawn Aqui Agora!");
- SalvarArquivos(playerid);
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, 3773, DIALOG_STYLE_INPUT, "Concessionária - Cor", "DIGITE O ID DA COR 1 DE SEU VEICULO\n\n\nPS: As Cores Foram Modificadas na versão 0.3x.", "Comprar", "Cancelar");
- }
- if(listitem == 2)
- {
- format(Celulas1, sizeof(Celulas1), "Concessionária - Seu Veiculo Será Vendido Por %d.\n\nCaso Queria Vender seu Veículo, Confirme Abaixo.\n\n", GranaVenderCarro);
- ShowPlayerDialog(playerid, 4217, DIALOG_STYLE_MSGBOX, "Concessionária - Vender Veiculo", Celulas1, "Confirmar", "Cancelar");
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid, 2461, DIALOG_STYLE_INPUT, "Concessionária - Placa", "DIGITE A PLACA DO SEU VEICULO\n\n", "Trocar", "Cancelar");
- }
- }
- return true;
- }
- if(dialogid == 4217)
- {
- if(response)
- {
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- DOF2::RemoveFile(Celulas1);
- DOF2::SaveFile();
- DestroyVehicle(JFSID[playerid]);
- CarroJFS[playerid] = 0;
- RemovePlayerFromVehicle(playerid);
- format(Celulas1, sizeof(Celulas1), "| Concessionária | Você Vendeu seu veiculo e ganhou %d.", GranaVenderCarro);
- SendClientMessage(playerid, -1, Celulas1);
- GivePlayerMoney(playerid, GranaVenderCarro);
- }
- return true;
- }
- if(dialogid == 2461)
- {
- if(response)
- {
- if(strlen(inputtext) > 1 && strlen(inputtext) < 9)
- {
- format(Celulas1,sizeof(Celulas1),"%s", inputtext);
- static Float:CordX, Float:CordY, Float:CordZ, Float:Angulo;
- new VeiculoID = JFSID[playerid];
- SetVehicleNumberPlate(VeiculoID, Celulas1);
- GetVehiclePos(VeiculoID, CordX, CordY, CordZ);
- GetVehicleZAngle(VeiculoID, Angulo);
- SetVehicleToRespawn(VeiculoID);
- SetVehiclePos(VeiculoID, CordX, CordY, CordZ);
- SetVehicleZAngle(VeiculoID, Angulo);
- PutPlayerInVehicle(playerid, VeiculoID, 0);
- format(JFSCarros[playerid][JFSPlaca] , 9,"%s", inputtext);
- SalvarArquivos(playerid);
- }
- else SendClientMessage(playerid, -1, "{FF0000}| ERRO | Apenas Caractéristicas de 2 a 8 !");
- }
- return true;
- }
- if(dialogid == 3773)
- {
- if(response)
- {
- new VeiculoID = JFSID[playerid];
- if(!strval(inputtext)) return SendClientMessage(playerid, -1, "{FF0000}| ERRO | Apenas Numeros!"), true;
- if(strval(inputtext) < 0 || strval(inputtext) > 255) return SendClientMessage(playerid, -1, "{FF0000}| ERRO | Existes Cores Apenas Entre 0 á 255."), true;
- JFSCarros[playerid][JFSCor1] = strval(inputtext);
- ChangeVehicleColor(VeiculoID, JFSCarros[playerid][JFSCor1], -1);
- ShowPlayerDialog(playerid, 7733, DIALOG_STYLE_INPUT, "Concessionária - Cor", "DIGITE O ID DA COR 2 DE SEU VEICULO\n\n\nPS: As Cores Foram Modificadas na versão 0.3x.", "Comprar", "Cancelar");
- }
- return true;
- }
- if(dialogid == 7733)
- {
- if(response)
- {
- new VeiculoID = JFSID[playerid];
- if(!strval(inputtext)) return SendClientMessage(playerid, -1, "{FF0000}| ERRO | Apenas Numeros!"), ShowPlayerDialog(playerid, 7733, DIALOG_STYLE_INPUT, "JFS Concessionária v1.0 - Cor", "DIGITE O ID DA COR 2 DE SEU VEICULO\n\n\nPS: As Cores Foram Modificadas na versão 0.3x.", "Comprar", "Cancelar"), true;
- if(strval(inputtext) < 0 || strval(inputtext) > 255) return SendClientMessage(playerid, -1, "{FF0000}| ERRO | Existes Cores Apenas Entre 0 á 255."), ShowPlayerDialog(playerid, 7733, DIALOG_STYLE_INPUT, "JFS Concessionária v1.0 - Cor", "DIGITE O ID DA COR 2 DE SEU VEICULO\n\n\nPS: As Cores Foram Modificadas na versão 0.3x.", "Comprar", "Cancelar"), true;
- JFSCarros[playerid][JFSCor2] = strval(inputtext);
- ChangeVehicleColor(VeiculoID, JFSCarros[playerid][JFSCor1], JFSCarros[playerid][JFSCor2]);
- SendClientMessage(playerid, -1, "| INFO | Cores Definidas com Sucesso!");
- SalvarArquivos(playerid);
- }
- else ShowPlayerDialog(playerid, 7733, DIALOG_STYLE_INPUT, "Concessionária - Cor", "DIGITE O ID DA COR 2 DE SEU VEICULO\n\n\n", "Comprar", "Cancelar");
- return true;
- }
- return true;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- if(newstate == PLAYER_STATE_DRIVER)
- {
- for(new carro, JFS = sizeof(JFSCarros); carro != JFS; carro++)
- {
- if(JFSID[carro] == GetPlayerVehicleID(playerid) && strcmp(PlayerN(playerid), JFSCarros[carro][JFSDono], true))
- {
- format(Celulas1, sizeof(Celulas1), "{FFFF00}| INFO | Este veículo pertence ao jogador{FFFFFF} %s{FFFF00} e você não pode dirigí-lo.", JFSCarros[carro][JFSDono]);
- SendClientMessage(playerid, -1, Celulas1);
- RemovePlayerFromVehicle(playerid);
- }
- if(JFSID[carro] == GetPlayerVehicleID(playerid) && !strcmp(PlayerN(playerid), JFSCarros[carro][JFSDono], true))
- {
- SendClientMessage(playerid, -1, "| INFO | Bem Vindo ao Seu Veiculo Concessionária Use: /menuveiculo");
- }
- }
- }
- return true;
- }
- public OnPlayerEnterCheckpoint (playerid)
- {
- if (JFSCheck[playerid] == 1 )
- {
- SendClientMessage (playerid , -1 , "| INFO | Aqui Está Seu Veículo!");
- DisablePlayerCheckpoint (playerid);
- return true;
- }
- return true;
- }
- stock PlayerN(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- return Name;
- }
- stock SalvarArquivos(playerid)
- {
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- if(!DOF2::FileExists(Celulas1)) DOF2::CreateFile(Celulas1), DOF2::SetString(Celulas1,"Dono", PlayerN(playerid));
- JFSCarros[playerid][JFSDono] = PlayerN(playerid);
- format(JFSCarros[playerid][JFSDono], MAX_PLAYER_NAME, DOF2::GetString(Celulas1, "Dono"));
- DOF2::SetString(Celulas1,"Dono", JFSCarros[playerid][JFSDono]);
- DOF2::SetInt(Celulas1,"Modelo", JFSCarros[playerid][JFSModelo]);
- DOF2::SetFloat(Celulas1,"CorX", JFSCarros[playerid][JFSCorX]);
- DOF2::SetFloat(Celulas1,"CorY", JFSCarros[playerid][JFSCorY]);
- DOF2::SetFloat(Celulas1,"CorZ", JFSCarros[playerid][JFSCorZ]);
- DOF2::SetFloat(Celulas1,"Angulo", JFSCarros[playerid][JFSAngulo]);
- DOF2::SetInt(Celulas1,"Cor1", JFSCarros[playerid][JFSCor1]);
- DOF2::SetInt(Celulas1,"Cor2", JFSCarros[playerid][JFSCor2]);
- DOF2::SetString(Celulas1,"Placa", JFSCarros[playerid][JFSPlaca]);
- DOF2::SetInt(Celulas1,"Cofre", JFSCarros[playerid][JFSCofre]);
- format(JFSCarros[playerid][JFSDono], MAX_PLAYER_NAME, DOF2::GetString(Celulas1, "Dono"));
- DOF2::GetString(Celulas1, "Dono", JFSCarros[playerid][JFSDono]);
- JFSCarros[playerid][JFSModelo] = DOF2::GetInt(Celulas1, "Modelo");
- JFSCarros[playerid][JFSCorX] = DOF2::GetFloat(Celulas1, "CorX");
- JFSCarros[playerid][JFSCorY] = DOF2::GetFloat(Celulas1, "CorY");
- JFSCarros[playerid][JFSCorZ] = DOF2::GetFloat(Celulas1, "CorZ");
- JFSCarros[playerid][JFSAngulo] = DOF2::GetFloat(Celulas1, "Angulo");
- JFSCarros[playerid][JFSCor1] = DOF2::GetInt(Celulas1, "Cor1");
- JFSCarros[playerid][JFSCor2] = DOF2::GetInt(Celulas1, "Cor2");
- DOF2::GetString(Celulas1, "Placa", JFSCarros[playerid][JFSPlaca]);
- JFSCarros[playerid][JFSCofre] = DOF2::GetInt(Celulas1, "Cofre");
- DOF2::SaveFile();
- return true;
- }
- stock CarregarCarro(playerid)
- {
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- if(DOF2::FileExists(Celulas1))
- {
- format(JFSCarros[playerid][JFSDono], MAX_PLAYER_NAME, DOF2::GetString(Celulas1, "Dono"));
- DOF2::GetString(Celulas1, "Dono", JFSCarros[playerid][JFSDono]);
- JFSCarros[playerid][JFSModelo] = DOF2::GetInt(Celulas1, "Modelo");
- JFSCarros[playerid][JFSCorX] = DOF2::GetFloat(Celulas1, "CorX");
- JFSCarros[playerid][JFSCorY] = DOF2::GetFloat(Celulas1, "CorY");
- JFSCarros[playerid][JFSCorZ] = DOF2::GetFloat(Celulas1, "CorZ");
- JFSCarros[playerid][JFSAngulo] = DOF2::GetFloat(Celulas1, "Angulo");
- JFSCarros[playerid][JFSCor1] = DOF2::GetInt(Celulas1, "Cor1");
- JFSCarros[playerid][JFSCor2] = DOF2::GetInt(Celulas1, "Cor2");
- JFSCarros[playerid][JFSCofre] = DOF2::GetInt(Celulas1, "Cofre");
- DOF2::GetString(Celulas1, "Placa", JFSCarros[playerid][JFSPlaca]);
- DOF2::SaveFile();
- CarregaraoConectar(playerid);
- }
- return true;
- }
- stock CarregaraoConectar(playerid)
- {
- CarroJFS[playerid] = 1;
- JFSID[playerid] = CreateVehicle(JFSCarros[playerid][JFSModelo], JFSCarros[playerid][JFSCorX], JFSCarros[playerid][JFSCorY], JFSCarros[playerid][JFSCorZ], JFSCarros[playerid][JFSAngulo], JFSCarros[playerid][JFSCor1] , JFSCarros[playerid][JFSCor2], 0);
- SetVehicleNumberPlate(JFSID[playerid], JFSCarros[playerid][JFSPlaca]);
- return true;
- }
- stock DestruiraoDesconectar(playerid)
- {
- format(Celulas1, sizeof(Celulas1), PastaConcessionaria, PlayerN(playerid));
- if(DOF2::FileExists(Celulas1)) DestroyVehicle(JFSID[playerid]), CarroJFS[playerid] = 0;
- return true;
- }
- GETNumeroPaginas()
- {
- if((gTotalItems >= CARROSPAGINA) && (gTotalItems % CARROSPAGINA) == 0)
- {
- return (gTotalItems / CARROSPAGINA);
- }
- else return (gTotalItems / CARROSPAGINA) + 1;
- }
- PlayerText:CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos)
- {
- new PlayerText:txtInit;
- txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, "0/0");
- PlayerTextDrawUseBox(playerid, txtInit, 0);
- PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
- PlayerTextDrawFont(playerid, txtInit, 1);
- PlayerTextDrawSetShadow(playerid, txtInit, 0);
- PlayerTextDrawSetOutline(playerid, txtInit, 1);
- PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
- PlayerTextDrawShow(playerid, txtInit);
- return txtInit;
- }
- PlayerText:CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[])
- {
- new PlayerText:txtInit;
- txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text);
- PlayerTextDrawUseBox(playerid, txtInit, 1);
- PlayerTextDrawBoxColor(playerid, txtInit, 60);
- PlayerTextDrawBackgroundColor(playerid, txtInit,5);
- PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
- PlayerTextDrawFont(playerid, txtInit, 1);
- PlayerTextDrawSetShadow(playerid, txtInit, 0);
- PlayerTextDrawSetOutline(playerid, txtInit, 0);
- PlayerTextDrawColor(playerid, txtInit, 0xFFFFFFFF);
- PlayerTextDrawSetSelectable(playerid, txtInit, 1);
- PlayerTextDrawAlignment(playerid, txtInit, 2);
- PlayerTextDrawTextSize(playerid, txtInit, Height, Width);
- PlayerTextDrawShow(playerid, txtInit);
- return txtInit;
- }
- PlayerText:CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
- {
- new PlayerText:txtInit;
- txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
- PlayerTextDrawUseBox(playerid, txtInit, 0);
- PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
- PlayerTextDrawFont(playerid, txtInit, 0);
- PlayerTextDrawSetShadow(playerid, txtInit, 0);
- PlayerTextDrawSetOutline(playerid, txtInit, 1);
- PlayerTextDrawColor(playerid, txtInit, 0xFFFFFFFF);
- PlayerTextDrawShow(playerid, txtInit);
- return txtInit;
- }
- PlayerText:CreatePlayerBackgroundTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height)
- {
- new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos,
- " ~n~");
- PlayerTextDrawUseBox(playerid, txtBackground, 1);
- PlayerTextDrawBoxColor(playerid, txtBackground, 60);
- PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0);
- PlayerTextDrawFont(playerid, txtBackground, 0);
- PlayerTextDrawSetShadow(playerid, txtBackground, 0);
- PlayerTextDrawSetOutline(playerid, txtBackground, 0);
- PlayerTextDrawColor(playerid, txtBackground, 0xFFFFFFFF);
- PlayerTextDrawTextSize(playerid, txtBackground, Width, Height);
- PlayerTextDrawBackgroundColor(playerid, txtBackground,0xFFFFFFFF);
- PlayerTextDrawShow(playerid, txtBackground);
- return txtBackground;
- }
- PlayerText:CreateModelPreviewTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:width, Float:height)
- {
- new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, "");
- PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW);
- PlayerTextDrawColor(playerid, txtPlayerSprite, jCOR_FUNDO);
- PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, 0xFFFFFFFF);
- PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height);
- PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex);
- PlayerTextDrawSetPreviewRot(playerid,txtPlayerSprite, -16.0, 0.0, -55.0);
- PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1);
- PlayerTextDrawShow(playerid,txtPlayerSprite);
- return txtPlayerSprite;
- }
- JFSComprouVeiculo(playerid, Modelo)
- {
- new rand = random(sizeof(VRandSpawn));
- JFSCarros[playerid][JFSModelo] = gSelectionItemssTag[playerid][Modelo];
- JFSCarros[playerid][JFSCorX] = VRandSpawn[rand][0];
- JFSCarros[playerid][JFSCorY] = VRandSpawn[rand][1];
- JFSCarros[playerid][JFSCorZ] = VRandSpawn[rand][2];
- JFSCarros[playerid][JFSAngulo] = VRandSpawn[rand][3];
- JFSCarros[playerid][JFSCor1] = -1;
- JFSCarros[playerid][JFSCor2] = -1;
- JFSID[playerid] = CreateVehicle(JFSCarros[playerid][JFSModelo], JFSCarros[playerid][JFSCorX], JFSCarros[playerid][JFSCorY], JFSCarros[playerid][JFSCorZ], JFSCarros[playerid][JFSAngulo], JFSCarros[playerid][JFSCor1] , JFSCarros[playerid][JFSCor2], 0);
- PutPlayerInVehicle(playerid, JFSID[playerid], 0);
- CarroJFS[playerid] = 1;
- GivePlayerMoney(playerid, -PrecoCarros);
- format(Celulas1, sizeof(Celulas1), "~w~VEICULO COMPRADO POR ~r~%dR$", PrecoCarros);
- GameTextForPlayer(playerid, Celulas1 , 5000,4);
- SalvarArquivos(playerid);
- }
- DestroyPlayerModelPreviews(playerid)
- {
- new x=0;
- while(x != CARROSPAGINA) {
- if(gSelectionItemss[playerid][x] != PlayerText:INVALID_TEXT_DRAW) {
- PlayerTextDrawDestroy(playerid, gSelectionItemss[playerid][x]);
- gSelectionItemss[playerid][x] = PlayerText:INVALID_TEXT_DRAW;
- }
- x++;
- }
- }
- ShowPlayerModelPreviews(playerid)
- {
- new x=0;
- new Float:BaseX = 75.0;
- new Float:BaseY = 130.0 - (70.0 * 0.33);
- new linetracker = 0;
- new itemat = GetPVarInt(playerid, "JFSPagina") * CARROSPAGINA;
- DestroyPlayerModelPreviews(playerid);
- while(x != CARROSPAGINA && itemat < gTotalItems) {
- if(linetracker == 0) {
- BaseX = 75.0 + 25.0;
- BaseY += 70.0 + 1.0;
- }
- gSelectionItemss[playerid][x] = CreateModelPreviewTextDraw(playerid, gItemLists[itemat], BaseX, BaseY, 60.0, 70.0);
- gSelectionItemssTag[playerid][x] = gItemLists[itemat];
- BaseX += 60.0 + 1.0;
- linetracker++;
- if(linetracker == CARROSLINHA) linetracker = 0;
- itemat++;
- x++;
- }
- }
- UpdatePageTextDraw(playerid)
- {
- new PageText[64+1];
- format(PageText, 64, "%d/%d", GetPVarInt(playerid,"JFSPagina") + 1, GETNumeroPaginas());
- PlayerTextDrawSetString(playerid, gCurrentPageTextDrawIds[playerid], PageText);
- }
- CreateSelectionMenu(playerid)
- {
- gBackgroundTextDrawIds[playerid] = CreatePlayerBackgroundTextDraw(playerid, 75.0, 130.0 + 20.0, 550.0, 180.0);
- gHeaderTextDrawIds[playerid] = CreatePlayerHeaderTextDraw(playerid, 75.0, 130.0, "Concessionaria");
- gCurrentPageTextDrawIds[playerid] = CreateCurrentPageTextDraw(playerid, 550.0 - 30.0, 130.0 + 15.0);
- gNextButtonTextDrawIds[playerid] = CreatePlayerDialogButton(playerid, 550.0 - 30.0, 130.0+180.0+100.0, 50.0, 16.0, "Proximo");
- gPrevButtonTextDrawIds[playerid] = CreatePlayerDialogButton(playerid, 550.0 - 90.0, 130.0+180.0+100.0, 50.0, 16.0, "Anterior");
- ShowPlayerModelPreviews(playerid);
- UpdatePageTextDraw(playerid);
- SendClientMessage(playerid, -1, "| INFO | Para Sair aperte ESC !");
- }
- DestroySelectionMenu(playerid)
- {
- DestroyPlayerModelPreviews(playerid);
- PlayerTextDrawDestroy(playerid, gHeaderTextDrawIds[playerid]);
- PlayerTextDrawDestroy(playerid, gBackgroundTextDrawIds[playerid]);
- PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawIds[playerid]);
- PlayerTextDrawDestroy(playerid, gNextButtonTextDrawIds[playerid]);
- PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawIds[playerid]);
- gHeaderTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gBackgroundTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gCurrentPageTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gNextButtonTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- gPrevButtonTextDrawIds[playerid] = PlayerText:INVALID_TEXT_DRAW;
- }
Advertisement
Add Comment
Please, Sign In to add comment