SA-MP Forums Archive
[Ajuda] Problemas com label - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Problemas com label (/showthread.php?tid=490848)



Problemas com label - Performancetotal - 28.01.2014

Bom galera na ppc_trucking meu comando /criarradar botei para ao criar o radar aparecer a velocidade dele em baixo, porйm quando reinicia o servidor o texto some, jб tentei por pra salvar e olha como ficou:
Codigo:
Код:
COMMAND:criarradar(playerid, params[]) 
{ 
// Setup local variables 
new Float: x, Float:y, Float:z, Float:Angle, MaxSpeed, file[100], File:PFile, LineForFile[100], Msg[128]; 
new xRL [ 50 ] ; 

// Check if the player has logged in 
if (APlayerData[playerid][LoggedIn] == true) 
{ 
// Check if the player's admin-level is at least 5 
if (APlayerData[playerid][PlayerLevel] >= 5) 
{ 
if (sscanf(params, "i", MaxSpeed)) SendClientMessage(playerid, 0xFF0000AA, "Digite: \"/criarradar <Velocidade>\""); 
else 
{ 

// Get player's position and facing angle 
GetPlayerPos(playerid, x, y, z); 
GetPlayerFacingAngle(playerid, Angle); 
format(xRL, sizeof(xRL), "Radar \nVelocidade Mбxima\n %i km", MaxSpeed); 
Create3DTextLabel(xRL, 0xFFFFFFFF, x, y, z, 150.0, 0, 0);    
z = z - 1.0; // Adjust camera Z-coordinate 1m lower than normal (otherwise the camera floats in the air) 

// Move the player a bit, otherwise he could get stuck inside the camera-object 
SetPlayerPos(playerid, x, y + 1.0, z + 1.0); 

// Save the camera to a file 
for (new CamID; CamID < MAX_CAMERAS; CamID++) 
{ 
// Check if this index is free 
if (ACameras[CamID][CamSpeed] == 0) 
{ 
// Setup this camera (create the objects and store the data) 
SetupSpeedCamera(CamID, x, y, z, Angle, MaxSpeed); 

// Save the file 
format(file, sizeof(file), CameraFile, CamID, xRL); // Construct the complete filename for this camera-file 

PFile = fopen(file, io_write); // Open the camera-file for writing 

format(LineForFile, 100, "[Radar] \n|Velocidade Mбxima|\n [%i km]\r\n", x); 
fwrite(PFile, LineForFile); // And save it to the file 
format(LineForFile, 100, "CamX %f\r\n", x); 
fwrite(PFile, LineForFile); // And save it to the file 
format(LineForFile, 100, "CamY %f\r\n", y); 
fwrite(PFile, LineForFile); // And save it to the file 
format(LineForFile, 100, "CamZ %f\r\n", z); 
fwrite(PFile, LineForFile); // And save it to the file 
format(LineForFile, 100, "CamAngle %f\r\n", Angle); 
fwrite(PFile, LineForFile); // And save it to the file 
format(LineForFile, 100, "CamSpeed %i\r\n", MaxSpeed); 
fwrite(PFile, LineForFile); // And save it to the file 

fclose(PFile); // Close the file 

// Let the player know he created a new camera 
format(Msg, 128, "Voce criou o radar de ID: %i", CamID); 
SendClientMessage(playerid, 0x00FF00FF, Msg); 

// Exit the function 
return 1; 
} 
}
e funcionou apareceu no arquivo quando criei : http://prntscr.com/2nbft2
porйm ao reiniciar nгo apareceu a label, alguem sabe oque posso fazer ?


Re: Problemas com label - Lucas_Pawno - 28.01.2014

Talvez vocк nao esteja carregando o arquivo...

Poste o seu OnGameModeInit.


Re: Problemas com label - Performancetotal - 28.01.2014

Quote:
Originally Posted by Lucas_Pawno
Посмотреть сообщение
Talvez vocк nao esteja carregando o arquivo...

Poste o seu OnGameModeInit.
Aqui estб amigo:
Код:
public OnGameModeInit()
{

	new HostCommand[128];
	//--Nome-da-host--//
	format(HostCommand, 128, "samp105.samphost.com.br %s", GameModeName);
	SendRconCommand(HostCommand);
	SetGameModeText(ModeServidor); //--Define o Mode do Game que aparecerб no SAMP--//

	GameModeInit_VehiclesPickups(); //--Carrega todas as casas e carros do Game--//
	GameModeInit_Classes(); //--Adiciona personagens para seleзгo de classe--//

	Convoys_Init(); //--TextDraws com todas as configuraзхes do comboio--//

	ShowPlayerMarkers(1); //-- Faz com que apareзa todos os players com pontos no mapa --//
	ShowNameTags(1); //--Faz com que apareзa o nome e a vida acima dos players--//
	ManualVehicleEngineAndLights(); // Deixa que o servidor controle do motor e as luzes do veнculo--//
	EnableStuntBonusForAll(0); //--Bфnus para os Jogadores--//
	DisableInteriorEnterExits(); //--Remove todas as entradas do edifнcio no jogo--//
	UsePlayerPedAnims(); //--Usa a animaзгo do CJ--//

	//-- Inicia um contador com mensagens cronometrada a cada 3 minutos --//
	SetTimer("Timer_TimedMessages", 1000 * 60 * 3, true);
	//-- Inicia o cronфmetro que vai mostrar uma missгo bфnus aleatуrio para os caminhoneiros a cada 4 minutos --//
	SetTimer("ShowRandomBonusMission", 1000 * 60 * 10, true);
	//-- Inicie o cronфmetro que verifica os com cobranзa de portagem --//
	SetTimer("Toll", 1000, true);

	//-- Corrigir as casas escutas (apуs a fixaзгo das casas, vocк pode remover esta linha, jб que nгo й necessбrio mais) --//
	FixHouses();

	//-- Enquanto o modo de jogo й iniciado, inicie o cronфmetro global, e executб-lo a cada segundo --//
	SetTimer("GlobalTimer", 1000, true);

	return 1;
}