Help with Attach3DTextLabel
#1

I don't get it anymore, my RP Name Text, is some other 3DText of my server




Код:
RPNAMETEXT[playerid] = Create3DTextLabel(pInfo[playerid][rpname],COLOR_WHITE,0.0,0.0,0.0,30,0,1);
Код:
Attach3DTextLabelToPlayer(RPNAMETEXT[playerid],playerid,0.0,0.0,0.4);
Reply
#2

What are you trying to do exactly?
Reply
#3

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
What are you trying to do exactly?
Normally, the rp name is above the head, and that is working but in some weird way, there is some other 3DText on the top of the players Head, and that 3DText is normally at the spawn
Reply
#4

Why use a 3DTextLabel if you can use SetPlayerName()?

Then it must be that the 3DTextLabel must have the same ID as that label from the spawn. How do you create both ID's? do you use streamer or just the same way.
Reply
#5

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
Why use a 3DTextLabel if you can use SetPlayerName()?

Then it must be that the 3DTextLabel must have the same ID as that label from the spawn. How do you create both ID's? do you use streamer or just the same way.

No, i have 2 names, the outgame name and the ingame rp name, and that is above the head, like in another server, but another 3dtext is above the head, and that should not be there. And the Text from the spawn has an other id.

I created it with Normal Create3DTextLabel

Spawn:
Код:
Create3DTextLabel("[ /fmieten ]\num ein Fahrrad zu mieten",COLOR_YELLOW,-1981.6117,130.0222,27.6875,30,0,1);
RP Name:
Код:
RPNAMETEXT[playerid] = Create3DTextLabel(pInfo[playerid][rpname],COLOR_WHITE,0.0,0.0,0.0,30,0,1);
Reply
#6

That's odd

PHP код:
new Text:id Create3DTextLabel("[ /fmieten ]\num ein Fahrrad zu mieten",COLOR_YELLOW,-1981.6117,130.0222,27.6875,30,0,1);
print(
id); 
PHP код:
RPNAMETEXT[playerid] = Create3DTextLabel(pInfo[playerid][rpname],COLOR_WHITE,0.0,0.0,0.0,30,0,1);
print(
RPNAMETEXT[playerid]); 
try doing that, It's just a print so that we will know there value, just compile and run it, see if there value matches. If it does. That has something wrong with it then. If not then we will have to try a different approach
Reply
#7

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
That's odd

PHP код:
new Text:id Create3DTextLabel("[ /fmieten ]\num ein Fahrrad zu mieten",COLOR_YELLOW,-1981.6117,130.0222,27.6875,30,0,1);
print(
id); 
PHP код:
RPNAMETEXT[playerid] = Create3DTextLabel(pInfo[playerid][rpname],COLOR_WHITE,0.0,0.0,0.0,30,0,1);
print(
RPNAMETEXT[playerid]); 
try doing that, It's just a print so that we will know there value, just compile and run it, see if there value matches. If it does. That has something wrong with it then. If not then we will have to try a different approach
doesnt work it says argument type mismatch with print
Reply
#8

It's just a warning but if you don't like warnings then this

PHP код:
 format("%d"id); 
and do the same with the other. We are just checking their id's
Reply
#9

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
It's just a warning but if you don't like warnings then this

PHP код:
 format("%d"id); 
and do the same with the other. We are just checking their id's
Nope, i get errors like tag mismatch and so on
Reply
#10

This should be the code
PHP код:
new Text3Did Create3DTextLabel("test", -10.00.00.00.000),
       
Text3Did2 Create3DTextLabel("test", -10.00.00.00.000)
       ;
    
printf("%d"id);
    new 
strid[2];
    
format(stridsizeof strid"%d"id);
    print(
strid);
    
printf("%d"id2);
    
format(stridsizeof strid"%d"id2);
    print(
strid); 
This should be the output
Quote:

[02:57:46] 0
[02:57:46] 0
[02:57:46] 1
[02:57:46] 1

Reply
#11

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
This should be the code
PHP код:
new Text3Did Create3DTextLabel("test", -10.00.00.00.000),
       
Text3Did2 Create3DTextLabel("test", -10.00.00.00.000)
       ;
    
printf("%d"id);
    new 
strid[2];
    
format(stridsizeof strid"%d"id);
    print(
strid);
    
printf("%d"id2);
    
format(stridsizeof strid"%d"id2);
    print(
strid); 
This should be the output


i have so many 3DTextLabels, and only this specific one is attached to a player
Reply
#12

I see that it doesn't even match the id's though.

I can't seem to see why it does that though. It seems to attach two id's at once.

does it only stick to the player, have you tried it without being in the vehicle?
Reply
#13

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
I see that it doesn't even match the id's though.

I can't seem to see why it does that though. It seems to attach two id's at once.

does it only stick to the player, have you tried it without being in the vehicle?
yea, but it's random, sometimes it attaches to the player, and sometimes after a restart not anymore, and the nafter another restart it does it again
Reply
#14

I've done my own testing but I can't seem to find a fix for this. I haven't had this error before. I don't know where it happens and why it happens. I think I'll be needing more testing for this if I want to know how it happens and it'll take me time though.

I'm better off telling you that I can't be of help for this, someone will come and help you though.
Reply
#15

Quote:
Originally Posted by JesterlJoker
Посмотреть сообщение
I've done my own testing but I can't seem to find a fix for this. I haven't had this error before. I don't know where it happens and why it happens. I think I'll be needing more testing for this if I want to know how it happens and it'll take me time though.

I'm better off telling you that I can't be of help for this, someone will come and help you though.
okay, thanks
Reply
#16

I have a new Problem, with my Car System, since i added tuning, it doesn't save anymore

My Code:

Код:
stock saveCars(playerid)
{
	new Spoiler, Hood, Roof, Sideskirt, Lamps, Nitro, Exhaust, Wheels, Stereo, Hydraulics, FrontBumper, RearBumper, VentRight, VentLeft;
	Spoiler = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_SPOILER);
	Hood = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_HOOD);
	Roof = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_ROOF);
	Sideskirt = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_SIDESKIRT);
	Lamps = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_LAMPS);
	Nitro = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_NITRO);
	Exhaust = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_EXHAUST);
	Wheels = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_WHEELS);
	Stereo = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_STEREO);
	Hydraulics = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_HYDRAULICS);
	FrontBumper = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_FRONT_BUMPER);
	RearBumper = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_REAR_BUMPER);
	VentRight = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_VENT_RIGHT);
	VentLeft = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_VENT_LEFT);
	new query[256];
	new Float:x,Float:y,Float:z,Float:a;
	GetVehiclePos(cInfo[playerid][id],x,y,z);
	GetVehicleZAngle(cInfo[playerid][id],a);
	format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',a='%f',Spoiler='%d',Hood='%d',Roof='%d',Sideskirt='%d',Lamps='%d',Nitro='%d',Exhaust='%d',Wheels='%d',Stereo='%d',Hydraulics='%d',FrontBumper='%d',RearBumper='%d',VentRight='%d',VentLeft='%d' WHERE besitzer='%d'",
	x,y,z,a,Spoiler,Hood,Roof,Sideskirt,Lamps,Nitro,Exhaust,Wheels,Stereo,Hydraulics,FrontBumper,RearBumper,VentRight,VentLeft,pInfo[playerid][db_id]);
	mysql_function_query(dbhandle,query,false,"","");
	return 1;
}
Reply
#17

3DTextLabels starts mixing up when your create and destroy them frequently. Create the 3Dtextlabel on gamemodeinit and then use Update3DTextLabelText when you want to remove or update it.

for example if you want to remove the 3Dtextlabel use
PHP код:
Update3DTextLabelText(RPNAMETEXT[playerid], 0xFFFFFFFF""); 

Also the problem is with the textlabel thats attached to the player so you don't need to mess with the other textlabels.
Reply
#18

Quote:
Originally Posted by Exhibit
Посмотреть сообщение
3DTextLabels starts mixing up when your create and destroy them frequently. Create the 3Dtextlabel on gamemodeinit and then use Update3DTextLabelText when you want to remove or update it.

for example if you want to remove the 3Dtextlabel use
PHP код:
Update3DTextLabelText(RPNAMETEXT[playerid], 0xFFFFFFFF""); 

Also the problem is with the textlabel thats attached to the player so you don't need to mess with the other textlabels.
The problem is not the rpname, the problem is that some random 3dtext from a bike rent is attached, without any reason, the bike rent text should be at the spawn. and i created it on ongamemodeinit, but i removed the rp name now above the head because its buggy as hell with that
Reply
#19

I don't see why you removed it. I clearly stated that they mix up when they are created and destroyed frequently. Use Update3DTextLabelText instead of Creating and Destroying them. That should fix the problem.
Reply
#20

Quote:
Originally Posted by ImTobi
Посмотреть сообщение
I have a new Problem, with my Car System, since i added tuning, it doesn't save anymore

My Code:

Код:
stock saveCars(playerid)
{
	new Spoiler, Hood, Roof, Sideskirt, Lamps, Nitro, Exhaust, Wheels, Stereo, Hydraulics, FrontBumper, RearBumper, VentRight, VentLeft;
	Spoiler = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_SPOILER);
	Hood = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_HOOD);
	Roof = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_ROOF);
	Sideskirt = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_SIDESKIRT);
	Lamps = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_LAMPS);
	Nitro = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_NITRO);
	Exhaust = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_EXHAUST);
	Wheels = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_WHEELS);
	Stereo = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_STEREO);
	Hydraulics = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_HYDRAULICS);
	FrontBumper = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_FRONT_BUMPER);
	RearBumper = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_REAR_BUMPER);
	VentRight = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_VENT_RIGHT);
	VentLeft = GetVehicleComponentInSlot(cInfo[playerid][id],CARMODTYPE_VENT_LEFT);
	new query[256];
	new Float:x,Float:y,Float:z,Float:a;
	GetVehiclePos(cInfo[playerid][id],x,y,z);
	GetVehicleZAngle(cInfo[playerid][id],a);
	format(query,sizeof(query),"UPDATE autos SET x='%f',y='%f',z='%f',a='%f',Spoiler='%d',Hood='%d',Roof='%d',Sideskirt='%d',Lamps='%d',Nitro='%d',Exhaust='%d',Wheels='%d',Stereo='%d',Hydraulics='%d',FrontBumper='%d',RearBumper='%d',VentRight='%d',VentLeft='%d' WHERE besitzer='%d'",
	x,y,z,a,Spoiler,Hood,Roof,Sideskirt,Lamps,Nitro,Exhaust,Wheels,Stereo,Hydraulics,FrontBumper,RearBumper,VentRight,VentLeft,pInfo[playerid][db_id]);
	mysql_function_query(dbhandle,query,false,"","");
	return 1;
}

now i need help with this
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)