3d Text Above Vehicle
#1

I want to make when Taxi Member types /fare. above his vehicle is written "Taxi Member On Duty! Price: NUMBER$."

Here is my command /fare

Код:
if(strcmp(cmd,"/fare",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
	        if(PlayerInfo[playerid][pMember] == 10||PlayerInfo[playerid][pLeader] == 10|| PlayerInfo[playerid][pJob] == 14)
			{
				if(TransportDuty[playerid] > 0)
				{
				    if(TransportDuty[playerid] == 1)
				    {
				        TaxiDrivers -= 1;
				    }
				    else if(TransportDuty[playerid] == 2)
				    {
				        BusDrivers -= 1;
				    }
				    TransportDuty[playerid] = 0;
					format(string, sizeof(string), "*You are not anymore on duty and you earn{FFFFFF}%d{FFFF00}$.", TransportMoney[playerid]);
					SendClientMessage(playerid, COLOR_YELLOW, string);
					GivePlayerCash(playerid, TransportMoney[playerid]);
					TransportValue[playerid] = 0; TransportMoney[playerid] = 0;
					return 1;
				}
				new idv = GetPlayerVehicleID(playerid);
				if(IsAnTaxiCar(idv))
				{
				    if(GetPlayerState(playerid) == 2)
				    {
					    tmp = strtok(cmdtext, idx);
						if(!strlen(tmp))
						{
							SendClientMessage(playerid, COLOR_WHITE, "{FFDEBA}Koristite:{FFFFFF} /fare [Cijena]");
							return 1;
						}
						moneys = strval(tmp);
						if(moneys < 1 || moneys > 101) { SendClientMessage(playerid, COLOR_RED, "*{C4C4C4}Cijena prijevoza ne moze biti ispod $1 i preko $100."); return 1; }
					    TaxiDrivers += 1; TransportDuty[playerid] = 1; TransportValue[playerid] = moneys;
					    GetPlayerName(playerid,sendername,sizeof(sendername));
					}
					else
					{
					    SendClientMessage(playerid, COLOR_RED, "(Greska){C4C4C4} Niste vozac.");
					    return 1;
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_RED, "(Greska){C4C4C4} Niste u Taxi vozilu ili busu.");
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_RED, "(Greska){C4C4C4} Niste taxist ili bus vozac!");
			    return 1;
			}
	    }
	    return 1;
 	}
Reply
#2

It's quite simple first create a 3DTextLabel then use Attach3DTextLabelToVehicle to attach the 3dtextlabel to your taxi. But don't forget to destroy the Label after OnVehicleDeath
Reply
#3

can you explain me a more detailed?
Reply
#4

Quote:
Originally Posted by fury14
Посмотреть сообщение
can you explain me a more detailed?
what do you want to know more about that

example

https://sampwiki.blast.hk/wiki/Attach3DTextLabelToVehicle

But even the wiki make misstakes

PHP код:
vehicle_id CreateVehicle5100.00.015.050120 ); 
to

PHP код:
vehicle_id CreateVehicle5100.00.015.00.050120 ); 
Vehicleid X Y Z R color1 color2 respawndelay
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)