14.12.2012, 01:53
Boa Noite,
Como eu disse em outro tуpico eu estava com vбrios problemas em criar sistema de salvamento e admin.
Dai eu tentei por vбrios FS de muita gente aqui no fуrum e nenhum funcionou.
Agora eu tentei mais um FS, sу que estб dando este problema:
http://i49.tinypic.com/nvttv7.jpg
Vi vбrios tutoriais tambйm, mas o ъnico que QUASE deu certo foi esse ae, eu tambйm tentei tirar o sistema de RCON, e sу da erro quando eu tiro.
MEU GM:
Me ajudem por favor, eu tentei de tudo mesmo antes de vir pedir ajuda.
Obrigado!
Como eu disse em outro tуpico eu estava com vбrios problemas em criar sistema de salvamento e admin.
Dai eu tentei por vбrios FS de muita gente aqui no fуrum e nenhum funcionou.
Agora eu tentei mais um FS, sу que estб dando este problema:
http://i49.tinypic.com/nvttv7.jpg
Vi vбrios tutoriais tambйm, mas o ъnico que QUASE deu certo foi esse ae, eu tambйm tentei tirar o sistema de RCON, e sу da erro quando eu tiro.
MEU GM:
pawn Код:
/*================================================================================
SERVIDOR AINDA SEM NOME
//PEGUEI VELOCIMETRO DO JFS VELOCIMETRO (nгo esquecer de por no crйditos)
//mudar aqui
//colocar mais sitsemas
//ver no forum samp o nome da menina pra por nos creditos
=================================================================================*/
#include <a_samp>
#include <zcmd> //Adicionando o ZCMD
#include <sscanf> //Adicionando o sscanf
#include <DOF2> //Adicionando o DOF2
#define MAXPLAYERSJFS 50 // Slots do seu Servidor
#define BlindagemTodosVeiculos 0// Bote 1 se quiser por blindagem em todos os veiculos logo no comeco e 0 para nгo !
#define BlindagemMAX 100 // Maximo de Blindagem ( 100% )
#define GasMAX 100 // Maximo de GAS ( 100% )
#define Tempo 15000 // Tempo para Diminuir o GAS
#define FileUsers "Contas/%s.ini"
#define DIALOG_REGISTRO 1
#define DIALOG_LOGIN 2
#define DIALOG_MUDAR_NICK 3
#define DIALOG_MUDAR_SENHA 4
#define DIALOG_RELATORIO 5
enum pDados
{
pAdmin,
pVIP
};
new PlayerDados[MAX_PLAYERS][pDados];
new SenhaErrada[MAX_PLAYERS];
new bool:Autorizado[MAX_PLAYERS] = false;
enum
SavePlayerPosEnum
{
Float:LastX,
Float:LastY,
Float:LastZ
};
new
SemGasolina[MAXPLAYERSJFS],
KMP[MAX_VEHICLES],
Valor,
UpdateSeconds = 1,
Float:distance,
CheckGasT,
PararVeiculoT,
Gas[MAX_VEHICLES],
Blindagem[MAX_VEHICLES],
Desgaste[MAX_VEHICLES],
Abastecendo[MAXPLAYERSJFS],
ArrumandoPneu[MAXPLAYERSJFS],
gGasBiz[MAXPLAYERSJFS],
Float:GasX,
Float:GasY,
Float:GasZ,
JFSAACC,
JFSACPreco,
Float:olddistance,
Float:newdistance,
Float:x,
Float:y,
Float:z,
Float:x1,
Float:y1,
Float:z1,
Float:x2,
Float:y2,
Float:z2,
closest = -1,
Text:TextDrawJFS[MAXPLAYERSJFS],
Text:TextDrawJFSV[MAXPLAYERSJFS],
bool:Velocimetro,
SavePlayerPos[MAXPLAYERSJFS][SavePlayerPosEnum],
Celula[128]
;
new
Float:LocaisGAS[13][3] =
{
{1004.0070,-939.3102,42.1797}, // LS
{1944.3260,-1772.9254,13.3906}, // LS
{-90.5515,-1169.4578,2.4079}, // LS
{-1609.7958,-2718.2048,48.5391}, // LS
{2202.2349,2474.3494,10.5258}, // LV
{614.9333,1689.7418,6.6968}, // LV
{-1328.8250,2677.2173,49.7665}, // LV
{70.3882,1218.6783,18.5165}, // LV
{2113.7390,920.1079,10.5255}, // LV
{-2029.4968,156.4366,28.9498}, // SF
{-2408.7590,976.0934,45.4175}, // SF
{-2243.9629,-2560.6477,31.8841}, // LS/SF
{-1676.6323,414.0262,6.9484} // LS/SF
};
forward
JFSAC();
forward
NoPosto(playerid);
forward
Float:DistanciaPosto(p1,Float:px,Float:py,Float:pz);
forward
PararVeiculo();
forward
CheckGas();
forward
CheckDes();
//Nome dos Carros - Retirado do ThugLife City v4.0 Desenvolvido por mim :)
new
NomesVeiculos[][] = {
"Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
"Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulancia","Leviathan","Moonbeam","Esperanto",
"Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
"Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
"RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
"Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
"PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
"Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX",
"Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
"Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Maverick Policial","Boxville","Benson","Mesa",
"RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
"Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
"Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona",
"FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
"Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
"Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
"Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
"Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
"BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
"Andromada","Dodo","RC Cam","Launch","Viatura (LSPD)","Viatura (SFPD)","Viatura (LVPD)","Police Ranger",
"Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
"Stair Trailer","Boxville","Farm Plow","Utility Trailer"
};
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
for(new c = 0;c < MAX_VEHICLES;c++)
{
Gas[c] = GasMAX;
#if(BlindagemTodosVeiculos == 1)
Blindagem[c] = 100;
#endif
}
SetTimer("AtualizarVelocimetro", 200, true);
PararVeiculoT = SetTimer("PararVeiculo", Tempo, 1);
CheckGasT = SetTimer("CheckGas", Tempo, 1);
SetTimer("Kilometragem", 1000, true);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 1004.0070,-939.3102,42.1797, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 1944.3260,-1772.9254,13.3906, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -90.5515,-1169.4578,2.4079, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -1609.7958,-2718.2048,48.5391, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -2029.4968,156.4366,28.949, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -2408.7590,976.0934,45.4175, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -2243.9629,-2560.6477,31.8841, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -1676.6323,414.0262,6.9484, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 2202.2349,2474.3494,10.5258, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 614.9333,1689.7418,6.6968, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -1328.8250,2677.2173,49.7665, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 70.3882,1218.6783,18.5165, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 2113.7390,920.1079,10.5255, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -1327.7218,2678.8723,50.0625, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 2146.5759,2750.8442,10.6447, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 2146.8779,2739.6157,10.6435, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 1595.3046,2191.1331,10.6454, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, 1596.3274,2206.7070,10.6449, 20.0, 0, 1);
Create3DTextLabel("Abastecer, Consertar Pneu, Blindagem\n{FF7777}/jfsvelocimetro", -1, -736.9305,2742.6138,47.015, 20.0, 0, 1);
return 1;
}
public OnGameModeExit()
{
KillTimer(PararVeiculoT);
KillTimer(CheckGasT);
for(new i=0; i<MAXPLAYERSJFS; i++)
{
TextDrawDestroy(Text:TextDrawJFS[i]);
TextDrawDestroy(Text:TextDrawJFSV[i]);
}
DOF2_Exit();
return 1;
}
public OnPlayerConnect(playerid)
{
new string[70];
format(string,sizeof(string),"{00FF7F}%s {FFFAFA}entrou!",PlayerName(playerid));
SendClientMessageToAll(-1,string);
if(!DOF2_FileExists(ReturnFileUser(playerid))) return ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT,"[NOME] - Registro","Se registre para poder jogar, se clicar em sair serб kickado.", "Registrar","Cancelar");
else if(DOF2_FileExists(ReturnFileUser(playerid))) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"[Nome] - Login", "Para logar digite sua senha", "Logar","Cancelar");
TextDrawJFS[playerid] = TextDrawCreate(479.000000, 340.000000, " "); // 288
TextDrawBackgroundColor(TextDrawJFS[playerid], 255);
TextDrawLetterSize(TextDrawJFS[playerid], 0.255555, 0.999999);
TextDrawFont(TextDrawJFS[playerid], 1);
TextDrawTextSize(TextDrawJFS[playerid], 630.000000,-18.000000);
TextDrawColor(TextDrawJFS[playerid], 16777215);
TextDrawSetOutline(TextDrawJFS[playerid], 0);
TextDrawSetProportional(TextDrawJFS[playerid], 1);
TextDrawSetShadow(TextDrawJFS[playerid], 1);
TextDrawUseBox(TextDrawJFS[playerid], 1);
TextDrawBoxColor(TextDrawJFS[playerid], 80);
TextDrawJFSV[playerid] = TextDrawCreate(556.000000, 325.000000, "JFS Velocimetro");
TextDrawAlignment(TextDrawJFSV[playerid], 2);
TextDrawBackgroundColor(TextDrawJFSV[playerid], 255);
TextDrawFont(TextDrawJFSV[playerid], 3);
TextDrawLetterSize(TextDrawJFSV[playerid], 0.379999, 1.299999);
TextDrawColor(TextDrawJFSV[playerid], -1);
TextDrawSetOutline(TextDrawJFSV[playerid], 1);
TextDrawSetProportional(TextDrawJFSV[playerid], 1);
return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
Velocimetro = true;
AtualizarVelocimetro(playerid);
TextDrawShowForPlayer(playerid, Text:TextDrawJFS[playerid]);
TextDrawShowForPlayer(playerid, Text:TextDrawJFSV[playerid]);
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new string[90];
switch(reason)
{
case 0: format(string,sizeof(string),"{00FF7F}%s {FFFAFA}saiu (Crash/Conexгo).",PlayerName(playerid));
case 1: format(string,sizeof(string),"{00FF7F}%s {FFFAFA}saiu (Vontade prуpria).",PlayerName(playerid));
case 2: format(string,sizeof(string),"{00FF7F}%s {FFFAFA}saiu (Kickado/Banido).",PlayerName(playerid));
}
SendClientMessageToAll(-1,string);
SalvarPlayer(playerid);
return 1;
}
public OnVehicleDamageStatusUpdate(vehicleid, playerid)
{
if(Blindagem[vehicleid] > 0)
{
Blindagem[vehicleid] --;
RepairVehicle(vehicleid);
}
return 1;
}
//======================COMANDOS================================
new giveplayerid,nivel;
CMD:mudarsenha(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_MUDAR_SENHA, DIALOG_STYLE_INPUT,"[Nome do server] - Mudanзa de senha","Digite sua nova senha!","Trocar","Cancelar");
return 1;
}
CMD:mudarnick(playerid, params[])
{
if(PlayerDados[playerid][pVIP] < 1 || Autorizado[playerid] == false) return SendClientMessage(playerid,-1,"Vocк nгo й VIP ou nгo estб autorizado a troca de nick.");
ShowPlayerDialog(playerid, DIALOG_MUDAR_NICK, DIALOG_STYLE_INPUT,"[Nome do server] - Mudanзa de nick","Digite seu novo nick!","Trocar","Cancelar");
return 1;
}
CMD:autorizartroca(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 1000) return SendClientMessage(playerid,-1,"Vocк nгo pode usar esse comando.");
if(sscanf(params,"u", giveplayerid)) return SendClientMessage(playerid,-1,"Use: /autorizartroca [id/nome]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo estб conectado.");
if(Autorizado[giveplayerid] == true) return SendClientMessage(playerid,-1,"Jogador jб estб autorizado.");
Autorizado[giveplayerid] = true;
new string[120];
format(string,sizeof(string),"{14E5FF}%s {FFFAFA}autorizou {14E5FF}%s {FFFAFA}a trocar seu nick!",PlayerName(playerid), PlayerName(giveplayerid));
SendClientMessage(giveplayerid,-1,string);
SendClientMessage(giveplayerid,-1,"Use: /mudarnick.");
print(string);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerDados[i][pAdmin] >= 1 || IsPlayerAdmin(i))
{
SendClientMessage(i, -1,string);
}
}
return 1;
}
CMD:daradmin(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 1000) return SendClientMessage(playerid,-1,"Vocк nгo pode usar esse comando.");
if(sscanf(params,"ud", giveplayerid, nivel)) return SendClientMessage(playerid, -1, "Use: /daradmin [ID/Nome] [Level]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo estб conectado.");
if(nivel < 1 || nivel > 1000) return SendClientMessage(playerid,-1,"Os niveis sгo de 1 a 1000 (Para tirar admin use /tiraradmin)");
PlayerDados[giveplayerid][pAdmin] = nivel;
new string[100];
format(string,sizeof(string),"{14E5FF}%s{FFFAFA} deu nivel {14E5FF}%d {FFFAFA}de administrador para {14E5FF}%s", PlayerName(playerid), nivel, PlayerName(giveplayerid));
SendClientMessageToAll(-1,string);
print(string);
SalvarPlayer(giveplayerid);
return 1;
}
CMD:admins(playerid, params[])
{
SendClientMessage(playerid,0xFFF00093,"|============== Admins Online ============ |");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerDados[i][pAdmin] >= 1)
{
new string[50];
format(string,sizeof(string),"[Admin: %d] {F6E500}%s", PlayerDados[i][pAdmin], PlayerName(i));
SendClientMessage(playerid,-1,string);
}
}
SendClientMessage(playerid,0xFFF00093,"|===========================================|");
return 1;
}
CMD:relatorio(playerid, params[])
{
ShowPlayerDialog(playerid, DIALOG_RELATORIO, DIALOG_STYLE_INPUT,"[Nome do server] - Relбtorio","Digite seu relбtorio","Enviar","Cancelar");
return 1;
}
CMD:darvip(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 1000) return SendClientMessage(playerid,-1,"Vocк nгo pode usar esse comando.");
if(sscanf(params,"ud", giveplayerid, nivel)) return SendClientMessage(playerid, -1, "Use: /darvip [ID/Nome] [Level]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo estб conectado.");
if(nivel < 1 || nivel > 3) return SendClientMessage(playerid,-1,"Os niveis sгo de 1 a 3(Para tirar o vip use /tirarvip)");
PlayerDados[giveplayerid][pVIP] = nivel;
new string[100];
format(string,sizeof(string),"{14E5FF}%s {FFFAFA}deu nivel {14E5FF}%d {FFFAFA}de VIP para {14E5FF}%s", PlayerName(playerid), nivel, PlayerName(giveplayerid));
SendClientMessage(giveplayerid,-1,string);
print(string);
SalvarPlayer(giveplayerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerDados[i][pAdmin] >= 1 || IsPlayerAdmin(i))
{
SendClientMessage(i, -1,string);
}
}
return 1;
}
CMD:aviso(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"Vocк nгo pode usar esse comando.");
if(params[0] == 1) return SendClientMessage(playerid,-1,"Use: {F6E500}/av(iso) [texto]");
new string[150];
format(string, sizeof(string),"{FFD700}Admin %s: {FFFAFA}%s",PlayerName(playerid),params);
SendClientMessageToAll(-1,string);
return 1;
}
CMD:av(playerid, params[])
{
cmd_aviso(playerid,params);
return 1;
}
CMD:kick(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"Vocк precisa estar logado na RCON ou ser admin level 2.");
new motivo[60];
if(sscanf(params,"us", giveplayerid, motivo)) return SendClientMessage(playerid,-1,"Use: /kick [ID/Nome] [Motivo]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo estб conectado.");
new string[140];
format(string,sizeof(string),"{00BFFF}%s {FFFAFA}foi kickado por {00BFFF}%s{FFFAFA}. Motivo: {00BFFF}%s", PlayerName(giveplayerid), PlayerName(playerid), motivo);
SendClientMessageToAll(-1,string);
Kick(giveplayerid);
return 1;
}
CMD:ban(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"Vocк precisa estar logado na RCON ou ser admin level 3.");
new motivo[60];
if(sscanf(params,"us", giveplayerid, motivo)) return SendClientMessage(playerid,-1,"Use: /ban [ID/Nome] [Motivo]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo estб conectado.");
new string[140];
format(string,sizeof(string),"{F6E500}%s {FFFAFA}foi banido por {F6E500}%s{FFFAFA}. Motivo: {F6E500}%s", PlayerName(giveplayerid), PlayerName(playerid), motivo);
SendClientMessageToAll(-1,string);
Ban(giveplayerid);
return 1;
}
CMD:setskin(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"Vocк precisa estar logado na RCON ou ser admin level 2.");
new skin;
if(sscanf(params,"ud", giveplayerid, skin)) return SendClientMessage(playerid,-1,"Use: /setskin [ID] [Skin]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo estб conectado.");
new string[120];
format(string,sizeof(string),"{FF4040}%s {FFFAFA}trocou a skin de {FF4040}%s {FFFAFA}para {FF4040}%d", PlayerName(playerid), PlayerName(giveplayerid), skin);
SendClientMessage(playerid,-1,string);
SendClientMessage(giveplayerid,-1,string);
SetPlayerSkin(giveplayerid,skin);
return 1;
}
CMD:ir(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"Vocк precisa estar logado na RCON ou ser admin level 2.");
if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid,-1,"Use: /ir [ID]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo conectado.");
new Float:X,Float:Y, Float:Z;
new intgiveplayerid = GetPlayerInterior(giveplayerid);
GetPlayerPos(giveplayerid, X,Y,Z);
SetPlayerPos(playerid, X+1, Y,Z);
SetPlayerInterior(playerid, intgiveplayerid);
new string[80];
format(string,sizeof(string),"%s foi atй %s", PlayerName(playerid), PlayerName(giveplayerid));
SendClientMessage(playerid,-1,string);
SendClientMessage(giveplayerid,-1,string);
return 1;
}
CMD:trazer(playerid, params[])
{
if(!IsPlayerAdmin(playerid) && PlayerDados[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"Vocк precisa estar logado na RCON ou ser admin level 2.");
if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid,-1,"Use: /trazer [ID]");
if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid,-1,"Jogador nгo conectado.");
new Float:X,Float:Y, Float:Z;
new intplayerid = GetPlayerInterior(playerid);
GetPlayerPos(playerid, X,Y,Z);
SetPlayerPos(giveplayerid, X+1, Y,Z);
SetPlayerInterior(giveplayerid, intplayerid);
new string[90];
format(string,sizeof(string),"%s levou %s atй ele(a).", PlayerName(playerid), PlayerName(giveplayerid));
SendClientMessage(playerid,-1,string);
SendClientMessage(giveplayerid,-1,string);
return 1;
}
CMD:gmx(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"Vocк nгo й administrador.");
for(new i = 0; i < MAX_PLAYERS; i++)
{
SalvarPlayer(i);
GameTextForPlayer(i,"GMX... Nao saia do servidor", 2000, 4);
SendRconCommand("gmx");
}
return 1;
}
CMD:jfsvelocimetro(playerid, params[])
{
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,0xAFAFAFAA,"Vocк Nгo Esta Em um Veiculo.");
if(!NoPosto(playerid)) return SendClientMessage(playerid,0xAFAFAFAA,"Vocк Nгo Esta Em um Posto De Combustivel");
ShowPlayerDialog(playerid, 4567, DIALOG_STYLE_LIST, "Posto de Combustнvel - Painel", "Abastecer Veiculo\nBlindar Veiculo - 3.000R$", "Selecionar", "Cancelar");
return true;
}
CMD:sairveiculo(playerid, params[])
{
if(SemGasolina[playerid] == 1)
{
TogglePlayerControllable(playerid, 1);
RemovePlayerFromVehicle(playerid);
SemGasolina[playerid] = 0;
}
return true;
}
CMD:infernus(playerid, params[])
{
new Float:X5, Float:Y5, Float:Z5, Float:A5;
GetPlayerPos(playerid, X5, Y5, Z5);
CreateVehicle(411, X5+2, Y5, Z5, A5, 6, 0, 100);
new pName[MAX_PLAYER_NAME];//opcional
GetPlayerName(playerid,pName,sizeof(pName));//opcional
new string[128];//opcional
format(string,sizeof(string),"%s fez spawn de um Infernus",pName);//opcional
SendClientMessageToAll(0xFF9900AA, string);//opcional
return 1;
}
//==============================================================
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_REGISTRO)
{
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_STYLE_INPUT,"[NOME] - Registro","Digite uma senha para se registrar","Registrar","Cancelar");
if(strlen(inputtext) < 3 || strlen(inputtext) > 15) return ShowPlayerDialog(playerid,DIALOG_REGISTRO,DIALOG_STYLE_INPUT,"[NOME] - Registro","A senha deve ter de 3 a 15 caracteres","Registrar","Cancelar");
new string[70];
format(string,sizeof(string),"Conta registrada com sucesso! Senha: {F6E500}%s", inputtext);
SendClientMessage(playerid,-1,string);
DOF2_CreateFile(ReturnFileUser(playerid));
DOF2_SetString(ReturnFileUser(playerid),"Senha",inputtext);
DOF2_SaveFile();
SetSpawnInfo(playerid, 0, 0, 1722.5123, -1912.7931, 13.5647, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
GivePlayerMoney(playerid, 1000);
SetPlayerScore(playerid,1);
}
else if(!response)
{
SendClientMessage(playerid,-1,"Vocк foi kickado por nгo se registrar.");
Kick(playerid);
}
return 1;
}
if(dialogid == DIALOG_LOGIN)
{
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"[NOME] - Login","Digite sua senha","Logar","Cancelar");
if(strcmp(inputtext,DOF2_GetString(ReturnFileUser(playerid),"Senha"),true) == 0)
{
SetSpawnInfo(playerid, 0, 0, 1722.5123, -1912.7931, 13.5647, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
GivePlayerMoney(playerid, 1000);
CarregarPlayer(playerid);
SendClientMessage(playerid,0x2CB60AAA,"<!>Logado com sucesso!");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
}
else
{
if(SenhaErrada[playerid] == 4)
{
SendClientMessage(playerid,0xC5B43AAA,"Vocк foi banido por errar a senha 5 vezes.");
Ban(playerid);
}
else if(SenhaErrada[playerid] < 4)
{
SenhaErrada[playerid] ++;
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"[NOME] - Login","Senha incorreta, tente novamente. Se errar a senha 5 vezes serб banido!","Logar","Sair");
}
}
}
else if(!response)
{
SendClientMessage(playerid,0xC5B43AAA,"Vocк foi kickado por nгo logar");
Kick(playerid);
}
return 1;
}
if(dialogid == DIALOG_MUDAR_NICK)
{
if(!response) return SendClientMessage(playerid,0xC5B43AAA,"Vocк cancelou a troca do nick.");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_MUDAR_NICK, DIALOG_STYLE_INPUT,"[Nome do server] - Mudanзa de nick","Digite seu novo nick","Trocar","Cancelar");
new arq[70];
format(arq,sizeof(arq),"Contas/%s.ini", inputtext);
if(fexist(arq)) return ShowPlayerDialog(playerid,DIALOG_MUDAR_NICK,DIALOG_STYLE_INPUT, "[Nome do server] - Mudanзa de nick","ERRO: Esse nick jб existe","Trocar","Cancelar");
new string[60];
if(fexist(ReturnFileUser(playerid)))
{
new string2[50];
format(string2,sizeof(string2),"Contas/%s.ini", inputtext);
DOF2_RenameFile(ReturnFileUser(playerid),string2);
DOF2_SaveFile();
}
format(string, sizeof(string), "Parabйns! Seu novo nome й {FFFF34}%s", inputtext);
SendClientMessage(playerid, -1, string);
SetPlayerName(playerid, inputtext);
Autorizado[playerid] = false;
return 1;
}
if(dialogid == DIALOG_MUDAR_SENHA)
{
if(!response) return SendClientMessage(playerid,0xC5B43AAA,"Vocк cancelou a troca da senha.");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_MUDAR_SENHA,DIALOG_STYLE_INPUT,"[Nome do server] - Mudanзa de senha","Digite sua nova senha.","Trocar","Cancelar");
if(fexist(ReturnFileUser(playerid)))
{
DOF2_SetString(ReturnFileUser(playerid),"Senha",inputtext);
DOF2_SaveFile();
}
new string[60];
format(string, sizeof(string), "Parabйns! Sua nova senha й {FFFF34}%s", inputtext);
SendClientMessage(playerid, -1, string);
return 1;
}
if(dialogid == DIALOG_RELATORIO)
{
if(!response) return SendClientMessage(playerid,-1,"Vocк cancelou o envio do relбtorio.");
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_RELATORIO, DIALOG_STYLE_INPUT,"[Nome do server] - Relбtorio","Digite seu relбtorio","Enviar","Cancelar");
new string[160];
format(string,sizeof(string),"Relбtorio de %s: {25E500}%s",PlayerName(playerid), inputtext);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerDados[i][pAdmin] > 1 || IsPlayerAdmin(i))
{
if(PlayerDados[playerid][pVIP] >= 1) return SendClientMessage(i,0x00FF40AA, string);// vai mandar a mensagem com uma cor mais bonitinha se for vip
else if(PlayerDados[playerid][pVIP] < 1) return SendClientMessage(i, -1, string);//se nao for vip a mensagem sera mandada com a cor branca
}
}
return 1;
}
if(dialogid == 4567)
{
if(response)
{
if(listitem == 0)
{
olddistance = 999999;
for(new i = 0; i < sizeof(LocaisGAS); i++)
{
GasX = LocaisGAS[i][0];
GasY = LocaisGAS[i][1];
GasZ = LocaisGAS[i][2];
newdistance = DistanciaPosto(playerid,GasX,GasY,GasZ);
if (newdistance < olddistance)
{
olddistance = newdistance;
closest = i;
}
}
GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Abastecendo Veiculo Aguarde",2000,3);
SetTimer("JFSAC", 5000,0);
gGasBiz[playerid] = closest+12;
Abastecendo[playerid] = 1;
new l,pn,pa,po;
new vehicle = GetPlayerVehicleID(playerid);
GetVehicleDamageStatus(vehicle,pa,po,l,pn);
UpdateVehicleDamageStatus(vehicle, pa, po, l, 0);
return true;
}
else if(listitem == 1)
{
new vehicle = GetPlayerVehicleID(playerid);
GameTextForPlayer(playerid,"~r~~n~~n~~n~~n~~n~~n~~n~~n~~n~~>~BLINDADO! ~<~",2000,3);
Blindagem[vehicle] = BlindagemMAX;
SendClientMessage(playerid, -1, "Vocк Gastou 3.000R$ Para Blindar o seu Veiculo !");
GivePlayerMoney(playerid, - 3000);
return true;
}
}
return true;
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
return 1;
}
public Float:DistanciaPosto(p1,Float:px,Float:py,Float:pz)
{
if(!IsPlayerConnected(p1))
return -1.00;
GetPlayerPos(p1,x1,y1,z1);
x2 = px;
y2 = py;
z2 = pz;
return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
}
public NoPosto(playerid)
{
if(IsPlayerConnected(playerid))
{
if(IsPlayerInRangeOfPoint(playerid,6.0,1004.0070,-939.3102,42.1797) || IsPlayerInRangeOfPoint(playerid,6.0,1944.3260,-1772.9254,13.3906))
{//LS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,6.0,-90.5515,-1169.4578,2.4079) || IsPlayerInRangeOfPoint(playerid,6.0,-1609.7958,-2718.2048,48.5391))
{//LS
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,6.0,-2029.4968,156.4366,28.9498) || IsPlayerInRangeOfPoint(playerid,8.0,-2408.7590,976.0934,45.4175))
{//SF
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,5.0,-2243.9629,-2560.6477,31.8841) || IsPlayerInRangeOfPoint(playerid,8.0,-1676.6323,414.0262,6.9484))
{//Between LS and SF
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,6.0,2202.2349,2474.3494,10.5258) || IsPlayerInRangeOfPoint(playerid,10.0,614.9333,1689.7418,6.6968))
{//LV
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,8.0,-1328.8250,2677.2173,49.7665) || IsPlayerInRangeOfPoint(playerid,6.0,70.3882,1218.6783,18.5165))
{//LV
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,8.0,2113.7390,920.1079,10.5255) || IsPlayerInRangeOfPoint(playerid,6.0,-1327.7218,2678.8723,50.0625))
{//LV
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,8.0,2146.5759,2750.8442,10.6447) || IsPlayerInRangeOfPoint(playerid,6.0,2146.8779,2739.6157,10.6435))
{//LV2
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,8.0,1595.3046,2191.1331,10.6454) || IsPlayerInRangeOfPoint(playerid,6.0,1596.3274,2206.7070,10.6449))
{//LV3
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,8.0,-736.9305,2742.6138,47.0158))
{//Landtankstelle
return 1;
}
}
return 0;
}
public CheckGas()
{
for(new i=0;i<MAXPLAYERSJFS;i++)
{
if(IsPlayerConnected(i))
{
new vehicle = GetPlayerVehicleID(i);
if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
if(Gas[vehicle] >= 1)
{
Gas[vehicle]--;
}
if(Gas[vehicle] < 1)
{
SemGasolina[i] = 1;
TogglePlayerControllable(i, 0);
SendClientMessage(i, -1, "Acabou a Gasolina ! Use /sairveiculo Para sair do veiculo");
}
}
}
}
return 1;
}
public PararVeiculo()
{
for(new i=0; i<MAXPLAYERSJFS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
GetPlayerPos(i, x, y, z);
distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
Valor = floatround(distance * 3600);
if(UpdateSeconds > 1)
{
Valor = floatround(Valor / UpdateSeconds);
}
if(Valor == 0)
{
Gas[GetPlayerVehicleID(i)]++;
Desgaste[GetPlayerVehicleID(i)]++;
}
SavePlayerPos[i][LastX] = x;
SavePlayerPos[i][LastY] = y;
SavePlayerPos[i][LastZ] = z;
}
}
}
return 1;
}
public JFSAC()
{
for(new i=0; i<MAXPLAYERSJFS; i++)
{
if(IsPlayerConnected(i))
{
if(Abastecendo[i] == 1)
{
JFSAACC = GasMAX - Gas[GetPlayerVehicleID(i)];
JFSACPreco = JFSAACC * 10;
if(GetPlayerMoney(i) >= JFSACPreco)
{
Gas[GetPlayerVehicleID(i)] += JFSAACC;
format(Celula,sizeof(Celula),"Vocк Abasteceu Seu Veiculo Por $%d .",JFSACPreco);
SendClientMessage(i,0x33CCFFAA, Celula);
GivePlayerMoney(i,-JFSACPreco);
if(JFSACPreco > 0)
JFSACPreco = 0;
Abastecendo[i] = 0;
}
else
{
format(Celula,sizeof(Celula),"Vocк Nгo Tem $%d Para Abastecer Seu Veiculo",JFSACPreco);
SendClientMessage(i,0x33CCFFAA,Celula);
}
}
if(ArrumandoPneu[i] == 1)
{
if(GetPlayerMoney(i) >= 2000)
{
Desgaste[GetPlayerVehicleID(i)] = 100;
format(Celula,sizeof(Celula),"Vocк Consertou o Pneu do Seu Veiculo Por 200R$.");
SendClientMessage(i,0x33CCFFAA, Celula);
GivePlayerMoney(i, -2000);
}
else
{
format(Celula,sizeof(Celula),"Vocк Nгo Tem 200R$ Para Consertar o Pneu do Seu Veiculo");
SendClientMessage(i,0x33CCFFAA,Celula);
}
}
}
}
return 1;
}
stock GetPlayerSpeed(playerid)
{
new Float:ST[4];
if(IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 179.28625;
return floatround(ST[3]);
}
forward AtualizarVelocimetro(playerid);
public AtualizarVelocimetro(playerid)
{
if(Velocimetro == true)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vehicleid = GetPlayerVehicleID(playerid);
new CVel[200], Float:SangueV;
GetVehicleHealth(vehicleid, SangueV);
format(CVel,sizeof(CVel),"~p~%d ~g~KM/H~n~~p~KM Percorrido: ~g~%d~n~~p~Veiculo: ~g~%s~n~~p~Lataria: ~g~%d%%~n~~p~Gasolina: ~g~%d%%~n~~p~Blindagem ~g~%d%", GetPlayerSpeed(playerid), KMP[vehicleid], NomesVeiculos[GetVehicleModel(vehicleid)-400], floatround(SangueV)/10, Gas[vehicleid], Blindagem[vehicleid]);
TextDrawSetString(Text:TextDrawJFS[playerid], CVel);
}
else
{
TextDrawHideForPlayer(playerid, Text:TextDrawJFS[playerid]);
TextDrawHideForPlayer(playerid, Text:TextDrawJFSV[playerid]);
Velocimetro = false;
}
}
return true;
}
forward Kilometragem(playerid);
public Kilometragem(playerid)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehicle = GetPlayerVehicleID(playerid);
static Float:PosX,Float:PosY,Float:PosZ;
GetVehicleVelocity(vehicle, PosX, PosY, PosZ);
KMP[vehicle] += (floatround(floatmul(((floatmul(floatsqroot(floatadd(floatadd(floatpower(PosX, 2), floatpower(PosY, 2)), floatpower(PosZ, 2))), 170.0) * 1)),1000)) / 3600);
}
return true;
}
stock ReturnFileUser(playerid)
{
new File[156],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,sizeof(Name));
format(File,sizeof(File),FileUsers,Name);
return File;
}
stock SalvarPlayer(playerid)
{
if(DOF2_FileExists(ReturnFileUser(playerid)))
{
DOF2_SetInt(ReturnFileUser(playerid),"Level",GetPlayerScore(playerid));
DOF2_SetInt(ReturnFileUser(playerid),"Dinheiro",GetPlayerMoney(playerid));
DOF2_SetInt(ReturnFileUser(playerid),"Admin Level",PlayerDados[playerid][pAdmin]);
DOF2_SetInt(ReturnFileUser(playerid),"Skin",GetPlayerSkin(playerid));
DOF2_SetInt(ReturnFileUser(playerid),"VIP", PlayerDados[playerid][pVIP]);
DOF2_SaveFile();
}
}
stock CarregarPlayer(playerid)
{
if(DOF2_FileExists(ReturnFileUser(playerid)))
{
SetPlayerScore(playerid, DOF2_GetInt(ReturnFileUser(playerid), "Level"));
SetPlayerMoney(playerid, DOF2_GetInt(ReturnFileUser(playerid), "Dinheiro"));
PlayerDados[playerid][pAdmin] = DOF2_GetInt(ReturnFileUser(playerid),"Admin Level");
SetPlayerSkin(playerid, DOF2_GetInt(ReturnFileUser(playerid),"Skin"));
PlayerDados[playerid][pVIP] = DOF2_GetInt(ReturnFileUser(playerid),"VIP");
}
}
stock PlayerName(playerid)
{
new Name[MAX_PLAYERS];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
stock SetPlayerMoney(playerid,ammount)
{
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,ammount);
return 1;
}
Obrigado!