Attach3DTextLabelToVehicle help
#1

The text won't show up on the car so i hope u might se whats wrong here thanks in advance!

PHP код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],keyid; 
PHP код:
           }
           else if(
strcmp(type, "sellad", true) == 0)
           {
               new 
id = VehicleInfo[GetPlayerVehicleID(playerid)][vOwned], key = SCRIPT_CARS, string[128];
               if(
GetPVarInt(playerid, "ConnectTime") < 8) return SendClientMessage(playerid, COLOR_GREY, "You need to play 8 hours to use this.");
               if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_WHITE, "You must be in your vehicle to do this.");
               if (
id == SCRIPT_CARS) return SendClientMessage(playerid, COLOR_WHITE, "The vehicle you are in is not ownable.");
               if (
CarInfo[id][cOwned] == 0) return SendClientMessage(playerid, COLOR_WHITE, "The vehicle you are in is not ownable.");
               if (
CarInfo[id][cDonate] != 0) return SendClientMessage(playerid, COLOR_WHITE, "You can't sell a donated vehicle.");
               if (
CarInfo[id][cModel] == 522) return SendClientMessage(playerid, COLOR_WHITE, "You can't sell NRG-500's.");
               if(
GetPVarInt(playerid, "CarKey1") == id) key = GetPVarInt(playerid, "CarKey1");
            if(
GetPVarInt(playerid, "CarKey2") == id) key = GetPVarInt(playerid, "CarKey2");
            if(
GetPVarInt(playerid, "CarKey3") == id) key = GetPVarInt(playerid, "CarKey3");
               if (
key == SCRIPT_CARS) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a key to this vehicle.");
               
vehicle3Dtext[keyid] = Create3DTextLabel("Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1);
            
Attach3DTextLabelToVehicle(vehicle3Dtext[keyid], keyid, 0.0, 0.0, 2.0);
            return 
1; 
Reply
#2

pawn Код:
new id = VehicleInfo[GetPlayerVehicleID(playerid)][vOwned]
Attach3DTextLabelToVehicle(vehicle3Dtext[keyid], keyid, 0.0, 0.0, 2.0); // why vehicle3Dtext[keyid]??
try to
pawn Код:
Attach3DTextLabelToVehicle(vehicle3Dtext[id], id, 0.0, 0.0, 2.0);
i hope that i understand what you want to do.
Reply
#3

Quote:
Originally Posted by Galletziz
Посмотреть сообщение
pawn Код:
new id = VehicleInfo[GetPlayerVehicleID(playerid)][vOwned]
Attach3DTextLabelToVehicle(vehicle3Dtext[keyid], keyid, 0.0, 0.0, 2.0); // why vehicle3Dtext[keyid]??
try to
pawn Код:
Attach3DTextLabelToVehicle(vehicle3Dtext[id], id, 0.0, 0.0, 2.0);
i hope that i understand what you want to do.
PHP код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],vehicle_id;
// Creating the TextLabel for later use
 
public OnGameModeInit ( )
{
    
vehicle_id = CreateVehicle( 510, 0.0. 0.0, 15.0, 5, 0, 120 );
    
vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
    
//Creating the Vehicle
    //Attaching Text Label To Vehicle
    
Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);
}
public 
OnGameModeExit ( )
{
    
Delete3DTextLabel( vehicle3Dtext[ vehicle_id ] );
    return 
true;
} 
Reply
#4

1. Where are you setting `keyid`?
2. Can you verify that both the vehicle and the label exists before attaching?
Reply
#5

Quote:
Originally Posted by Crayder
Посмотреть сообщение
1. Where are you setting `keyid`?
2. Can you verify that both the vehicle and the label exists before attaching?
i change the code abit but still same problem


PHP код:
               new key = SCRIPT_CARS;
            if(
GetPVarInt(playerid, "CarKey1") != SCRIPT_CARS && OwnableVehicle(GetPVarInt(playerid, "CarKey1"))) { key = GetPVarInt(playerid, "CarKey1"); }
            if(
GetPVarInt(playerid, "CarKey2") != SCRIPT_CARS && OwnableVehicle(GetPVarInt(playerid, "CarKey2"))) { key = GetPVarInt(playerid, "CarKey2"); }
            if(
GetPVarInt(playerid, "CarKey3") != SCRIPT_CARS && OwnableVehicle(GetPVarInt(playerid, "CarKey3"))) { key = GetPVarInt(playerid, "CarKey3"); }
               if (
key == SCRIPT_CARS) return SendClientMessage(playerid, COLOR_WHITE, "You don't have a key to this vehicle slot.");
               if (
CarInfo[key][cOwned] == 0) return SendClientMessage(playerid, COLOR_WHITE, "The vehicle you have a key to is invalid.");
               
vehicle3Dtext[key] = Create3DTextLabel("Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1);
            
Attach3DTextLabelToVehicle(vehicle3Dtext[key], key, 0.009999, -0.019999, 0.854999); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)