Attach 3Dtext to vehicle
#1

pawn Код:
if (strcmp("/sultan", cmdtext, true, 10) == 0)
        {
    if(IsPlayerLuxAdminLevel(playerid, 0))
        {
                if(IsPlayerInAnyVehicle(playerid))
                return SendClientMessage(playerid, 0xFFEEDD, "ERROR: You already have a Vehicle");

                new AdminSultan;
                GetPlayerPos(playerid,X,Y,Z);
                GetPlayerFacingAngle(playerid,Angle);
        AdminSultan = CreateVehicle(560,X,Y,Z,Angle,1,-1,-1);
                PutPlayerInVehicle(playerid,AdminSultan,0);
                AddVehicleComponent(AdminSultan, 1029);  AddVehicleComponent(AdminSultan, 1030); AddVehicleComponent(AdminSultan, 1141); AddVehicleComponent(AdminSultan, 1080);
              AddVehicleComponent(AdminSultan, 1031); AddVehicleComponent(AdminSultan, 1033); AddVehicleComponent(AdminSultan, 1138);
            AddVehicleComponent(AdminSultan, 1169);     AddVehicleComponent(AdminSultan, 1086); AddVehicleComponent(AdminSultan, 1087); AddVehicleComponent(AdminSultan, 1010);
                ChangeVehiclePaintjob(AdminSultan,2);
                SetVehicleVirtualWorld(AdminSultan, GetPlayerVirtualWorld(playerid));
        LinkVehicleToInterior(AdminSultan, GetPlayerInterior(playerid));
        }
       
        return 1;
        }
How can I attach a 3DText label above him?? And where should I put that code?

This is a stupid idea, but I want a dark blue text above the car all the time that says something

Thank you
Reply
#2

pawn Код:
if (strcmp("/sultan", cmdtext, true, 10) == 0)
        {
    Text3D:ASultan;
    if(IsPlayerLuxAdminLevel(playerid, 1)) // For Admin Level One ....
        {
                if(IsPlayerInAnyVehicle(playerid))
                return SendClientMessage(playerid, 0xFFEEDD, "ERROR: You already have a Vehicle");

                new AdminSultan;
                GetPlayerPos(playerid,X,Y,Z);
                GetPlayerFacingAngle(playerid,Angle);
        AdminSultan = CreateVehicle(560,X,Y,Z,Angle,1,-1,-1);
                PutPlayerInVehicle(playerid,AdminSultan,0);
                AddVehicleComponent(AdminSultan, 1029);  AddVehicleComponent(AdminSultan, 1030); AddVehicleComponent(AdminSultan, 1141); AddVehicleComponent(AdminSultan, 1080);
              AddVehicleComponent(AdminSultan, 1031); AddVehicleComponent(AdminSultan, 1033); AddVehicleComponent(AdminSultan, 1138);
            AddVehicleComponent(AdminSultan, 1169);     AddVehicleComponent(AdminSultan, 1086); AddVehicleComponent(AdminSultan, 1087); AddVehicleComponent(AdminSultan, 1010);
                ChangeVehiclePaintjob(AdminSultan,2);
                SetVehicleVirtualWorld(AdminSultan, GetPlayerVirtualWorld(playerid));
        LinkVehicleToInterior(AdminSultan, GetPlayerInterior(playerid));
    ASultan = Create3DTextLabel( "I am a Big and MEAN admin car.", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
    Attach3DTextLabelToVehicle( ASultan, AdminSultan, 0.0, 0.0, 2.0);
        }
       
        return 1;
        }
Reply
#3

pawn Код:
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5283) : warning 221: label name "Text3D" shadows tag name
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5283) : error 017: undefined symbol "ASultan"
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5283) : warning 215: expression has no effect
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5300) : error 017: undefined symbol "ASultan"
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5301) : error 017: undefined symbol "ASultan"
C:\Users\Aрalsteinn\Desktop\Mine\gamemodes\XS.pwn(5283) : warning 203: symbol is never used: "Text3D"
Line 5283
pawn Код:
Text3D:ASultan;
Line 5300+5301
pawn Код:
ASultan = Create3DTextLabel( "Have no fear! Poseidon is here!.", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
    Attach3DTextLabelToVehicle( ASultan, AdminSultan, 0.0, 0.0, 2.0);
Reply
#4

Replace
Код:
Text3D:ASultan;
To
Код:
new Text3D:ASultan;
Reply
#5

Thanks!! Still, the text disappear after few seconds
Reply
#6

No, if you want to eliminate it you can use Delete3DTextLabel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)