Nгo estб salvando os Lideres
#1

Ja tentei de tudo quanto й maneira, verifiquei se tinha algum erro no OnPlayerSave, e nгo achei, algume me ajuda por favor, toda vez q reinicio o server perde os lideres, adm fica, dinheiro fica, so sai o lider.

Codigo do OnPlayerSave
[center][spoiler]forward OnPlayerSave22(playerid);
public OnPlayerSave22(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[64];
new playername3[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername3, sizeof(playername3));
format(string3, sizeof(string3), "Contas/%s.ini", playername3);
new File: hFile = fopen(string3, io_write);
if (hFile)
{
new var[32];
format(var, 32, "Key=%s\n", PlayerInfo[playerid][pKey]);fwrite(hFile, var);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Level=%d\n",PlayerInfo[playerid][pLevel]);fwrite(hFile, var);
format(var, 32, "AdminLevel=%d\n",PlayerInfo[playerid][pAdmin]);fwrite(hFile, var);
format(var, 32, "HelperLevel=%d\n",PlayerInfo[playerid][pHelper]);fwrite(hFile, var);
format(var, 32, "DonateRank=%d\n",PlayerInfo[playerid][pVIP]);fwrite(hFile, var);
format(var, 32, "UpgradePoints=%d\n",PlayerInfo[playerid][gPupgrade]);fwrite(hFile, var);
format(var, 32, "ConnectedTime=%d\n",PlayerInfo[playerid][pConnectTime]);fwrite(hFile, var);
format(var, 32, "Registered=%d\n",PlayerInfo[playerid][pReg]);fwrite(hFile, var);
format(var, 32, "Sex=%d\n",PlayerInfo[playerid][pSex]);fwrite(hFile, var);
format(var, 32, "Muted=%d\n",PlayerInfo[playerid][pMuted]);fwrite(hFile, var);
format(var, 32, "Respect=%d\n",PlayerInfo[playerid][pExp]);fwrite(hFile, var);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pConta]);fwrite(hFile, var);
format(var, 32, "Crimes=%d\n",PlayerInfo[playerid][pCrimes]);fwrite(hFile, var);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 32, "Phonebook=%d\n",PlayerInfo[playerid][pPhoneBook]);fwrite(hFile, var);
format(var, 32, "LottoNr=%d\n",PlayerInfo[playerid][pLottoNr]);fwrite(hFile, var);
format(var, 32, "Emprego=%d\n",PlayerInfo[playerid][pEmprego]);fwrite(hFile, var);
format(var, 32, "Paycheck=%d\n",PlayerInfo[playerid][pSalario]);fwrite(hFile, var);
format(var, 32, "HeadValue=%d\n",PlayerInfo[playerid][pHeadValue]);fwrite(hFile, var);
format(var, 32, "HeadValueT=%d\n",PlayerInfo[playerid][pHeadValueT]);fwrite(hFile, var);
format(var, 32, "Jailed=%d\n",PlayerInfo[playerid][pJailed]);fwrite(hFile, var);
format(var, 32, "JailTime=%d\n",PlayerInfo[playerid][pJailTime]);fwrite(hFile, var);
format(var, 32, "Materiais=%d\n",PlayerInfo[playerid][pMats]);fwrite(hFile, var);
format(var, 32, "Maconha=%d\n",PlayerInfo[playerid][pDrogas]);fwrite(hFile, var);
format(var, 32, "Cocaina=%d\n",PlayerInfo[playerid][pDrogas2]);fwrite(hFile, var);
format(var, 32, "Crack=%d\n",PlayerInfo[playerid][pDrogas3]);fwrite(hFile, var);
format(var, 32, "Lider=%d\n",PlayerInfo[playerid][pLider]);fwrite(hFile, var);
format(var, 32, "Member=%d\n",PlayerInfo[playerid][pMembro]);fwrite(hFile, var);
format(var, 32, "Rank=%d\n",PlayerInfo[playerid][pCargo]);fwrite(hFile, var);
format(var, 32, "Char=%d\n",PlayerInfo[playerid][pSkin]);fwrite(hFile, var);
format(var, 32, "origin=%d\n",PlayerInfo[playerid][pOrigem]);fwrite(hFile, var);
format(var, 32, "ContractTime=%d\n",PlayerInfo[playerid][pContractTime]);fwrite(hFile, var);
format(var, 32, "DetSkill=%d\n",PlayerInfo[playerid][pDetSkill]);fwrite(hFile, var);
format(var, 32, "SexSkill=%d\n",PlayerInfo[playerid][pSexSkill]);fwrite(hFile, var);
format(var, 32, "BoxSkill=%d\n",PlayerInfo[playerid][pBoxSkill]);fwrite(hFile, var);
format(var, 32, "LawSkill=%d\n",PlayerInfo[playerid][pLawSkill]);fwrite(hFile, var);
format(var, 32, "MechSkill=%d\n",PlayerInfo[playerid][pMechSkill]);fwrite(hFile, var);
format(var, 32, "NewsSkill=%d\n",PlayerInfo[playerid][pNewsSkill]);fwrite(hFile, var);
format(var, 32, "DrogasSkill=%d\n",PlayerInfo[playerid][pDrogasSkill]);fwrite(hFile, var);
format(var, 32, "CookSkill=%d\n",PlayerInfo[playerid][pCookSkill]);fwrite(hFile, var);
format(var, 32, "pSHealth=%.1f\n",PlayerInfo[playerid][pSHealth]);fwrite(hFile, var);
format(var, 32, "Team=%d\n",PlayerInfo[playerid][pTeam]);fwrite(hFile, var);
format(var, 32, "PhoneNr=%d\n",PlayerInfo[playerid][pPnumber]);fwrite(hFile, var);
format(var, 32, "House=%d\n",PlayerInfo[playerid][pPHousekey]);fwrite(hFile, var);
format(var, 32, "Bizz=%d\n",PlayerInfo[playerid][pPbiskey]);fwrite(hFile, var);
format(var, 32, "Spawn=%d\n",PlayerInfo[playerid][pSpawn]);fwrite(hFile, var);
format(var, 32, "SafeMaconha=%d\n",PlayerInfo[playerid][pSafeDrogas]);fwrite(hFile, var);
format(var, 32, "SafeCocaina=%d\n",PlayerInfo[playerid][pSafeDrogas2]);fwrite(hFile, var);
format(var, 32, "SafeCrack=%d\n",PlayerInfo[playerid][pSafeDrogas3]);fwrite(hFile, var);
format(var, 32, "NivelProcurado=%d\n",WantedPoints[playerid]);fwrite(hFile, var);
format(var, 32, "SafeMateriais=%d\n",PlayerInfo[playerid][psMats]);fwrite(hFile, var);
format(var, 32, "TestVip=%d\n",PlayerInfo[playerid][pTimeVIP]);fwrite(hFile, var);
format(var, 32, "Age=%d\n",PlayerInfo[playerid][pAge]);fwrite(hFile, var);
format(var, 32, "Ouros=%d\n",PlayerInfo[playerid][pOuros]);fwrite(hFile, var);
format(var, 32, "Avisado=%d\n",PlayerInfo[playerid][pAviso]);fwrite(hFile, var);
format(var, 32, "Fome=%d\n",PlayerInfo[playerid][pFome]);fwrite(hFile, var);
format(var, 32, "PegouVIP=%d\n",PlayerInfo[playerid][pPVIP]);fwrite(hFile, var);
format(var, 32, "DiasBanTemp=%d\n",PlayerInfo[playerid][pDiaBanTemp]);fwrite(hFile, var);
format(var, 32, "MesBanTemp=%d\n",PlayerInfo[playerid][pMesBanTemp]);fwrite(hFile, var);
format(var, 32, "AnoBanTemp=%d\n",PlayerInfo[playerid][pAnoBanTemp]);fwrite(hFile, var);
format(var, 32, "DiasVIP=%d\n",PlayerInfo[playerid][pDiaVIP]);fwrite(hFile, var);
format(var, 32, "MesVIP=%d\n",PlayerInfo[playerid][pMesVIP]);fwrite(hFile, var);
format(var, 32, "AnoVIP=%d\n",PlayerInfo[playerid][pAnoVIP]);fwrite(hFile, var);
format(var, 32, "CarLic=%d\n",PlayerInfo[playerid][pCarLic]);fwrite(hFile, var);
format(var, 32, "FlyLic=%d\n",PlayerInfo[playerid][pFlyLic]);fwrite(hFile, var);
format(var, 32, "BoatLic=%d\n",PlayerInfo[playerid][pBoatLic]);fwrite(hFile, var);
format(var, 32, "GunLic=%d\n",PlayerInfo[playerid][pGunLic]);fwrite(hFile, var);
format(var, 32, "PayDay=%d\n",PlayerInfo[playerid][pPayDay]);fwrite(hFile, var);
format(var, 32, "CDPlayer=%d\n",PlayerInfo[playerid][pCDPlayer]);fwrite(hFile, var);
format(var, 32, "Wins=%d\n",PlayerInfo[playerid][pWins]);fwrite(hFile, var);
format(var, 32, "Loses=%d\n",PlayerInfo[playerid][pLoses]);fwrite(hFile, var);
format(var, 32, "AlcoholPerk=%d\n",PlayerInfo[playerid][pAlcoholPerk]);fwrite(hFile, var);
format(var, 32, "DrugPerk=%d\n",PlayerInfo[playerid][pDrugPerk]);fwrite(hFile, var);
format(var, 32, "MiserPerk=%d\n",PlayerInfo[playerid][pMiserPerk]);fwrite(hFile, var);
format(var, 32, "PainPerk=%d\n",PlayerInfo[playerid][pPainPerk]);fwrite(hFile, var);
format(var, 32, "TraderPerk=%d\n",PlayerInfo[playerid][pTraderPerk]);fwrite(hFile, var);
format(var, 32, "Tutorial=%d\n",PlayerInfo[playerid][pTut]);fwrite(hFile, var);
format(var, 32, "Avisos=%d\n",PlayerInfo[playerid][pWarns]);fwrite(hFile, var);
format(var, 32, "Married=%d\n",PlayerInfo[playerid][pMarried]);fwrite(hFile, var);
format(var, 32, "MarriedTo=%s\n",PlayerInfo[playerid][pMarriedTo]);fwrite(hFile, var);
format(var, 32, "Luta=%d\n",PlayerInfo[playerid][pLuta]);fwrite(hFile, var);
format(var, 32, "Dorgado=%d\n",PlayerInfo[playerid][pDorgado]);fwrite(hFile, var);
format(var, 32, "Dorgado2=%d\n",PlayerInfo[playerid][pDorgado]);fwrite(hFile, var);
format(var, 32, "Doenca=%d\n",PlayerInfo[playerid][pDoenca]);fwrite(hFile, var);
format(var, 32, "LU=%s\n",PlayerInfo[playerid][pLastLogin]);fwrite(hFile, var);
format(var, 32, "Ban=%d\n",PlayerInfo[playerid][pBan]);fwrite(hFile, var);
format(var, 32, "TempoHospital=%d\n",PlayerInfo[playerid][pTempoHospitalizado]);fwrite(hFile, var);
format(var, 32, "HospitalID=%d\n",PlayerInfo[playerid][pHospitalID]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return true;[/spoiler][center]
Reply
#2

Nгo vi o cуdigo ainda, mas se vocк fechar o server simplesmente, fechando o samp-server.exe nunca irб salvar.
Use gmx na linha de comandos ou crie um comando gmx ou seta lнder e tenta sair e entrar do jogo para ver se salva.
Reply
#3

Ao dar /gmx, tambйm perde o lider
Reply
#4

Quote:
Originally Posted by Cheleber_Pausini
Посмотреть сообщение
Nгo vi o cуdigo ainda, mas se vocк fechar o server simplesmente, fechando o samp-server.exe nunca irб salvar.
Use gmx na linha de comandos ou crie um comando gmx ou seta lнder e tenta sair e entrar do jogo para ver se salva.
Ao logar e deslogar tambйm
Reply
#5

Se salva admin nгo penso que o problema esteja no salvamento, mas sim no comando que dб lider?
Pode me passar o comando?
Reply
#6

Ai o codigo


Код:
	if(strcmp(cmd, "/darlider", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USE: /darlider [id] [Numero(1-34)]");
				return true;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(level == 0)
			{
				SendClientMessage(playerid, COLOR_GREY, "Para tirar o lider de uma organizaзгo vocк deve usar /limparlider");
				return true;
			}
			if(level > 34 || level < 1)
			{
				SendClientMessage(playerid, COLOR_GREY, "Organizaзхes de 1 a 34");
				return true;
			}
			if(level == 12 || level == 13)
			{
				SendClientMessage(playerid, COLOR_GREY, "Organizaзao desativada no momento!");
				return true;
			}
			GetPlayerName(playerid, sendername, 256);
			if (PlayerInfo[playerid][pAdmin] >= MASTER)
 			{
				if(PlayerInfo[para1][pLider] != 0 || PlayerInfo[para1][pMembro] != 0)
				{
				    SendClientMessage(playerid, COLOR_GRAD1, "   Este player jб participa de uma organizaзгo!");
				    return true;
				}
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						if(strcmp(InfoOrg[level][Lider],"Ninguem",true)==0)
						{
							ConviteInfoOrg(PlayerName(para1), level, 6);
						}
						else
						{
						    SendClientMessage(playerid, COLOR_GRAD2, "Jб tem lнder nessa ORG, use /limparlider antes de colocar outro lider");
						    return true;
						}
						if(level == 1) { PlayerInfo[para1][pSkin] = 266; }//Policia Militar
						else if(level == 2)	{ PlayerInfo[para1][pSkin] = 228; }//Rotam
						else if(level == 3) { PlayerInfo[para1][pSkin] = 287; }//Exйrcito
						else if(level == 4) { PlayerInfo[para1][pSkin] = 70; }//Fire/Ambulance
						else if(level == 5) { PlayerInfo[para1][pSkin] = 115; }//Varrios Los Aztecas
						else if(level == 6) { PlayerInfo[para1][pSkin] = 249; }//GIA
						else if(level == 7) { PlayerInfo[para1][pSkin] = 147; }//Prefeito
						else if(level == 8) { PlayerInfo[para1][pSkin] = 294; }//Hitmans
						else if(level == 9) { PlayerInfo[para1][pSkin] = 227; }//Repуrters
						else if(level == 10) { PlayerInfo[para1][pSkin] = 61; }//Taxistas
						else if(level == 11) { PlayerInfo[para1][pSkin] = 295; }//Policia Federal
						else if(level == 12) { PlayerInfo[para1][pSkin] = 113; }//Mбfia Cosa Nostra
						else if(level == 13) { PlayerInfo[para1][pSkin] = 120; }//Mбfia Yakuza
						else if(level == 14) { PlayerInfo[para1][pSkin] = 270; }//Groove
                        else if(level == 15) { PlayerInfo[para1][pSkin] = 123; }//ALQaeda
						else if(level == 16) { PlayerInfo[para1][pSkin] = 228; }//Rotam-SF
                        else if(level == 17) { PlayerInfo[para1][pSkin] = 104; }//Ballas
                        else if(level == 18) { PlayerInfo[para1][pSkin] = 108; }//Vagos
                        else if(level == 19) { PlayerInfo[para1][pSkin] = 170; }//CV
                        else if(level == 20) { PlayerInfo[para1][pSkin] = 170; }//Comando Vermelho-SF
                        else if(level == 21) { PlayerInfo[para1][pSkin] = 47; }//PpCC
                        else if(level == 22) { PlayerInfo[para1][pSkin] = 117; }//Triads
                        else if(level == 23) { PlayerInfo[para1][pSkin] = 111; }//Guerrilheiros Israelitas
                        else if(level == 24) { PlayerInfo[para1][pSkin] = 47; }//PpCC-SF
                        else if(level == 25) { PlayerInfo[para1][pSkin] = 115; }//Guerrilheiros Israeli
                        else if(level == 26) { PlayerInfo[para1][pSkin] = 104; }//Guerrilheiros Israeli
                        else if(level == 27) { PlayerInfo[para1][pSkin] = 266; }//Guerrilheiros Israeli
                        else if(level == 28) { PlayerInfo[para1][pSkin] = 108; }//Guerrilheiros Israeli
                        else if(level == 29) { PlayerInfo[para1][pSkin] = 270; }//Guerrilheiros Israeli
                        else if(level == 30) { PlayerInfo[para1][pSkin] = 61; }//Guerrilheiros Israeli
                        else if(level == 31) { PlayerInfo[para1][pSkin] = 70; }//Guerrilheiros Israeli
                        else if(level == 33) { PlayerInfo[para1][pSkin] = 166; }//Policia rodoviaria
                        else if(level == 32) { PlayerInfo[para1][pSkin] = 227; }//Guerrilheiros Israeli
						else if(level == 34) { PlayerInfo[para1][pSkin] = 57; }//
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pLider] = level;
						if(admtrampando[playerid] == 1 && admhide[playerid] == 1)
						{
                            format(string, sizeof(string), "   Vocк foi promovido a lider pelo admin %s", PlayerName(playerid));
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);

						}
						else
						{
							format(string, sizeof(string), "   Vocк foi promovido a lider pelo admin %s", PlayerName(playerid));
							SendClientMessage(para1, COLOR_LIGHTBLUE, string);
						}
						format(string, sizeof(string), "   Vocк promoveu %s a Lider.", giveplayer);
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "ADMIN: %s deu lнder da org:[%s] para %s.", sendername, NomeORG(level), giveplayer);
                        LideresLog(string);
						//TempoDeDar[para1] = SetTimerEx("BOSTA", 10000, 0, "i", para1);
						XXAirBreak[para1] += 3;
                        MedicBill[para1] = 0;
						gTeam[para1] = 11;
					    PlayerInfo[para1][pTeam] = 11;
					    PlayerInfo[para1][pCargo] = 6;
					    SetPlayerSkin(para1, PlayerInfo[para1][pSkin]);
					    SetPlayerSpawn(para1);
					}
				}//not connected
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   Vocк nгo esta autorizado a usar este comando!");
			}
		}
		return true;
Reply
#7

Muita bagunзado esse comando o.o
1є Vocк sai do jogo e o documento do player na paste das contas fica com o valor de lнder?
Se ficar o problema й quando player entra no server nгo estara fazendo corretamente o load da informaзгo
2є Caso nгo seja, o problema poderб mesmo ser do comando.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)