number plate not work
#1

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]);
Reply
#2

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!
Reply
#3

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
Reply
#4

not work
Reply
#5

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,",,!,,");
Reply
#6

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

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
Reply
#8

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

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

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

PrintScreen:
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)