SA-MP Forums Archive
[Ajuda] Gente Sou Novo Nisto Entao me Ajudem :D - 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] Gente Sou Novo Nisto Entao me Ajudem :D (/showthread.php?tid=492098)



Gente Sou Novo Nisto Entao me Ajudem :D - giovanehen - 02.02.2014

Ola gente Tudo bem ? Entao Queria ajuda em um comando Ai
Tipo Queria que aparece a velocidade no radar Tipo /criarradar 120 Dai aparece Velocidade maxima : 120 tem como por isto no comando ?



PHP код:
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];
    
// Send the command to all admins so they can see it
    
SendAdminText(playerid, "/criarradar", params);
    
// 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);
                
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;
    
// Let the server know that this was a valid command
    
return 1;
} 



Re: Gente Sou Novo Nisto Entao me Ajudem :D - giovanehen - 02.02.2014

up !!


Re: Gente Sou Novo Nisto Entao me Ajudem :D - giovanehen - 02.02.2014

Ninguem ajuda ? aff


Re: Gente Sou Novo Nisto Entao me Ajudem :D - Mathsss - 02.02.2014

Abra a include PPC_Common e procure por SetupSpeedCamera e adicione isso:
PHP код:
new Str[60];
format(Str,sizeof(Str),"{FFFFFF}Velocidade Mбxima:\n {FF0000}%i{FFFFFF} Km/h", ACameras[CamID][CamSpeed]); 
ACameras[CamID][CamText] = CreateDynamic3DTextLabel(Str, 0x008080FF, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]+5, 60.0); 
Agora abra a include PPC_Defines e procure por ACameras e adicione isso acima de CamIcon:
PHP код:
Text3D:CamText, 
E no comando de apagar o radar adicione isso:
PHP код:
DestroyDynamic3DTextLabel(ACameras[CamID][CamText]); 



Re: Gente Sou Novo Nisto Entao me Ajudem :D - giovanehen - 02.02.2014

Muito Obrigado Cara vc й de mais