[Ajuda] GTA SA fecha ao spawnar
#1

Bom dia/Boa tarde/Boa noite/Boa madrugada. Estou tendo um problema em meu gamemode roleplay que estou criando do zero com salvamento de dados em DOF2. Ao clicar em 'Logar' para spawnar na ъltima posiзгo (x, y, z, a, int e vw) que eu estive quando desloguei o GTA SA fecha.

Nгo sei o que pode estar errado, se alguйm puder me dar um help serei grato. Obrigado desde jб.

Segue abaixo as funзхes.

Код:
public OnPlayerSpawn(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    
    new infopos = 0;
    if(PlayerInfo[playerid][pPosX] == 0) PlayerInfo[playerid][pPosX] = -1982.4871, infopos = 1;
	if(PlayerInfo[playerid][pPosY] == 0) PlayerInfo[playerid][pPosY] = 137.8698, infopos = 1;
	if(PlayerInfo[playerid][pPosZ] == 0) PlayerInfo[playerid][pPosZ] = 27.6875, infopos = 1;
	if(PlayerInfo[playerid][pPosA] == 0) PlayerInfo[playerid][pPosA] = 88.9284, infopos = 1;
	if(infopos == 1) SendClientMessage(playerid, COLOR_LIGHTRED, "Ocorreu um erro com sua antiga posiзгo e vocк foi enviado a Los Santos, informe um administrador.");
	    
    SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
	SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]);
    SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
    SetCameraBehindPlayer(playerid);
	return 1;
}
Код:
public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerNPC(playerid)) return 1;
    
    if(PlayerInfo[playerid][pLogado] == true)
    {
		SpawnPlayer(playerid);
 	}
 	else
 	{
 	    SetSpawnInfo(playerid, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), SpawnPlayer(playerid);
	}
	return 1;
}
Код:
public OnPlayerConnect(playerid)
{
    if(IsPlayerNPC(playerid)) return 1;
    
    format(String, sizeof(String), "%s[ID:%d] conectou-se ao servidor.", PlayerName(playerid), playerid);
    SendAdminMessage(COLOR_LIGHTRED, String);
    
    SetPlayerColor(playerid, COLOR_CONNECT);
    OnPlayerConnect2(playerid);
    TogglePlayerSpectating(playerid, 1);
    
    SetTimerEx("Tela_Login", 10, 0, "i", playerid);
	return 1;
}

forward OnPlayerConnect2(playerid);
public OnPlayerConnect2(playerid)
{
    PlayerInfo[playerid][pRegistrado] = false;
    PlayerInfo[playerid][pLogado] = false;
    PlayerInfo[playerid][pBanido] = false;
    PlayerInfo[playerid][pFerido] = false;
    PlayerInfo[playerid][pMancando] = false;
    ResetPlayerWeapons(playerid);
    ResetPlayerMoneyEx(playerid);
	PlayerInfo[playerid][pAdminNivel] = 0;
	PlayerInfo[playerid][pHelperNivel] = 0;
	PlayerInfo[playerid][pDoadorNivel] = 0;
	PlayerInfo[playerid][pDoadorDia] = 0;
	PlayerInfo[playerid][pDoadorMes] = 0;
	PlayerInfo[playerid][pDoadorAno] = 0;
	PlayerInfo[playerid][pSkin] = 0;
	PlayerInfo[playerid][pPosX] = 0;
	PlayerInfo[playerid][pPosY] = 0;
	PlayerInfo[playerid][pPosZ] = 0;
	PlayerInfo[playerid][pPosA] = 0;
	PlayerInfo[playerid][pInterior] = 0;
	PlayerInfo[playerid][pVirtualWorld] = 0;
	PlayerInfo[playerid][pInterior] = 0;
    PlayerInfo[playerid][pNivel] = 0;
    PlayerInfo[playerid][pSexo] = 0;
    PlayerInfo[playerid][pIdade] = 0;
    PlayerInfo[playerid][pOrigem] = 0;
    PlayerInfo[playerid][pConvenio] = 0;
    PlayerInfo[playerid][pEstiloAndar] = 0;
    PlayerInfo[playerid][pEstiloChat] = 0;
    PlayerInfo[playerid][pEstiloLuta] = 0;
    PlayerInfo[playerid][pDinheiro] = 0;
    PlayerInfo[playerid][pBanco] = 0;
    PlayerInfo[playerid][pPoupanca] = 0;
    PlayerInfo[playerid][pEmprego] = 0;
    PlayerInfo[playerid][pTempoEmprego] = 0;
    PlayerInfo[playerid][pFaccao] = 0;
    PlayerInfo[playerid][pCargo] = 0;
    PlayerInfo[playerid][pPontos] = 0;
    PlayerInfo[playerid][pForca] = 0;
    return 1;
}
Код:
forward Tela_Login(playerid);
public Tela_Login(playerid)
{
	ClearChatbox(playerid, 20);
	
	format(File, sizeof(File), "Contas/%s.ini", PlayerName(playerid));
    if(!DOF2_FileExists(File))
    {
        format(String, sizeof(String), "Bem vindo ao Santa Faria Roleplay, %s.\nPor favor, digite uma senha abaixo para registrar-se.", PlayerName(playerid));
  		Dialog_Show(playerid, Dialog_Registro, DIALOG_STYLE_PASSWORD, "Registro", String, "Registrar", "Cancelar");
    }
    else
    {
        format(String, sizeof(String), "Bem vindo de volta ao Santa Faria Roleplay, %s.\nPor favor, digite sua senha para logar-se.", PlayerName(playerid));
		Dialog_Show(playerid, Dialog_Login, DIALOG_STYLE_PASSWORD, "Login", String, "Logar", "Cancelar");
    }
    return true;
}
Код:
Dialog:Dialog_Login(playerid, response, listitem, inputtext[])
{
	if(!response)
	{
         GameTextForPlayer(playerid, "~r~Kickado", 4000, 4);
		 Kick(playerid);
	}
	if(response)
	{
        if(strlen(inputtext) == 0)
        {
             format(String, sizeof(String), "Bem vindo de volta ao Santa Faria Roleplay, %s.\nPor favor, digite sua senha para logar-se.", PlayerName(playerid));
		     Dialog_Show(playerid, Dialog_Login, DIALOG_STYLE_PASSWORD, "Login", String, "Logar", "Cancelar");
             return 1;
        }
        OnPlayerLogin(playerid, inputtext);
        return 1;
	}
	return 1;
}
Код:
forward OnPlayerLogin(playerid, password[]);
public OnPlayerLogin(playerid, password[])
{
	format(File, sizeof(File), "Contas/%s.ini", PlayerName(playerid));
	if(strcmp(Encrypt(password), DOF2_GetString(File, "Senha"), true) == 0)
	{
		DOF2_SetString(File, "Senha", Encrypt(password));
		format(PlayerInfo[playerid][pNomeOOC], 24, "%s", DOF2_GetString(File, "NomeOOC"));
        PlayerInfo[playerid][pAdminNivel] = DOF2_GetInt(File, "AdminNivel");
        PlayerInfo[playerid][pHelperNivel] = DOF2_GetInt(File, "HelperNivel");
        PlayerInfo[playerid][pDoadorNivel] = DOF2_GetInt(File, "DoadorNivel");
        PlayerInfo[playerid][pDoadorDia] = DOF2_GetInt(File, "DoadorDia");
        PlayerInfo[playerid][pDoadorMes] = DOF2_GetInt(File, "DoadorMes");
        PlayerInfo[playerid][pDoadorAno] = DOF2_GetInt(File, "DoadorAno");
        PlayerInfo[playerid][pSkin] = DOF2_GetInt(File, "Skin");
        PlayerInfo[playerid][pPosX] = DOF2_GetFloat(File, "PosicaoX");
        PlayerInfo[playerid][pPosY] = DOF2_GetFloat(File, "PosicaoY");
        PlayerInfo[playerid][pPosZ] = DOF2_GetFloat(File, "PosicaoZ");
        PlayerInfo[playerid][pPosA] = DOF2_GetFloat(File, "PosicaoA");
        PlayerInfo[playerid][pInterior] = DOF2_GetInt(File, "Interior");
        PlayerInfo[playerid][pVirtualWorld] = DOF2_GetInt(File, "VirtualWorld");
        PlayerInfo[playerid][pNivel] = DOF2_GetInt(File, "Nivel");
        PlayerInfo[playerid][pSexo] = DOF2_GetInt(File, "Sexo");
        PlayerInfo[playerid][pIdade] = DOF2_GetInt(File, "Idade");
        format(PlayerInfo[playerid][pOrigem], 32, "%s", DOF2_GetString(File, "Origem"));
        PlayerInfo[playerid][pTutorial] = DOF2_GetInt(File, "Tutorial");
        PlayerInfo[playerid][pVida] = DOF2_GetFloat(File, "Vida");
        PlayerInfo[playerid][pVidaMaxima] = DOF2_GetFloat(File, "VidaMaxima");
        PlayerInfo[playerid][pColete] = DOF2_GetFloat(File, "Colete");
        PlayerInfo[playerid][pTempoFerido] = DOF2_GetInt(File, "TempoFerido");
        PlayerInfo[playerid][pConvenio] = DOF2_GetInt(File, "Convenio");
        PlayerInfo[playerid][pEstiloAndar] = DOF2_GetInt(File, "EstiloAndar");
        PlayerInfo[playerid][pEstiloChat] = DOF2_GetInt(File, "EstiloChat");
        PlayerInfo[playerid][pEstiloLuta] = DOF2_GetInt(File, "EstiloLuta");
        PlayerInfo[playerid][pDinheiro] = DOF2_GetInt(File, "Dinheiro");
        PlayerInfo[playerid][pBanco] = DOF2_GetInt(File, "Banco");
        PlayerInfo[playerid][pPoupanca] = DOF2_GetInt(File, "Poupanca");
        PlayerInfo[playerid][pEmprego] = DOF2_GetInt(File, "Emprego");
        PlayerInfo[playerid][pTempoEmprego] = DOF2_GetInt(File, "TempoEmprego");
        PlayerInfo[playerid][pFaccao] = DOF2_GetInt(File, "Faccao");
        PlayerInfo[playerid][pCargo] = DOF2_GetInt(File, "Cargo");
        PlayerInfo[playerid][pPontos] = DOF2_GetInt(File, "Pontos");
        PlayerInfo[playerid][pForca] = DOF2_GetInt(File, "Forca");

		if(PlayerInfo[playerid][pTutorial] == 0)
		{
   			ClearChatbox(playerid, 20);
			Dialog_Show(playerid, Dialog_Sexo, DIALOG_STYLE_LIST, "Selecione seu sexo", "Masculino\nFeminino", "OK", "Cancelar");
		}
		else
		{
            StopAudioStreamForPlayer(playerid);
		
            SetPlayerColor(playerid, COLOR_WHITE);

            PreloadAnimLibs(playerid);

			SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
			SetPlayerSkillLevel(playerid, WEAPON_TEC9, 1) ;
			SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 1000);
			SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 1000);

			SetPlayerDrunkLevel(playerid, 0);
			
			TogglePlayerSpectating(playerid, 0);
			SpawnPlayer(playerid);

            GivePlayerMoneyEx(playerid, PlayerInfo[playerid][pDinheiro]);

            SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pEstiloLuta]);
		    SetPlayerScore(playerid, PlayerInfo[playerid][pNivel]);

            SetPlayerHealth(playerid, PlayerInfo[playerid][pVida]);
            SetPlayerArmour(playerid, PlayerInfo[playerid][pColete]);
            
            format(String, sizeof(String), "~w~Bem vindo ~n~~g~   %s", PlayerName(playerid));
		    GameTextForPlayer(playerid, String, 5000, 1);
            
            SendClientMessageEx(playerid, COLOR_WHITE, "Bem vindo, %s.", PlayerName(playerid));
            SendClientMessage(playerid, COLOR_LIGHTBLUE, "Encontrou algum bug? Relate pelo comando /bug.");
            
            if(PlayerInfo[playerid][pAdminNivel] > 0)
	        {
               SendClientMessageEx(playerid, COLOR_YELLOW, "Vocк logou com nнvel %d de administrador.", PlayerInfo[playerid][pAdminNivel]);
	        }
	        if(PlayerInfo[playerid][pHelperNivel] > 0)
	        {
               SendClientMessageEx(playerid, COLOR_YELLOW, "Vocк logou com nнvel %d de helper.", PlayerInfo[playerid][pHelperNivel]);
	        }
	        if(PlayerInfo[playerid][pDoadorNivel] > 0)
	        {
               SendClientMessageEx(playerid, COLOR_YELLOW, "Vocк logou com nнvel %d de doador.", PlayerInfo[playerid][pDoadorNivel]);
	        }
		}
	}
	else
	{
	    format(String, sizeof(String), "Bem vindo de volta ao Santa Faria Roleplay, %s.\nPor favor, digite sua senha para logar-se.", PlayerName(playerid));
		Dialog_Show(playerid, Dialog_Login, DIALOG_STYLE_PASSWORD, "Login", String, "Logar", "Cancelar");
		WrongPassword[playerid] += 1;
	    SendClientMessageEx(playerid, COLOR_LIGHTRED, "Senha errada. (%d/5)", WrongPassword[playerid]);

	    if(WrongPassword[playerid] == 5)
		{
			 GameTextForPlayer(playerid, "~r~Kickado", 4000, 4);
		     Kick(playerid);
		}
	}
 	return 1;
}
Код:
forward OnPlayerSave(playerid);
public OnPlayerSave(playerid)
{
	if(IsPlayerConnected(playerid) && PlayerInfo[playerid][pLogado] == true)
	{
		format(File, sizeof(File), "Contas/%s.ini", PlayerName(playerid));

        format(PlayerInfo[playerid][pNomeOOC], 24, "%s", DOF2_GetString(File, "NomeOOC"));
		DOF2_SetInt(File, "AdminNivel", PlayerInfo[playerid][pAdminNivel]);
		DOF2_SetInt(File, "HelperNivel", PlayerInfo[playerid][pHelperNivel]);
		DOF2_SetInt(File, "DoadorNivel", PlayerInfo[playerid][pDoadorNivel]);
		DOF2_SetInt(File, "DoadorDia", PlayerInfo[playerid][pDoadorDia]);
		DOF2_SetInt(File, "DoadorMes", PlayerInfo[playerid][pDoadorMes]);
        DOF2_SetInt(File, "DoadorAno", PlayerInfo[playerid][pDoadorAno]);
        PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid);
        DOF2_SetInt(File, "Skin", PlayerInfo[playerid][pSkin]);
        GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]);
        DOF2_SetFloat(File, "PosicaoX", PlayerInfo[playerid][pPosX]);
        DOF2_SetFloat(File, "PosicaoY", PlayerInfo[playerid][pPosY]);
        DOF2_SetFloat(File, "PosicaoZ", PlayerInfo[playerid][pPosZ]);
        GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]);
        DOF2_SetFloat(File, "PosicaoA", PlayerInfo[playerid][pPosA]);
        PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid);
        DOF2_SetInt(File, "Interior", PlayerInfo[playerid][pInterior]);
        PlayerInfo[playerid][pVirtualWorld] = GetPlayerVirtualWorld(playerid);
        DOF2_SetInt(File, "VirtualWorld", PlayerInfo[playerid][pVirtualWorld]);
		DOF2_SetInt(File, "Nivel", PlayerInfo[playerid][pNivel]);
		DOF2_SetInt(File, "Sexo", PlayerInfo[playerid][pSexo]);
		DOF2_SetInt(File, "Idade", PlayerInfo[playerid][pIdade]);
		format(PlayerInfo[playerid][pOrigem], 32, "%s", DOF2_GetString(File, "Origem"));
		DOF2_SetInt(File, "Tutorial", PlayerInfo[playerid][pTutorial]);
		GetPlayerHealth(playerid, PlayerInfo[playerid][pVida]);
		DOF2_SetFloat(File, "Vida", PlayerInfo[playerid][pVida]);
		DOF2_SetFloat(File, "VidaMaxima", PlayerInfo[playerid][pVidaMaxima]);
		GetPlayerArmour(playerid, PlayerInfo[playerid][pColete]);
		DOF2_SetFloat(File, "Colete", PlayerInfo[playerid][pColete]);
		DOF2_SetInt(File, "TempoFerido", PlayerInfo[playerid][pTempoFerido]);
		DOF2_SetInt(File, "Convenio", PlayerInfo[playerid][pConvenio]);
		DOF2_SetInt(File, "EstiloAndar", PlayerInfo[playerid][pEstiloAndar]);
		DOF2_SetInt(File, "EstiloChat", PlayerInfo[playerid][pEstiloChat]);
		DOF2_SetInt(File, "EstiloLuta", PlayerInfo[playerid][pEstiloLuta]);
		DOF2_SetInt(File, "Dinheiro", PlayerInfo[playerid][pDinheiro]);
		DOF2_SetInt(File, "Banco", PlayerInfo[playerid][pBanco]);
		DOF2_SetInt(File, "Poupanca", PlayerInfo[playerid][pPoupanca]);
		DOF2_SetInt(File, "Emprego", PlayerInfo[playerid][pEmprego]);
		DOF2_SetInt(File, "TempoEmprego", PlayerInfo[playerid][pTempoEmprego]);
		DOF2_SetInt(File, "Faccao", PlayerInfo[playerid][pFaccao]);
		DOF2_SetInt(File, "Cargo", PlayerInfo[playerid][pCargo]);
		DOF2_SetInt(File, "Pontos", PlayerInfo[playerid][pPontos]);
		DOF2_SetInt(File, "Forca", PlayerInfo[playerid][pForca]);
		DOF2_SaveFile();
	}
	return 1;
}
Reply
#2

Todos que logam no servidor acontece o "crash"?
Reply
#3

Passa a ID do crash!
Reply
#4

Sу testei eu mesmo no localhost (127.0.0.1, porta 7777) e jб passei o crashdetect, sу que nгo tem nenhum arquivo crashinfo.
Reply
#5

O id do crash do seu gta-sa, nгo o do sv manow .-.
Reply
#6

Quote:
Originally Posted by RazorGuigo
Посмотреть сообщение
O id do crash do seu gta-sa, nгo o do sv manow .-.
Desculpa, como faz isso?
Reply
#7

Quote:
Originally Posted by RIPOrkut
Посмотреть сообщение
Desculpa, como faz isso?


achou q isso era uma janela insignificante?
Reply
#8

Quote:
Originally Posted by RazorGuigo
Посмотреть сообщение


achou q isso era uma janela insignificante?
Nгo, nгo amigo. O GTA SA nгo crasha, ele para de funcionar.
Reply
#9

Quote:
Originally Posted by RIPOrkut
Посмотреть сообщение
Nгo, nгo amigo. O GTA SA nгo crasha, ele para de funcionar.
entгo ok, aqui estб alguns motivos de crash, sem adress:
  • Arquivos .dff ou .txd corrompidos ou invбlidos
  • Livrarias de mods que dгo colisхes
  • Server: TextDraw ou GameText que apresenta "~" de forma errada
  • Muitos objetos invбlidos (nгo podem ser usados no mapa), em um sу lugar
  • Falta de memoria do jogo
espero que te ajude
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)