SA-MP Forums Archive
Attach 3Dtext to vehicle - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Attach 3Dtext to vehicle (/showthread.php?tid=261478)



Attach 3Dtext to vehicle - ColdIce - 13.06.2011

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


Re: Attach 3Dtext to vehicle - sleepysnowflake - 13.06.2011

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



Re: Attach 3Dtext to vehicle - ColdIce - 13.06.2011

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



Re: Attach 3Dtext to vehicle - Gertin - 13.06.2011

Replace
Код:
Text3D:ASultan;
To
Код:
new Text3D:ASultan;



Re: Attach 3Dtext to vehicle - ColdIce - 13.06.2011

Thanks!! Still, the text disappear after few seconds


Respuesta: Attach 3Dtext to vehicle - K9- - 13.06.2011

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