SA-MP Forums Archive
number plate not work - 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: number plate not work (/showthread.php?tid=325739)



number plate not work - TouhGear - 14.03.2012

I have mysql gamemode. Why not load number plate in database? code:
Code:
mysql_get_field("Plate",result); strmid(CarInfo[Vehicle][cRegistration], result, 0, strlen(result), 255);//
SetVehicleNumberPlate(Vehicle,CarInfo[Vehicle][cRegistration]);



Re: number plate not work - Lee_Percox - 14.03.2012

I believe you need to respawn the vehicle after you set it's vehicle plate. I may be wrong but I am sure you do!


Re: number plate not work - mineralo - 14.03.2012

also you can't use a string lenght more than 7-10 for plate because won't show the number, if you use a car system set number plate when you're create like
pawn Code:
...
Cars[idx][ownedvehicle] = CreateVehicle(Cars[idx][cModel],Cars[idx][cX],Cars[idx][cY],Cars[idx][cZ],Cars[idx][cAngle],Cars[idx][cCol1],Cars[idx][cCol2],120);
SetVehicleNumberPlate(Cars[idx][ownedvehicle],Cars[idx][cPlate]);
its a good way to set plate for not respawn your vehicle after create them, I posted mine system but I think you would understand what to do if you going make a good server


Re: number plate not work - TouhGear - 17.03.2012

not work


Re: number plate not work - mineralo - 17.03.2012

lol, its should works because I use myself, YOU SHOULD ADD SetVehicleNumberPlate when you're creating cars, like
pawn Code:
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a, -1, -1, -1);
        SetVehicleNumberPlate(PlayersVehicle,",,!,,");



Re: number plate not work - Smally - 17.03.2012

In your server.log do you get any MySQL query errors?


Re: number plate not work - TouhGear - 17.03.2012

now i have this problem.
Code:
CMD:setplate(playerid, params[])
{
	new string[STR_MAX];
	new plate[32];
	new vehicleid = GetPlayerVehicleID(playerid);
	new i = GetBuyCarId(playerid);
	if(sscanf(params, "s", plate))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /setplate [Plate Name]");
    }
	else
		{
			format(string, sizeof(string), "You have set your vehicle's plate to %s", plate);
			SendClientMessage(playerid, 0xFF000AA, string);
			CarInfo[i][cLicense] = plate;
			SetVehicleNumberPlate(GetPlayerVehicleID(playerid), plate);
			SetVehicleToRespawn(vehicleid);
			PutPlayerInVehicle(playerid, vehicleid, 0);
			OnCarUpdate(i);
        }
	return 1;
}
Code:
funktsioon OnCarUpdate(i)
{
	new sql[512];
	format(sql, sizeof(sql), "UPDATE cars SET Owned = '%d', Owner = '%d', License = '%d' WHERE CarId = '%d'",
	CarInfo[i][cOwned], CarInfo[i][cOwner], CarInfo[i][cLicense], i);
	mysql_query(sql);
	return 1;
}
I go databaasi he does not show it there numrbit characters.
Please help me


Re: number plate not work - Smally - 17.03.2012

PrntScrn your database structure in the table it gets the vehicle from.


Re: number plate not work - AndreT - 17.03.2012

You have one single quote too much here:
License = '%d''
Remove it.


Re: number plate not work - TouhGear - 17.03.2012

Database: `License` varchar(100) NOT NULL DEFAULT 'None'

PrintScreen: