[Ajuda] radar
#1

Galera eu ajustei na ppc_trucking pra quando usar o /criarradar criar um radar com um texto dizendo a velocidade do mesmo, porйm quando eu uso o /tirarradar o texto fica e quando da GMX ou desliga o server o texto sai, como faзo para q quando usar /tirarradar o texto saia ?
Reply
#2

https://sampwiki.blast.hk/wiki/Delete3DTextLabel

Se vocк usa streamer, fale que eu lhe ajudo melhor, ou poste seu cуdigo.
Reply
#3

Quote:
Originally Posted by _SysTeM_OFF
View Post
https://sampwiki.blast.hk/wiki/Delete3DTextLabel

Se vocк usa streamer, fale que eu lhe ajudo melhor, ou poste seu cуdigo.
Sim eu uso streamer, o codigo que botei no /criarradar estб assim:
Code:
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 kmh", 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); // Construct the complete filename for this camera-file 

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

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; 
} 
} 

// In case all camera-slots are occupied (100 camera's have been created already), let the player know about it 
format(Msg, 128, "{FF0000}Voce nao Pode Criar mais de %i Radares", MAX_CAMERAS); 
SendClientMessage(playerid, 0xFFFFFFFF, Msg); 
} 
} 
else 
return 0; 
} 
else 
return 0;
e do /tirarradar й:
Code:
COMMAND:tirarradar(playerid, params[])
{
	// Setup local variables
	new file[100], Msg[128];

	// 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)
		{
				// Loop through all camera's
			for (new CamID; CamID < MAX_CAMERAS; CamID++)
			{
				// Check if this index is used
				if (ACameras[CamID][CamSpeed] != 0)
				{
					// Check if the player is in range of the camera
					if (IsPlayerInRangeOfPoint(playerid, 5.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
					{
					    // Delete the file
						format(file, sizeof(file), CameraFile, CamID); // Construct the complete filename for this camera-file
						if (fexist(file)) // Make sure the file exists
							fremove(file); // Delete the file

						// Delete both camera objects
					    DestroyObject(ACameras[CamID][CamObj1]);
					    DestroyObject(ACameras[CamID][CamObj2]);
						// Also clear the data from memory
					    ACameras[CamID][CamX] = 0.0;
					    ACameras[CamID][CamY] = 0.0;
					    ACameras[CamID][CamZ] = 0.0;
					    ACameras[CamID][CamAngle] = 0.0;
					    ACameras[CamID][CamSpeed] = 0;
                        ACameras[CamID][CamObj1] = 0;
                        ACameras[CamID][CamObj2] = 0;

						// Let the player know he deleted a camera
						format(Msg, 128, "Vocк removeu este radar %i", CamID);
						SendClientMessage(playerid, 0x00FF00FF, Msg);

						// Exit the function
						return 1;
					}
				}
			}

			// In case the player wasn't near a speedcamera, inform him about it
			SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}Vocк precisa estб prуximo de um radar para retirб-lo");
		}
		else
		    return 0;
	}
	else
	    return 0;

	// Let the server know that this was a valid command
	return 1;
}
Reply
#4

pawn Code:
new Text3D:RadarText[ MAX_CAMERAS ]; // Coloque isto no inicio de seu gamemode apуs suas includes.

// Substitua seu Create3dtext por :

RadarText[ CamID ] = Create3DTextLabel(xRL, 0xFFFFFFFF, x, y, z, 150.0, 0, 0);  

// no /tirar radar use:

Delete3DTextLabel( RadarText[CamID] ) ;
# Nгo testado.
Reply
#5

Quote:
Originally Posted by _SysTeM_OFF
View Post
pawn Code:
new Text3D:RadarText[ MAX_CAMERAS ]; // Coloque isto no inicio de seu gamemode apуs suas includes.

// Substitua seu Create3dtext por :

RadarText[ CamID ] = Create3DTextLabel(xRL, 0xFFFFFFFF, x, y, z, 150.0, 0, 0);  

// no /tirar radar use:

Delete3DTextLabel( RadarText[CamID] ) ;
# Nгo testado.
olha aн oque deu
Code:
C:\Users\Julio\Desktop\PPC_Trucking\pawno\include\PPC_PlayerCommands.inc(2966) : error 017: undefined symbol "RadarText"
C:\Users\Julio\Desktop\PPC_Trucking\pawno\include\PPC_PlayerCommands.inc(3028) : error 017: undefined symbol "RadarText"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

pawn Code:
new Text3D:RadarText[ MAX_CAMERAS ];
Vocк botou isto onde?
Reply
#7

Vocк disse :// Coloque isto no inicio de seu gamemode apуs suas includes.
e eu coloquei na GM, apуs as includes.
http://prntscr.com/2mlfq6
Reply
#8

ah esqueci que era o PPC_Truck. bote antes de suas includes. Desculpe-me.

Mais bote depois da a_samp
Reply
#9

Quote:
Originally Posted by _SysTeM_OFF
View Post
ah esqueci que era o PPC_Truck. bote antes de suas includes. Desculpe-me.

Mais bote depois da a_samp
Olha aн :
Code:
C:\Users\Julio\Desktop\PPC_Trucking\gamemodes\EBS.pwn(11) : error 017: undefined symbol "MAX_CAMERAS"
C:\Users\Julio\Desktop\PPC_Trucking\gamemodes\EBS.pwn(11) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\Julio\Desktop\PPC_Trucking\pawno\include\PPC_PlayerCommands.inc(2966) : error 017: undefined symbol "CamID"
C:\Users\Julio\Desktop\PPC_Trucking\pawno\include\PPC_PlayerCommands.inc(3028) : error 017: undefined symbol "CamID"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Imagem GM : http://prntscr.com/2mlhia
e quando coloco abaixo da a_samp o erro permanece.
Reply
#10

Use isto.
Va na PPC_Common e add em SetupSpeedCamera
pawn Code:
new CS_TEXTO[256];
    format(CS_TEXTO,256,"{FF0000}-|{FFFFFF}Velocidade Maxima{FF0000}|- \n{FF0000}%02i {FFFFFF}Km/h",MaxSpeed);
    ACameras[CamID][Cam3DText] = CreateDynamic3DTextLabel(CS_TEXTO,-1,x,y,z +5.0,120.0);
Depois add isso no /tirarradar
pawn Code:
DestroyDynamic3DTextLabel(ACameras[CamID][Cam3DText]);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)