CMD:gmx(playerid,params[]){
if(PlayerInfo[playerid][Staff] < 1) return MSG(playerid, COR_INPUT, "Vocк nгo estб altorizado a usar este comando..");
if(Atendendo[playerid] == false && PlayerInfo[playerid][Staff] < 5) return MSG(playerid,COR_INPUT, "Vocк estб modo jogo use: /atendimento.");
foreach(new x : Player){
SalvarPlayer(x);
}
SendRconCommand("GMX");
return 1;
}
stock SalvarPlayer(playerid){
new file[70],Float:Pos[3];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
PlayerInfo[playerid][Interior] = GetPlayerInterior(playerid);
PlayerInfo[playerid][nX] = Pos[0];
PlayerInfo[playerid][nY] = Pos[1];
PlayerInfo[playerid][nZ] = Pos[2];
format(file,sizeof(file),"Players/%s.ini",Nome(playerid));
DOF2_SetInt(file,"Staff",PlayerInfo[playerid][Staff]);
DOF2_SetInt(file,"Matou",PlayerInfo[playerid][Matou]);
DOF2_SetInt(file,"Morreu",PlayerInfo[playerid][Morreu]);
DOF2_SetInt(file,"Dinheiro",PlayerInfo[playerid][Dinheiro]);
DOF2_SetInt(file,"Ouro",PlayerInfo[playerid][Ouro]);
DOF2_SetFloat(file,"X",PlayerInfo[playerid][nX]);
DOF2_SetFloat(file,"Y",PlayerInfo[playerid][nY]);
DOF2_SetFloat(file,"Z",PlayerInfo[playerid][nZ]);
DOF2_SetString(file,"Cor",PlayerInfo[playerid][CorPlayer]);
DOF2_SetInt(file,"Skin",PlayerInfo[playerid][Skin]);
DOF2_SetInt(file,"Estudo",PlayerInfo[playerid][Estudo]);
DOF2_SetInt(file,"Origem",PlayerInfo[playerid][Origem]);
DOF2_SetInt(file,"Sexo",PlayerInfo[playerid][Sexo]);
DOF2_SetInt(file,"Tutorial",PlayerInfo[playerid][Tutorial]);
DOF2_SetInt(file,"Interior",PlayerInfo[playerid][Interior]);
DOF2_SetInt(file,"Emprego",PlayerInfo[playerid][Emprego]);
DOF2_SaveFile();
return 1;
}
|
na public OnGameModeExit() tem a funзгo para salvar as contas?
|
|
Eu entendi perfeitamente, eu tive esse problema, porque na public OngameModeExit eu estava salvando as contas dos jogadores, todas as demais vбriaveis salvavam, menos a posiзгo..
Por isso eu lhe perguntei se vocк estб ou nгo salvando a conta dos jogadores. E entгo? Vocк estб ou nгo? |
|
Entгo faзa isso aqui;
//topo do gm new nao_salvar; //OnGameModeInit nao_salvar = 1; //no comando quando der GMX nao_salvar = 2; //OnGameModeExit if(nao_salvar == 1) { //funcao para salvar as contas } Explicando.. Quando o GM inicio a variбvel й definida como 1, e o OnGameModeExit sу vai salvar a posiзгo se o valor da variбvel for == 1, se for != do que 1 ele nгo salva. Testa assim, eu tive o mesmo problema, e resolveu. |