3D Plates on vehicles, how to?
#1

How can i do this?
I want to add 3D license plate like Valhalla
It is so nice, but i don't know how
Who can help me?
Reply
#2

Assuming you have a vehicle script, make it produce a random license plate, if not then use the vehicle ID.

pawn Код:
new 3DText:VehicleLicense[MAX_VEHICLES];
pawn Код:
//OnGameModeInit
for(new vehid; vehid < MAX_VEHICLES; vehid++)
{
new message[128];
format(message,sizeof(message), "%i", vehid);
VehicleLicense[vehid] = Create3DTextLabel(message, COLOR, 0.0, 0.0, 0.0, 50.0, 0, 0);
Attach3DTextLabelToVehicle(VehicleLicense[vehid], vehid, 0.0, 0.0, 2.0);
}
Reply
#3

... nice
Reply
#4

Код:
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(773) : warning 217: loose indentation
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(834) : error 001: expected token: "-identifier-", but found "3"
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(836) : error 017: undefined symbol "VehicleLicense"
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(836) : warning 215: expression has no effect
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(836) : error 001: expected token: ";", but found "]"
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(836) : error 029: invalid expression, assumed zero
F:\Documents and Settings\Zivanovici\Desktop\server\gamemodes\grandrp.pwn(836) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#5

pawn Код:
new 3DText:VehicleLicense[MAX_VEHICLES];
You added this at the top of your script?
Reply
#6

Код:
	new Text:VehicleLicense[MAX_VEHICLES];
 	for(new vehid; vehid < MAX_VEHICLES; vehid++){
	new message[128];
	format(message,sizeof(message), "%i", vehid);
	VehicleLicense[vehid] = Create3DTextLabel(message, COLOR_LIGHTBLUE, 0.0, 0.0, 0.0, 50.0, 0, 0);
	Attach3DTextLabelToVehicle(VehicleLicense[vehid], vehid, 0.0, 0.0, 2.0);
	}
this works. . .
Reply
#7

Put 'new Text:VehicleLicense[MAX_VEHICLES];' in top of you script
Reply
#8

//yes, but there is still bug, it load all cars, but when i connect, there is no one car

my fail, i added new field in database and everything changed
Reply
#9

sorry for double post, but is it possible to add that function in OnPlayertCommandText()

something like this
Код:
if(strcmp(cmd, "/addvehicle", true) == 0){
 new addmodelid, color1, color2, addtmp[256], addquery[512];
 new Float:x, Float:y, Float:z, Float:Angle;
 if(PlayerInfo[playerid][AdminLevel] < 10){
  SendClientMessage(playerid, COLOR_RED, "You must be server administrator if you want to add faction car.");
  return 1;
 }
 addtmp = strtok(cmdtext, idx);
	
 if(!strlen(addtmp)){
  SendClientMessage(playerid, COLOR_GREY, "USAGE: /addvehicle [model_id] [color1] [color2]");
  return 1;
 }
 addmodelid = strval(addtmp);
	
 addtmp = strtok(cmdtext, idx);

 if(!strlen(addtmp)){
  SendClientMessage(playerid, COLOR_GREY, "USAGE: /addvehicle [model_id] [color1] [color2]");
  return 1;
 }
 color1 = strval(addtmp);

 addtmp = strtok(cmdtext, idx);
	
 if(!strlen(addtmp)){
  SendClientMessage(playerid, COLOR_GREY, "USAGE: /addvehicle [model_id] [color1] [color2]");
  return 1;
 }
 color2 = strval(addtmp);
 GetPlayerPos(playerid, x, y, z);
 GetPlayerFacingAngle(playerid, Angle);
 format(addquery, sizeof(addquery), "INSERT INTO static_vehicles (model_id, x, y, z, angle, color1, color2) VALUES (%d, %f, %f, %f, %f, %d, %d)", addmodelid, x, y, z, Angle, color1, color2);
 mysql_query(addquery);
 wait(3);
 new vehid, message[128];
 vehid = CreateVehicle(addmodelid, x, y, z, Angle, color1, color2, 600);
 format(message,sizeof(message), "SA-%i-LS", vehid);
 VehicleLicense[vehid] = Create3DTextLabel(message, COLOR_LIGHTBLUE, 0.0, 0.0, 0.0, 25.0, GetVehicleVirtualWorld(vehid), 1);
 Attach3DTextLabelToVehicle(VehicleLicense[vehid], vehid, 0.0, -2.0, 0.0);
 return 1;
}
it is not working i dont know why
Reply
#10

Any errors/warnings?
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)