06.01.2011, 16:45
I'm using this code to change plates:
pawn Код:
// Sets your numberplate
dcmd_plate(playerid, params[])
{
// Setup local variables
new vehicleid, engine, lights, alarm, doors, bonnet, boot, objective, Plate[32];
// Get the player's vehicle
vehicleid = GetPlayerVehicleID(playerid);
if (vehicleid != 0)
{
if (sscanf(params, "s[32]", Plate)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/plate <NumberPlate>\"");
else
{
// Set the numberplate
SetVehicleNumberPlate(vehicleid, Plate);
// Remove the player from the vehicle
RemovePlayerFromVehicle(playerid);
// Respawn the vehicle
SetVehicleToRespawn(vehicleid);
// Put the player back in the vehicle
PutPlayerInVehicle(playerid, vehicleid, 0);
// Turn on the engine and lights the current status of the vehicle
GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
}
}
else
SendClientMessage(playerid, 0x00FF00FF, "You must be inside a vehicle to change your numberplate");
// Let the server know that this was a valid command
return 1;
}

