SetVehicleNumberPlate problem and one other thing - 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: SetVehicleNumberPlate problem and one other thing (
/showthread.php?tid=208587)
SetVehicleNumberPlate problem and one other thing -
r0v3r - 08.01.2011
So here is what I use for setting license plates to owned vehicles only
Код:
new licstring [ 128 ], string [ 128 ];
format(licstring, sizeof(licstring),"RX %d", Player[playerid][LicensePlate1]);
SetVehicleNumberPlate( veh1id, licstring);
SetVehicleToRespawn( veh1id );
format( string, sizeof( string ), "Plates/%s.ini", licstring);
dini_Create( string);
dini_Set( string, "Owner", Player[playerid][NormalName]);
It's under the function when the owned car is being spawned. It should work because it used to work before, but after changing hosts it no longer works.
Another thing
I want to make a command so when a PD officer types /checklicenseplate and the plate he gets the name of the person owning this car. That's why the last 3 lines are in here. Here's what i've done so far.
Код:
command(checklicenseplate, playerid, params[])
{
new Plate[ 128 ], string[ 128 ], string2[ 128 ];
if( sscanf( params, "z", Plate) )
{
if(Groups[Player[playerid][Group]][CommandTypes] == 1 && Groups[Player[playerid][Group]][CommandTypes] == 4)
{
SendClientMessage( playerid, WHITE, "SYNTAX: /checklicenseplate [plate]" );
}
}
else
{
if(Groups[Player[playerid][Group]][CommandTypes] == 1 && Groups[Player[playerid][Group]][CommandTypes] == 4)
{
format( string2, sizeof( string2), "Plates/%s.ini", Plate);
if(fexist( string2) )
{
if(dini_Int( string2, "Owner" ) == Player[playerid][NormalName])
{
SendClientMessage( playerid, WHITE, "There is no point of checking yourself" );
}
else
{
format( string, sizeof( string ), "Owner: %s", dini_Int( string2, "Owner" ));
SendClientMessage( playerid, WHITE, string );
}
}
}
}
}
Please I need your help