Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SISTEMA DE MATUTO ( ENTREGADOR DE ARMAS ) //
- // CRIADO POR: Victor Soares RATO22 //
- // DATA: 20/10/2017 //
- // OB's: quando estava fazendo isso estava chapadão kaksdkas //
- #include <a_samp>
- #include <Zcmd>
- #include <sscanf2>
- #include <cpstream>
- #define DIALOG_ENTREGA 8596
- #define Matuto "Matuto/%s.ini"
- new EntregandoArmas[MAX_PLAYERS],
- EntregandoDrogas[MAX_PLAYERS],
- EntregandoMunicoes[MAX_PLAYERS],
- Entregou[MAX_PLAYERS];
- new Armas,
- Drogas,
- Municoes;
- #if defined FILTERSCRIPT
- main()
- {
- print("Sistema de Matuto by Rato22");
- }
- public OnFilterScriptInit()
- {
- CarregarMatuto();
- return 1;
- }
- public OnFilterScriptExit()
- {
- SalvarMatuto();
- return 1;
- }
- #else
- #endif
- public OnPlayerConnect(playerid)
- {
- SendClientMessage(playerid, -1, "Sistema de Matuto feito por Rato22");
- EntregandoArmas[playerid] = 0;
- EntregandoDrogas[playerid] = 0;
- EntregandoMunicoes[playerid] = 0;
- Entregou[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- EntregandoArmas[playerid] = 0;
- EntregandoDrogas[playerid] = 0;
- EntregandoMunicoes[playerid] = 0;
- Entregou[playerid] = 0;
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- CMD:entregar(playerid)
- {
- ShowPlayerDialog(playerid, DIALOG_ENTREGA, DIALOG_STYLE_LIST, "Tipos de entregas", "Armas\nDrogas\nMunições", "Selecionar", "Cancelar");
- return 1;
- }
- CMD:cancelar(playerid)
- {
- if(EntregandoArmas[playerid] == 1){
- SendClientMessage(playerid, -1, "Você cancelou a Entrega de Armas");
- EntregandoArmas[playerid] = 0;
- //Fim do código
- }
- if(EntregandoDrogas[playerid] == 1){
- SendClientMessage(playerid, -1, "Você cancelou a Entrega de Drogas");
- EntregandoDrogas[playerid] = 0;
- //Fim do código
- }
- if(EntregandoMunicoes[playerid] == 1){
- SendClientMessage(playerid, -1, "Você cancelou a Entrega de Munições");
- EntregandoMunicoes[playerid] = 0;
- //Fim do código
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(EntregandoArmas[playerid] == 1){
- SendClientMessage(playerid, -1, "Você cancelou a Entrega de Armas");
- EntregandoArmas[playerid] = 0;
- //Fim do código
- }
- if(EntregandoDrogas[playerid] == 1){
- SendClientMessage(playerid, -1, "Você cancelou a Entrega de Drogas");
- EntregandoDrogas[playerid] = 0;
- //Fim do código
- }
- if(EntregandoMunicoes[playerid] == 1){
- SendClientMessage(playerid, -1, "Você cancelou a Entrega de Munições");
- EntregandoMunicoes[playerid] = 0;
- //Fim do código
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(EntregandoArmas[playerid] == 1){
- SendClientMessage(playerid, -1, "Você efetuou a Entrega de Armas");
- Entregou[playerid] = 1;
- Armas += 50;
- //Fim do código
- }
- if(EntregandoDrogas[playerid] == 1){
- SendClientMessage(playerid, -1, "Você efetuou a Entrega de Drogas");
- Entregou[playerid] = 1;
- Drogas += 50;
- //Fim do código
- }
- if(EntregandoMunicoes[playerid] == 1){
- SendClientMessage(playerid, -1, "Você efetuou a Entrega de Munições");
- Entregou[playerid] = 1;
- Municoes += 50;
- //Fim do código
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_ENTREGA+1)
- {
- if(listitem == 0)
- {
- SetPlayerCheckpoint(playerid,0.0,0.0,0.0,4.0);
- SendClientMessage(playerid, -1, "O Local para Entrega foi marcado no mapa");
- EntregandoArmas[playerid] = 1;
- }
- return 1;
- }
- if(dialogid == DIALOG_ENTREGA+2)
- {
- if(listitem == 0)
- {
- SetPlayerCheckpoint(playerid,0.0,0.0,0.0,4.0);
- SendClientMessage(playerid, -1, "O Local para Entrega foi marcado no mapa");
- EntregandoDrogas[playerid] = 1;
- }
- return 1;
- }
- if(dialogid == DIALOG_ENTREGA+3)
- {
- if(listitem == 0)
- {
- SetPlayerCheckpoint(playerid,0.0,0.0,0.0,4.0);
- SendClientMessage(playerid, -1, "O Local para Entrega foi marcado no mapa");
- EntregandoMunicoes[playerid] = 1;
- }
- return 1;
- }
- if(dialogid == DIALOG_ENTREGA)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, DIALOG_ENTREGA+1, DIALOG_STYLE_LIST, "Território para Entrega", "Favela", "Selecionar", "Cancelar");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, DIALOG_ENTREGA+2, DIALOG_STYLE_LIST, "Território para Entrega", "Favela", "Selecionar", "Cancelar");
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid, DIALOG_ENTREGA+3, DIALOG_STYLE_LIST, "Território para Entrega", "Favela", "Selecionar", "Cancelar");
- }
- }
- return 1;
- }
- stock SalvarMatuto()
- {
- new string[128];
- format(string, sizeof(string), Matuto);
- if(!DOF2_FileExists(Matuto)) DOF2_CreateFile(Matuto);
- DOF2_SetInt(string,"Armas",Armas;
- DOF2_SetInt(string,"Drogas",Drogas);
- DOF2_SetInt(string,"Munições",Municoes);
- DOF2_SaveFile();
- }
- stock CarregarMatuto()
- {
- new string[128];
- format(string, sizeof(string), Matuto);
- if(!DOF2_FileExists(Matuto)) DOF2_CreateFile(Matuto);
- Armas = DOF2_GetInt(string,"Armas");
- Drogas = DOF2_GetInt(string,"Drogas");
- Municoes = DOF2_GetInt(string,"Munições");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement