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);
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. |
Create3DTextLabel("[ /fmieten ]\num ein Fahrrad zu mieten",COLOR_YELLOW,-1981.6117,130.0222,27.6875,30,0,1);
RPNAMETEXT[playerid] = Create3DTextLabel(pInfo[playerid][rpname],COLOR_WHITE,0.0,0.0,0.0,30,0,1);
new Text:id = Create3DTextLabel("[ /fmieten ]\num ein Fahrrad zu mieten",COLOR_YELLOW,-1981.6117,130.0222,27.6875,30,0,1);
print(id);
RPNAMETEXT[playerid] = Create3DTextLabel(pInfo[playerid][rpname],COLOR_WHITE,0.0,0.0,0.0,30,0,1);
print(RPNAMETEXT[playerid]);
That's odd
PHP код:
PHP код:
|
format("%d", id);
It's just a warning but if you don't like warnings then this
PHP код:
|
new Text3D: id = Create3DTextLabel("test", -1, 0.0, 0.0, 0.0, 0.0, 0, 0),
Text3D: id2 = Create3DTextLabel("test", -1, 0.0, 0.0, 0.0, 0.0, 0, 0)
;
printf("%d", id);
new strid[2];
format(strid, sizeof strid, "%d", id);
print(strid);
printf("%d", id2);
format(strid, sizeof strid, "%d", id2);
print(strid);
[02:57:46] 0 [02:57:46] 0 [02:57:46] 1 [02:57:46] 1 |
This should be the code
PHP код:
|
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? |
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. |
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; }
Update3DTextLabelText(RPNAMETEXT[playerid], 0xFFFFFFFF, "");
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 код:
Also the problem is with the textlabel thats attached to the player so you don't need to mess with the other textlabels. |
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; } |