if(newstate == PLAYER_STATE_DRIVER)
{
new string[256];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
for(new carro = 0; carro < MAX_CARROS; carro++)
{
new vid;
vid = GetPlayerVehicleID(playerid);
format(string, sizeof(string), "carro%d.ini", carro);
if(dini_Exists(string)){
if(vid == dini_Int(string, "Id")){
if(dini_Int(string, "TDono") == 1){
if(strcmp(dini_Get(string, "Dono"), pname, true) == 0){
SendClientMessage(playerid, Azul, "Brasil Realidade Cruel RPG - Este carro й seu, seja bem vindo !");
} else {
format(string, sizeof(string), "Brasil Realidade Cruel RPG - Este carro nгo й seu, й de: %s", dini_Get(string, "Dono"));
SendClientMessage(playerid, Azul, string);
for(new i=0; i<MAX_PLAYERS; i++){
if(IsPlayerConnected(i)){
new nome[MAX_PLAYER_NAME];
GetPlayerName(i, nome, sizeof(nome));
if(strcmp(dini_Get(string, "Dono"), nome, true) == 0 && GetPlayerVehicleID(playerid) == dini_Int(string, "Id")){
format(string, sizeof(string), "Brasil Realidade Cruel RPG - ALARME: %s(Id:%d) tentou roubar seu carro.", pname, playerid);
SendClientMessage(i, tcadm, string);
}
}
}
RemovePlayerFromVehicle(playerid);
}
if(strcmp(cmd, "/liberarnick", true) == 0) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5 || pAdmin[playerid] == 6){
new plid;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Digite: /liberarnick [id]");
return 1;
}
plid = strval(tmp);
new pname[MAX_PLAYER_NAME];
GetPlayerName(plid, pname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, pname);
if(IsPlayerConnected(plid)){
dini_IntSet(file, "MN", 1);
format(string, sizeof(string), "(INFO) Vocк liberou o jogador %s mudar de nick!", aname, playerid, pname);
SendClientMessage(playerid, Blue, string);
format(string, sizeof(string), "(INFO) O administrador %s (ID: %d) liberou vocк mudar de nick!", aname, playerid);
SendClientMessage(plid, tcadm, string);
GameTextForPlayer(plid, "~r~~g~/trocarnick", 8000, 3);
return 1;
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) ID invбlido");
return 1;
}
}
}
if(strcmp(cmdtext, "/trocarnick", true) == 0){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
if(PlayerInfo[playerid][Logged] == 0){
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб logado(a).");
return 1;
}
if(dini_Int(file, "MN") == 1){
ShowPlayerDialog(playerid,mudarnick , DIALOG_STYLE_INPUT, "Trocando de Nick", "Digite seu novo nick e clique em \"Mudar\". \n\n~ Brasil Realidade Cruel!.", "Mudar", "Sair");
}else{
SendClientMessage(playerid, Vermelho, "(ERRO) Pessa a um admin para te liberar a mudar de nick!");
}
return 1;
}
if(dialogid == mudarnick)
{
if(response == 1)
{
if(strlen(inputtext) <= 0)
{
SendClientMessage(playerid,Vermelho,"Vocк tem que digitar um novo Nick");
ShowPlayerDialog(playerid,mudarnick , DIALOG_STYLE_INPUT, "Mudar nick", "Digite seu novo nick e clique em \"Mudar\". \n\n .:: Brasil Realidade Cruel RPG ::.", "Mudar", "Sair");
return 1;
}
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(file, sizeof(file), PASTA_CONTAS, aname);
//Carrega nova conta
format(file, sizeof(file), PASTA_CONTAS, inputtext);
if(dini_Exists(file)){
SendClientMessage(playerid,Vermelho,"(INFO) O Nick que vocк escolheu jб existe!");
ShowPlayerDialog(playerid,mudarnick,DIALOG_STYLE_INPUT, "Mudar nick", "O Nick que vocк digitou jб existe\nEscolha outro e clique em \"Mudar\". \n\n .:: Brasil Realidade Cruel RPG ::.", "Mudar", "Sair");
} else {
for(new p = 0; p < MAX_PROPS; p++)
{
format(string, sizeof(string), "/Props/prop%d.ini", p);
if(strcmp(dini_Get(string, "Dono"), aname, false) == 0){
dini_Set(string, "Dono", inputtext);
}
}
for(new c = 0; c < MAX_CARROS; c++)
{
format(string, sizeof(string), "carro%d.ini", c);
if(strcmp(dini_Get(string, "Dono"), aname, false) == 0){
dini_Set(string, "Dono", inputtext);
}
}
new mnskin;
new mnprocurado;
new mnvip;
new mnguard;
new mnlutas;
new mnpreso;
new mnentrevista;
new mnsaldobancario;
new mnprof;
new mncel;
new mngrana;
new mnleveladmin;
//new mnleveladmin;
new mnbloco;
new mncombustivel;
new mnlevel;
new mntempo;
new mnexp;
new mnmp3;
new mncapacete;
new mnjetpack;
new mnporte;
new mncarteira;
new mnhabt;
new mnhabn;
new mnhaba;
new mncontabancaria;
new mndm;
new mncasax;
new mncasay;
new mncasaz;
new mnlembrete;
new mnfacul;
new mnroubobanco;
new mnhotel;
new mnluta;
new mnnovoestudo;
new mndotz;
new mntempodotz;
GivePlayerMoney(playerid, dini_Int(string, "Grana"));
//Pega Dados
mnskin = dini_Int(file, "Skin");
mnleveladmin = dini_Int(file, "LevelAdmin");
mngrana = dini_Int(file, "Grana");
mnprocurado = dini_Int(file, "Procurado");
mnvip = dini_Int(file, "VIP");
mnguard = dini_Int(file, "GUARD");
mnlutas = dini_Int(file, "Lutas");
mnpreso = dini_Int(file, "Preso");
mnentrevista = dini_Int(file,"Entrevista");
mnsaldobancario = dini_Int(file, "SaldoBancario");
mnprof = dini_Int(file, "Profissao");
mncel = dini_Int(file, "Celular");
mnbloco = dini_Int(file, "Bloco");
mncombustivel = dini_Int(file, "Combustivel");
mnlevel = dini_Int(file, "Level");
mntempo = dini_Int(file, "Tempo");
mnexp = dini_Int(file, "EXP");
mnmp3 = dini_Int(file, "MP3");
mncapacete = dini_Int(file, "CAPACETE");
mnjetpack = dini_Int(file, "JETPACK");
mnporte = dini_Int(file, "Porte");
mnporte = dini_Int(file, "Carteira");
mnhabt = dini_Int(file, "HabTerrestre");
mnhabn = dini_Int(file, "HabNautica");
mnhaba = dini_Int(file, "HabAerea");
mncontabancaria = dini_Int(file, "ContaBancaria");
mndm = dini_Int(file, "DM");
mncasax = dini_Int(file, "CasaX");
mncasay = dini_Int(file, "CasaY");
mncasaz = dini_Int(file, "CasaZ");
mnlembrete = dini_Int(file, "Lembrete");
mnfacul = dini_Int(file, "Faculdade");
mnroubobanco = dini_Int(file,"rouboubanco");
mnhotel = dini_Int(file, "Hotel");
mnluta = dini_Int(file, "Luta");
mnnovoestudo = dini_Int(file, "estudonovo");
mndotz = dini_Int(file, "Dotz");
mntempodotz = dini_Int(file, "TempoDotz");
//Apagar conta antiga
dini_Remove(file);
//criar nova conta
dini_Create(file);
SetPlayerName(playerid,inputtext);
//Salvar dados na nova conta
dini_IntSet(file, "Skin", mnskin);
dini_IntSet(file, "Procurado", mnprocurado);
dini_IntSet(file, "VIP", mnvip);
dini_IntSet(file, "GUARD", mnguard);
dini_IntSet(file, "Lutas", mnlutas);
dini_IntSet(file, "Preso", mnpreso);
dini_IntSet(file, "Entrevista", mnentrevista);
dini_IntSet(file, "SaldoBancario", mnsaldobancario);
dini_IntSet(file, "Profissao", mnprof);
dini_IntSet(file, "Celular", mncel);
dini_IntSet(file, "Bloco", mnbloco);
dini_IntSet(file, "Combustivel", mncombustivel);
dini_IntSet(file, "Level", mnlevel);
dini_IntSet(file, "Tempo", mntempo);
dini_IntSet(file, "EXP", mnexp);
dini_IntSet(file, "MP3", mnmp3);
dini_IntSet(file, "CAPACETE", mncapacete);
dini_IntSet(file, "JETPACK", mnjetpack);
dini_IntSet(file, "Porte", mnporte);
dini_IntSet(file, "LevelAdmin", mnleveladmin);
//dini_IntSet(file, "LevelAdm", mnleveladmin);
dini_IntSet(file, "Grana", mngrana);
dini_IntSet(file, "Carteira", mncarteira);
dini_IntSet(file, "HabTerrestre", mnhabt);
dini_IntSet(file, "HabNautica", mnhabn);
dini_IntSet(file, "HabAerea", mnhaba);
dini_IntSet(file, "ContaBancaria", mncontabancaria);
dini_IntSet(file, "DM", mndm);
dini_IntSet(file, "CasaX", mncasax);
dini_IntSet(file, "CasaY", mncasay);
dini_IntSet(file, "CasaZ", mncasaz);
dini_IntSet(file, "Lembrete", mnlembrete);
dini_IntSet(file, "Faculdade", mnfacul);
dini_IntSet(file, "rouboubanco", mnroubobanco);
dini_IntSet(file, "Hotel", mnhotel);
dini_IntSet(file, "Luta", mnluta);
dini_IntSet(file, "Dotz", mndotz);
dini_IntSet(file, "TempoDotz", mntempodotz);
dini_IntSet(file, "estudonovo", mnnovoestudo);
dini_IntSet(file, "LC", 0);
dini_IntSet(file, "MN", 0);
format(string, sizeof(string), "(INFO)O Player %s (ID: %d) Mudou seu nick para %s!", aname,playerid,inputtext);
SendClientMessageToAll(Blue,string);
ShowPlayerDialog(playerid, mudarnick2, DIALOG_STYLE_PASSWORD, "Senha", "Agora coloque a senha para sua\nnova conta e clique em\"Mudar\". \n\n .:: Brasil Realidade Cruel RPG ::.", "Mudar", "Sair");
}
}
}
if(dialogid == mudarnick2)
{
if(response == 1)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, sizeof(aname));
format(file, sizeof(file), PASTA_CONTAS, aname);
if(strlen(inputtext) < MIN_SENHA || strlen(inputtext) > MAX_SENHA)
{
format(STRX, sizeof(STRX), "(INFO) A senha deve ter entre %d e %d caracteres!", MIN_SENHA, MAX_SENHA);
SendClientMessage(playerid, Vermelho, STRX);
return 1;
}
dini_Set(file, "Senha", encrypt(inputtext));
SendClientMessage(playerid, Verde, "(INFO) Nick Alterado com sucesso!");
dini_IntSet(file, "MN", 0);
SendClientMessage(playerid, 0xFF952BAA, "» Agora mude seu nick no inicio no 'SA:MP'.");
SendClientMessage(playerid, 0xFFFFFFAA, "» E entre novamente com o novo nick.");
SendClientMessage(playerid, 0xFFFFFFAA, "» E se divirta.");
GameTextForPlayer(playerid,"~r~~h~Nick Alterado", 2500, 3);
}else{
ShowPlayerDialog(playerid, mudarnick2, DIALOG_STYLE_PASSWORD, "Senha", "Vocк ja comeзou a mudar seu nick\nAgora termine e ponhe uma senha para sua nova conta e clique em\"Mudar\". \n\n .:: Brasil Realidade Cruel RPG ::.", "Mudar Nick", "Sair");
}
}
new VipCar[0]; // Numero de Carros Vips.
VipCar[0] = CreateVehicle(560,1541.8882,-1674.9540,13.2660,0.2198,3,3,999999999); // Carro Criado
if(vId==VipCar[0]) // Id do Vip Car
{
new nome[24];
GetPlayerName(playerid, nome, sizeof nome);
if(strfind(nome, "Nome_Dapessoa", true) == 0) // Nink da unica pessoa que irб dirigir o carro
{
SendClientMessage(playerid,COLOR_YELLOW,"Bem vindo ao seu carro Nome_Dapessoa.");
return 1;
}
else
{
SendClientMessage(playerid,COLOR_RED,"Vocк nгo й o Nome_Dapessoa .");
RemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
return 1;
}
}
new vId = GetPlayerVehicleID(playerid);
if(newstate == PLAYER_STATE_DRIVER)
{
new string[256], pname[24],pname[24],str[100],vid;
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
for(new carro = 0; carro < MAX_CARROS; carro++)
{
vid = GetPlayerVehicleID(playerid);
format(string, sizeof(string), "carro%d.ini", carro);
if(dini_Exists(string))
{
if(vid == dini_Int(string, "Id"))
{
if(!strcmp(pname,dini_Get(string, "Dono"),false))
{
SendClientMessage(playerid, Azul, "Bem vindo ao seu carro!!");
}
else
{
RemovePlayerFromVehicle(playerid);
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerName(i, pname2, MAX_PLAYER_NAME);
if(!strcmp(pname2,dini_Get(string, "Dono"),false))
{
format(str,100,"Tentaram roubar seu carro!, nome do Meliante: %s",pname);
SendClientMessage(i, Azul, str);
}
}
}
}
}
}
}
1є tenta: pawn Код:
Voce ta fazendo coleзгo ![]() ja atй ti respondi isso noutro topico. sу colocar e usar.!! e outra.. num to encrencando.. + pelo amor de deus, Identa seus codigos!! fica dificio atй pra vc achar seus proprios erros imagina o pessoal do forum que tenta te ajudar?? as vezes vc encontra um erro sу de olhar na identaзгo como uma chave extra, ou faltando etc. por exemplo teu primeiro codigo tinha 4 chaves sem fechar!!! |
public OnPlayerStateChange(playerid, newstate, oldstate)
{