[Ajuda] Reset quando Sai
#1

Gente estou com um problema no meu GM, Que e o seguinte. Quando uma Pessoa Sai, as vezes buga, o dinheiro dela some, e se ela for adm o ADM dela tb some. Alguem sabe como arrumar isso?
Reply
#2

Quote:
Originally Posted by Darknino
Посмотреть сообщение
Gente estou com um problema no meu GM, Que e o seguinte. Quando uma Pessoa Sai, as vezes buga, o dinheiro dela some, e se ela for adm o ADM dela tb some. Alguem sabe como arrumar isso?
Sabe qual o problema? O problema й que vocк usa um gm bugado, de algum servidor, vocк limitou-se apenas a editar e depois dб nisso.

Envie o cуdigo que salva o jogador para tentar analisar o problema.
Reply
#3

Quote:
Originally Posted by Darknino
Посмотреть сообщение
Gente estou com um problema no meu GM, Que e o seguinte. Quando uma Pessoa Sai, as vezes buga, o dinheiro dela some, e se ela for adm o ADM dela tb some. Alguem sabe como arrumar isso?
Da uma olhada no public OnPlayerDisconnect, talvez nao ta salvando as informaзхes do player.
Reply
#4

Isso e so as vezes gente
Aqui toda minha Public

Код:
public OnPlayerDisconnect(playerid, reason)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_CONTAS, aname);
dini_IntSet(file, "Admin", pAdmin[playerid]);
new Pname[MAX_PLAYER_NAME];
new string[256];
GetPlayerName(playerid, Pname, sizeof(Pname));
switch(reason)
{
case 0: format(string, sizeof(string), "~ %s saiu do servidor {FF0000}[Problemas de conexгo]", Pname);
case 1: format(string, sizeof(string), "~ %s saiu do servidor {FF0000} [Saiu do Servidor]", Pname);
case 2: format(string, sizeof(string), "~ %s saiu do servidor {FF0000}[kick / Banido]", Pname);
}
Mute[playerid] = 0;
SendClientMessageToAll(C_Temac, string);
TextDrawHideForPlayer(playerid, Relogio);
new Interior;
Interior = GetPlayerInterior(playerid);
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
CPSERVICE_actualcp[playerid] = 0;
new grana;
grana = GetPlayerGrana(playerid);
dini_IntSet(file, "Dinheiro", grana);
dini_IntSet(file,"Continuar",1);
dini_FloatSet(file,"ContinuarX",Float:X);
dini_FloatSet(file,"ContinuarY",Float:Y);
dini_FloatSet(file,"ContinuarZ",Float:Z);
dini_IntSet(file,"ContinuarI",Interior);
dini_IntSet(file, "convitent", 0);
dini_IntSet(file, "Entrevista", 0);
dini_IntSet(file,"aAdmin",0);
if(pAdmin[playerid] == 1 || pAdmin[playerid] == 2 || pAdmin[playerid] == 3 || pAdmin[playerid] == 4 || pAdmin[playerid] == 5)
{
new AdminName[MAX_PLAYER_NAME];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
format(string, sizeof(string), "~r~%s: ~b~ADM ~y~Saiu !", AdminName);
for(new i=0; i<MAX_PLAYERS; i++)
{
GameTextForPlayer(i, string , 5000, 3);
}
}
if(InCall[playerid]==1)
{
if(playerid==sender)
{
InCall[gc]=0,GetCall[gc]=0; InCall[sender]=0,GetCall[sender]=0;
SetPlayerSpecialAction(gc,SPECIAL_ACTION_STOPUSECELLPHONE);
format(str3,128,"%s desligou o celular!",GetName(sender));
SendClientMessage(gc,GRAY,str3);
} else if(playerid == gc)
{
InCall[gc]=0,GetCall[gc]=0; InCall[sender]=0,GetCall[sender]=0;
SetPlayerSpecialAction(sender,SPECIAL_ACTION_STOPUSECELLPHONE);
format(str3,128,"%s estб fora de area por sair da Cidade!",GetName(gc));
SendClientMessage(sender,GRAY,str3);
}
}
minutos[playerid] = 0;
Conversa[playerid] = 0;
NaFaculdade[playerid] = 0;
return 1;
}
Reply
#5

Nao seria mais facil no lugar de GetPlayerGrana(playerid) colocar GetPlayerMoney(playerid) й muito mais confiavel.

Acrescenta isso no onplayerdisconnect:

pawn Код:
dini_IntSet(file,"NivelAdmin",pAdmin[playerid]);//vai salvar o nivel admin

Agora no public OnPlayerSpawn:

pawn Код:
pAdmin[playerid]=dini_Int(file, "NivelAdmin");//vai pegar o nivel de admin salvo
Reply
#6

Nao sei muito como trocar essa grana por Money. E so ir la e trocar isso ai dogeito que vc falo ou tem que fazer mais coisas?
Reply
#7

Quote:
Originally Posted by BlueX
Посмотреть сообщение
Sabe qual o problema? O problema й que vocк usa um gm bugado, de algum servidor, vocк limitou-se apenas a editar e depois dб nisso.

Envie o cуdigo que salva o jogador para tentar analisar o problema.
nossa. xorei.
Reply
#8

Quote:
Originally Posted by BlueX
Посмотреть сообщение
Sabe qual o problema? O problema й que vocк usa um gm bugado, de algum servidor, vocк limitou-se apenas a editar e depois dб nisso.

Envie o cуdigo que salva o jogador para tentar analisar o problema.
OMG O.O

nao ha palavras mais Sabias O.O
Reply
#9

Quote:
Originally Posted by Darknino
Посмотреть сообщение
Nao sei muito como trocar essa grana por Money. E so ir la e trocar isso ai dogeito que vc falo ou tem que fazer mais coisas?
Troca o GetPlayerGrana(playerid) por GetPlayerMoney(playerid) ------ й a mesma coisa, so que eu uso o getplayermoney

so trocar mesmo, me avise se deu certo ou nao
Reply
#10

deu sim vlws
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)