Vehicle 3DTextLabels
#1

Searched on ****** for this, and all i managed to find was unsolved questions...

But how do i attach a 3DTextLabel to ethically a Police Car, or any vehicle?
If you dont understand, look at this image:

Reply
#2

This May Be Helpfull :
https://sampwiki.blast.hk/wiki/Attach3DTextLabelToVehicle
Reply
#3

I actually found this now after long searching:

Quote:
Originally Posted by PawelQ
Посмотреть сообщение
At the top of your script:
Код HTML:
new vehiclecallsign[MAX_VEHICLES];
Command: ( you have to edit it to be used by your script )
Код HTML:
CMD:callsign(playerid, params[])
{
    new vehicleid;
    vehicleid = GetPlayerVehicleID(playerid);
	new string[32];
	if(!IsPlayerInAnyVehicle(playerid)) return SendErrorMessage(playerid, "You're not in a vehicle.");
	if (GetFactionType(playerid) != FACTION_POLICE)
		return SendErrorMessage(playerid, "You must be a police officer.");
	if (!IsACruiser(GetPlayerVehicleID(playerid)))
	    return SendErrorMessage(playerid, "You must be inside a police cruiser.");
	if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 1)
	{
 		Delete3DTextLabel(vehicle3Dtext[vehicleid]);
	    vehiclecallsign[vehicleid] = 0;
	    SendClientMessage(playerid, COLOR_RED, "Callsign removed.");
	    return 1;
	}
	if(sscanf(params, "s[32]",string)) return SendErrorMessage(playerid, "You must enter a callsign.");
	if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 0)
	{
		vehicle3Dtext[vehicleid] = Create3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.0, 10.0, 0, 1);
		Attach3DTextLabelToVehicle(vehicle3Dtext[vehicleid], vehicleid, 0.0, -2.8, 0.0);
		vehiclecallsign[vehicleid] = 1;
	}
	return 1;
}
But it's hard to understand for me, i've tried to edit it to this to follow my gamemode, which has removed alot of errors as of now:

Код HTML:
CMD:callsign(playerid, params[])
{
    new vehicleid;
    vehicleid = GetPlayerVehicleID(playerid);
	new string[32];
	if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in a car.");
if(!IsACop(playerid) && !IsAHp(playerid) && !IsAHSF(playerid) && !IsASWAT(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an Law Enforcement officer.");
    if( GetVehicleModel(vehicleid) == 596 || GetVehicleModel(vehicleid) == 597 || GetVehicleModel(vehicleid) == 427 || GetVehicleModel(vehicleid) == 523 || GetVehicleModel(vehicleid) == 599 || GetVehicleModel(vehicleid) == 601 )
	if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 1) return SendClientMessage(playerid, COLOR_GREY, "You are not in a Police cruiser.");
	{
 		Delete3DTextLabel(vehicle3Dtext[vehicleid]);
	    vehiclecallsign[vehicleid] = 0;
	    SendClientMessage(playerid, COLOR_RED, "Callsign removed.");
	    return 1;
	}
	if(sscanf(params, "s[32]",string)) return SendErrorMessage(playerid, "You must enter a callsign.");
	if(vehiclecallsign[GetPlayerVehicleID(playerid)] == 0)
	{
		vehicle3Dtext[vehicleid] = Create3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.0, 10.0, 0, 1);
		Attach3DTextLabelToVehicle(vehicle3Dtext[vehicleid], vehicleid, 0.0, -2.8, 0.0);
		vehiclecallsign[vehicleid] = 1;
	}
	return 1;
}
But im stuck with some errors i do not understand how to remove:

(18446) : error 017: undefined symbol "vehicle3Dtext"
(18446) : warning 215: expression has no effect
(18446) : error 001: expected token: ";", but found "]"
(18446) : error 029: invalid expression, assumed zero

Seems all to be on line 18446, which is this:
Код HTML:
{           //Line 18446 underneath
            Delete3DTextLabel(vehicle3Dtext[vehicleid]);
	    vehiclecallsign[vehicleid] = 0;
	    SendClientMessage(playerid, COLOR_RED, "Callsign removed.");
	    return 1;
}
Notice: Line positions seem to mess up in this post a bit.
Reply
#4

Briefly it seems to me that i just need help how to find and delete a 3DTextLabel that is attached to a vehicle as shown above.
Reply
#5

Can anybody help me?
Reply
#6

Bump.
Reply
#7

Bump again.
Reply
#8

Bump.
Reply
#9

Do you have this;
new Text3D:vehicle3Dtext[MAX_VEHICLES];
added?
Reply
#10

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Do you have this;
new Text3D:vehicle3Dtext[MAX_VEHICLES];
added?
Oh, i forgot the : between them, that was the problem.
Well thanks, solved.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)