SA-MP Forums Archive
3D Plates on vehicles, how to? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 3D Plates on vehicles, how to? (/showthread.php?tid=151540)



3D Plates on vehicles, how to? - Ihsan_Cingisiz - 30.05.2010

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?


Re: 3D Plates on vehicles, how to? - Conroy - 30.05.2010

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);
}



Re: 3D Plates on vehicles, how to? - Aleksandar_Zivanovci - 30.05.2010

... nice


Re: 3D Plates on vehicles, how to? - Aleksandar_Zivanovci - 30.05.2010

Код:
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.



Re: 3D Plates on vehicles, how to? - Conroy - 30.05.2010

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


Re: 3D Plates on vehicles, how to? - Aleksandar_Zivanovci - 30.05.2010

Код:
	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. . .


Re: 3D Plates on vehicles, how to? - ReVo_ - 30.05.2010

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


Re: 3D Plates on vehicles, how to? - Aleksandar_Zivanovci - 30.05.2010

//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


Re: 3D Plates on vehicles, how to? - Aleksandar_Zivanovci - 30.05.2010

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



Re: 3D Plates on vehicles, how to? - Conroy - 30.05.2010

Any errors/warnings?