Numberplate
#2

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;
}
Reply


Messages In This Thread
Numberplate - by [SU]Fnugski - 06.01.2011, 15:38
Re: Numberplate - by PowerPC603 - 06.01.2011, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)