[Ajuda] AJUDA NO PPC_TRUCKING DO +REP
#1

Bom, primeiramente boa tarde para todos da fуrum samp.
Bom, eu gostaria de fazer, um bagulho no ppc_trucking, que tipo quando estб perto do radar, aparecer um textdraw, e quando sair perto do radar, desaparecer o textdraw. Mas eu tentei aqui .. nem deu :/


pawn Код:
SetupSpeedCamera(playerid, CamID, Float:x, Float:y, Float:z, Float:rot, MaxSpeed)
{
    new String[128];
    ACameras[CamID][CamX] = x;
    ACameras[CamID][CamY] = y;
    ACameras[CamID][CamZ] = z;
    ACameras[CamID][CamAngle] = rot;
    ACameras[CamID][CamSpeed] = MaxSpeed;
    ACameras[CamID][CamObj1] = CreateObject(18880, x, y, z, 0.0, 0.0, rot);
    ACameras[CamID][CamObj2] = CreateObject(18880, x, y, z, 0.0, 0.0, rot + 180.0);
    ACameras[CamID][CamObj3] = CreateDynamicMapIcon(x, y, z, 34, 0, 0, 0, -1, 300.0);
    for(new xd = 0; xd < MAX_PLAYERS; ++xd)
    {
         if(!IsPlayerInRangeOfPoint(xd, 250.0 ,ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
         { }
         else
         {
             TextDrawShowForPlayer(xd,carregarpetrolheiro[playerid]);
         }
    }
}
Alguйm me ajuda ? :/ do +rep ..
Reply
#2

o.O Vai mostrar a TextDraw quando cria o Radar? wtf AUEHAUHE
Rapaz, tudo й questгo de lуgica. Se tu quer que mostra a TextDraw quando passa, tu vai mecher na parte onde passa pelo radar. Sу procurar pela mensagem que й exibida e pхe pra exibir.
Reply
#3

Basta usar as duas funзхes.

Para mostrar quando estiver perto: TextDrawShowForPlayer

Para esconder quando estiver longe dela: TextDrawHideForPlayer

Espero ter ajudado ^_^
Reply
#4

Quote:
Originally Posted by ViniKuliveguisky
Посмотреть сообщение
Basta usar as duas funзхes.

Para mostrar quando estiver perto: TextDrawShowForPlayer

Para esconder quando estiver longe dela: TextDrawHideForPlayer

Espero ter ajudado ^_^
Vlw .. isso eu ei kkk', mas o tenso й fazer ele aparecer e desaparecer com a lуgica do radar :/


Quote:
Originally Posted by Nickvj7
Посмотреть сообщение
o.O Vai mostrar a TextDraw quando cria o Radar? wtf AUEHAUHE
Rapaz, tudo й questгo de lуgica. Se tu quer que mostra a TextDraw quando passa, tu vai mecher na parte onde passa pelo radar. Sу procurar pela mensagem que й exibida e pхe pra exibir.
pawn Код:
// This function checks if the player is speeding near a speedcamera
CheckPlayerSpeeding(playerid)
{
    // Setup local variables
    new Name[28], Msg[128], Msgg[128], location[MAX_ZONE_NAME], targetid;

    // Check if the player hasn't been caught speeding recently
    if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        // Loop through all speedcameras
        for (new CamID; CamID < MAX_CAMERAS; CamID++)
        {
            // Check if this camera has been created
            if (ACameras[CamID][CamSpeed] != 0)
            {
                // Check if the player is the driver of the vehicle
                if (GetPlayerVehicleSeat(playerid) == 0)
                {
                    // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
                    if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
                    {
                        // Check if the player is near the camera
                        if (IsPlayerInRangeOfPoint(playerid, 40.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                        {
                            new Ha[128];
                            // Prevent the player being caught multiple times by the same speed-camera
                            APlayerData[playerid][PlayerCaughtSpeeding] = 20;
                            // Increase the wanted-level of this player by 1 star
                            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Radar] {FF0000}Vocк foi flagrado a: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], ACameras[CamID][CamSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
    }
    else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
        APlayerData[playerid][PlayerCaughtSpeeding]--;
}
Adoro sua maneira de falar... vlw por ter ajduado kkkkk', porque realmente isso nгo tem lуgica o que eu fiz kkkkkkkkkkkkkkkkkkkk'
Reply
#5

Antes de mais nada leia isto.
https://sampforum.blast.hk/showthread.php?tid=252966
https://sampforum.blast.hk/showthread.php?tid=267034


Depois de ler comente, e seu problema foi resolvido?
Reply
#6

Quote:
Originally Posted by JoaoMonteiro452
Посмотреть сообщение
Vlw .. isso eu ei kkk', mas o tenso й fazer ele aparecer e desaparecer com a lуgica do radar :/




pawn Код:
// This function checks if the player is speeding near a speedcamera
CheckPlayerSpeeding(playerid)
{
    // Setup local variables
    new Name[28], Msg[128], Msgg[128], location[MAX_ZONE_NAME], targetid;

    // Check if the player hasn't been caught speeding recently
    if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        // Loop through all speedcameras
        for (new CamID; CamID < MAX_CAMERAS; CamID++)
        {
            // Check if this camera has been created
            if (ACameras[CamID][CamSpeed] != 0)
            {
                // Check if the player is the driver of the vehicle
                if (GetPlayerVehicleSeat(playerid) == 0)
                {
                    // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
                    if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
                    {
                        // Check if the player is near the camera
                        if (IsPlayerInRangeOfPoint(playerid, 40.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                        {
                            new Ha[128];
                            // Prevent the player being caught multiple times by the same speed-camera
                            APlayerData[playerid][PlayerCaughtSpeeding] = 20;
                            // Increase the wanted-level of this player by 1 star
                            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Radar] {FF0000}Vocк foi flagrado a: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], ACameras[CamID][CamSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
    }
    else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
        APlayerData[playerid][PlayerCaughtSpeeding]--;
}
Adoro sua maneira de falar... vlw por ter ajduado kkkkk', porque realmente isso nгo tem lуgica o que eu fiz kkkkkkkkkkkkkkkkkkkk'
Falou que ia dar +rep no tнtulo, atй agora nada...
Reply
#7

Quote:
Originally Posted by JoaoMonteiro452
Посмотреть сообщение
Vlw .. isso eu ei kkk', mas o tenso й fazer ele aparecer e desaparecer com a lуgica do radar :/




pawn Код:
// This function checks if the player is speeding near a speedcamera
CheckPlayerSpeeding(playerid)
{
    // Setup local variables
    new Name[28], Msg[128], Msgg[128], location[MAX_ZONE_NAME], targetid;

    // Check if the player hasn't been caught speeding recently
    if (APlayerData[playerid][PlayerCaughtSpeeding] == 0)
    {
        // Loop through all speedcameras
        for (new CamID; CamID < MAX_CAMERAS; CamID++)
        {
            // Check if this camera has been created
            if (ACameras[CamID][CamSpeed] != 0)
            {
                // Check if the player is the driver of the vehicle
                if (GetPlayerVehicleSeat(playerid) == 0)
                {
                    // Check if the player's speed is greater than the speed allowed by this camera (no need to process a distance-check if not speeding)
                    if (APlayerData[playerid][PlayerSpeed] > ACameras[CamID][CamSpeed])
                    {
                        // Check if the player is near the camera
                        if (IsPlayerInRangeOfPoint(playerid, 40.0, ACameras[CamID][CamX], ACameras[CamID][CamY], ACameras[CamID][CamZ]))
                        {
                            new Ha[128];
                            // Prevent the player being caught multiple times by the same speed-camera
                            APlayerData[playerid][PlayerCaughtSpeeding] = 20;
                            // Increase the wanted-level of this player by 1 star
                            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 1);
                            // Let the player know he's been caught speeding
                            format(Ha, sizeof(Ha), "[Radar] {FF0000}Vocк foi flagrado a: {FFFFFF}%i Km/h {FF0000}[Permitido: {FFFFFF}%i{FF0000}].", APlayerData[playerid][PlayerSpeed], ACameras[CamID][CamSpeed]);
                            SendClientMessage(playerid, -1, Ha);
                            // Get the name of the player
                            GetPlayerName(playerid, Name, sizeof(Name));
                            GetPlayer2DZonea(targetid, location, MAX_ZONE_NAME);
                            // Also inform all police players that this player is caught speeding
                            format(Msg, 128, "[Radar] %s {FF0000}foi flagrado em alta velocidade pelo {FFFFFF}radar!", Name);
                            format(Msgg, 128, "[Local] {FF0000}Visto pela ultima vez proximo de: {FFFFFF}%s", location);
                            Police_SendMessage(Msg);
                            Police_SendMessage(Msgg);
                        }
                    }
                }
            }
        }
    }
    else // If the player has been caught before, reduce the value until it's 0 again, then he can be caught again
        APlayerData[playerid][PlayerCaughtSpeeding]--;
}
Adoro sua maneira de falar... vlw por ter ajduado kkkkk', porque realmente isso nгo tem lуgica o que eu fiz kkkkkkkkkkkkkkkkkkkk'
Quote:
Originally Posted by Nickvj7
Посмотреть сообщение
Falou que ia dar +rep no tнtulo, atй agora nada...
Tem como ajuda aqui ? :///
Reply
#8

Quote:
Originally Posted by JoaoMonteiro452
Посмотреть сообщение
Tem como ajuda aqui ? :///
Eu jб te falei o que й doido.

Sу por pra exibir quando passar pelo radar, nгo й isso que tu quer?
No cуdigo primeiro que tu colocou, tu colocou pra exibir quando cria. o.O

Quote:
Originally Posted by ViniKuliveguisky
Посмотреть сообщение
Basta usar as duas funзхes.

Para mostrar quando estiver perto: TextDrawShowForPlayer

Para esconder quando estiver longe dela: TextDrawHideForPlayer
Reply
#9

SetTimer e TextDrawHideForPlayer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)