Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*----------------------------------------- Sistema de criação de Teleportes IN GAME -----------------------------------------
- ----------------------------------------- Não retire os creditos, caso o retire dará erro -------------------------------------
- -------------------------------- Creditos a Marcelodell ou Spark_DaSantos pela criação do FS -----------------------------------*/
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <DOF2>
- #define COR_BRANCO 0xFFFFFFAA
- #define COR_AMARELO 0xFFFF00AA
- #define COR_GRAD 0xCBCCCEFF
- new Float:x,Float:y,Float:z, local[64], arquivo[128], interior, vw, arquivo2[128];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Sistema de Teleportes com Salvamento");
- print(" Carregado com sucesso!");
- print(" ====================================");
- print(" Autor: Marcelodell ou Spark_DaSantos");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- CMD:salvarlocal(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_GRAD,"Você não está autorizado a usar este comando.");
- if(sscanf(params, "s[64]", local)) return SendClientMessage(playerid, COR_GRAD,"Use: /salvarlocal [nome do local]");
- if(!DOF2_FileExists("Locais.txt")) DOF2_CreateFile("Locais.txt");
- format(arquivo,sizeof(arquivo), "/Locais/%s.ini",local);
- format(arquivo2,sizeof(arquivo2), "Locais.txt");
- if(DOF2_FileExists(arquivo))
- {
- SendClientMessage(playerid, COR_GRAD,"Esse Local já está salvo.\nCaso queira atualiza-lo use /atualizarlocal");
- return 1;
- }
- DOF2_CreateFile(arquivo);
- GetPlayerPos(playerid, x, y, z);
- DOF2_SetString(arquivo,"Nome",local);
- DOF2_SetString(arquivo2,local,"Salvo no Banco de Dados");
- DOF2_SetFloat(arquivo,"X",x);
- DOF2_SetFloat(arquivo,"Y",y);
- DOF2_SetFloat(arquivo,"Z",z);
- DOF2_SetInt(arquivo,"Interior",GetPlayerInterior(playerid));
- DOF2_SetInt(arquivo,"VirtualWorld",GetPlayerVirtualWorld(playerid));
- DOF2_SaveFile();
- SendClientMessage(playerid, COR_AMARELO,"Local salvo com sucesso!");
- return 1;
- }
- CMD:irlocal(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_GRAD,"Você não está autorizado a usar este comando.");
- if(sscanf(params, "s[64]", local)) return SendClientMessage(playerid, COR_GRAD,"Use: /irlocal [nome do local]");
- format(arquivo,sizeof(arquivo), "/Locais/%s.ini",local);
- if(!DOF2_FileExists(arquivo))
- {
- SendClientMessage(playerid, COR_GRAD,"Local não existente.");
- return 1;
- }
- x = DOF2_GetFloat(arquivo,"X");
- y = DOF2_GetFloat(arquivo,"Y");
- z = DOF2_GetFloat(arquivo,"Z");
- interior = DOF2_GetInt(arquivo,"Interior");
- vw = DOF2_GetInt(arquivo, "VirtualWorld");
- SetPlayerVirtualWorld(playerid, vw);
- SetPlayerInterior(playerid,interior);
- if (GetPlayerState(playerid) == 2)
- {
- SetVehiclePos(GetPlayerVehicleID(playerid), x,y,z);
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), vw);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
- SendClientMessage(playerid, COR_AMARELO,"Você foi teleportado com sucesso!");
- return 1;
- }
- else
- {
- SetPlayerPos(playerid, x,y,z);
- SendClientMessage(playerid, COR_AMARELO,"Você foi teleportado com sucesso!");
- }
- return 1;
- }
- CMD:apagarlocal(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_GRAD,"Você não está autorizado a usar este comando.");
- if(sscanf(params, "s[64]", local)) return SendClientMessage(playerid, COR_GRAD,"Use: /apagarlocal [nome do local]");
- if(!DOF2_FileExists("Locais.txt")) DOF2_CreateFile("Locais.txt");
- format(arquivo,sizeof(arquivo), "/Locais/%s.ini",local);
- format(arquivo2,sizeof(arquivo2), "Locais.txt");
- if(!DOF2_FileExists(arquivo))
- {
- SendClientMessage(playerid, COR_GRAD,"Esse local não está registrado em nosso Banco de Dados!");
- return 1;
- }
- DOF2_RemoveFile(arquivo);
- DOF2_SetString(arquivo2,local,"Apagado pelo Usuário");
- DOF2_SaveFile();
- SendClientMessage(playerid, COR_AMARELO,"Local apagado com sucesso!");
- return 1;
- }
- CMD:atualizarlocal(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_GRAD,"Você não está autorizado a usar este comando.");
- if(sscanf(params, "s[64]", local)) return SendClientMessage(playerid, COR_GRAD,"Use: /atualizarlocal [nome do local]");
- format(arquivo,sizeof(arquivo), "/Locais/%s.ini",local);
- if(!DOF2_FileExists(arquivo))
- {
- SendClientMessage(playerid, COR_GRAD,"Esse Local não esta registrado em nosso Banco de Dados!");
- return 1;
- }
- DOF2_RemoveFile(arquivo);
- DOF2_CreateFile(arquivo);
- GetPlayerPos(playerid, x, y, z);
- DOF2_SetString(arquivo,"Nome",local);
- DOF2_SetFloat(arquivo,"X",x);
- DOF2_SetFloat(arquivo,"Y",y);
- DOF2_SetFloat(arquivo,"Z",z);
- DOF2_SetInt(arquivo,"Interior",GetPlayerInterior(playerid));
- DOF2_SetInt(arquivo,"VirtualWorld",GetPlayerVirtualWorld(playerid));
- DOF2_SaveFile();
- SendClientMessage(playerid, COR_AMARELO,"Local atualizado com sucesso!");
- return 1;
- }
- CMD:locais(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_GRAD,"Você não está autorizado a usar este comando.");
- new loc[512];
- if(!DOF2_FileExists("Locais.txt")) DOF2_CreateFile("Locais.txt");
- new File:ftw=fopen("Locais.txt",io_read);
- SendClientMessage(playerid, COR_AMARELO, "==================== LOCAIS ====================");
- new l;
- while(fread(ftw,loc))
- {
- l++;
- if(l==0)
- {
- SendClientMessage(playerid,COR_BRANCO,"Nenhum Local Salvo no Banco de Dados");
- }
- else
- {
- SendClientMessage(playerid,COR_BRANCO,loc);
- }
- }
- fclose(ftw);
- return 1;
- }
- CMD:creditosteleporte(playerid, params[])
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Creditos do Sistema de Teleportes", "------------- Sistema de Teleportes -------------\n------------- Com Salvamento IN GAME -------------\nCriado por: Marcelodell ou Spark_DaSantos", "OK", "");
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement