SA-MP Forums Archive
SCRIPTING HELP (+REP) - 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)
+--- Thread: SCRIPTING HELP (+REP) (/showthread.php?tid=643943)



SCRIPTING HELP (+REP) - maksicnm - 30.10.2017

I need help about Vehicle Plates

Code for Plates:
Код HTML:
	{
	new string[30];
	format(string, sizeof(string),"BG - %d", Vehicles);
	SetVehicleNumberPlate(Vehicles, string);
	SetVehicleToRespawn(Vehicles);
	}
Код HTML:
Enum for Vehicles
{
	avModel,
    Float:avPozX,
    Float:avPozY,
    Float:avPozZ,
    Float:avPozA,
    avBoja1,
    avBoja2,
    avVlasnik[60],
    avImaVlasnika,
	avID,
	avZakljucan,
	avCijena
}
So i need to import avID to plate code, please help <3

EDIT: I mean vehicle id to replace %d


Re: SCRIPTING HELP (+REP) - Escobabe - 30.10.2017

Do you mean to show "BG - VehicleID"
or "BG - avID" ?


Re: SCRIPTING HELP (+REP) - maksicnm - 30.10.2017

BG - avID


Re: SCRIPTING HELP (+REP) - Escobabe - 30.10.2017

PHP код:
format(stringsizeof(string),"BG - %d"Vehicles[avID]); 
I don't know exactly how do you use your vehicle enums, but try this.


Re: SCRIPTING HELP (+REP) - kingmk - 30.10.2017

Quote:
Originally Posted by maksicnm
Посмотреть сообщение
I need help about Vehicle Plates

Code for Plates:
Код HTML:
	{
	new string[30];
	format(string, sizeof(string),"BG - %d", Vehicles);
	SetVehicleNumberPlate(Vehicles, string);
	SetVehicleToRespawn(Vehicles);
	}
Код HTML:
Enum for Vehicles
{
	avModel,
    Float:avPozX,
    Float:avPozY,
    Float:avPozZ,
    Float:avPozA,
    avBoja1,
    avBoja2,
    avVlasnik[60],
    avImaVlasnika,
	avID,
	avZakljucan,
	avCijena
}
So i need to import avID to plate code, please help <3

EDIT: I mean vehicle id to replace %d
Try this.
Код:
for(new v = 1; v < MAX_VEHICELS; v++) //MAX_VEHILCES or your pool enum. EX: new VehEnum[50][EnumVeh]; Then replace MAX_VEHICLES with 50
{
	new string[30];
	format(string, sizeof(string),"BG - %d", VehEnum[v][avID]);
	SetVehicleNumberPlate(v, string);
	SetVehicleToRespawn(v);
}
Also i recommand to do that, when u load your vehicles form ur database.