Szerző Téma: SetVehicleNumberPlateEx  (Megtekintve 193 alkalommal)

balintx

  • Vendég
SetVehicleNumberPlateEx
« Dátum: 2011. Október 20. - 21:09:40 »
0 Show voters
Nagyon egyszerû, a SetVehicleNumberPlateEx meghívásával azonnal frissül a rendszám a jármûvünkön, nem kell újraspawnolni, a funkció elvégez mindent - a jármû utasai megmaradnak, ahogyan a jármû HP-ja és pozíciója is visszaállításra kerül.
[pawn]stock SetVehicleNumberPlateEx(vehicleid, numplate[])
{
    if (!GetVehicleModel(vehicleid)) return false;
    if (strlen(numplate) > 32) numplate[31] = EOS;
    new a_Players[MAX_PLAYERS] = {-1, ...}, iVirtualWorld,
    Float:fVehX, Float:fVehY, Float:fVehZ, Float:fVehRot,
    Float:fVehVelocityX, Float:fVehVelocityY, Float:fVehVelocityZ, Float:fVehHealth;
    GetVehiclePos(vehicleid, fVehX, fVehY, fVehZ);
    GetVehicleZAngle(vehicleid, fVehRot);
    GetVehicleVelocity(vehicleid, fVehVelocityX, fVehVelocityY, fVehVelocityZ);
    GetVehicleHealth(vehicleid, fVehHealth);
    iVirtualWorld = GetVehicleVirtualWorld(vehicleid);
    for (new i = 0; i != MAX_PLAYERS; i++)
    {
        if (!IsPlayerInVehicle(i, vehicleid)) continue;
        a_Players = GetPlayerVehicleSeat(i);

        RemovePlayerFromVehicle(i);


    }


    SetVehicleVirtualWorld(vehicleid, iVirtualWorld + 25_000);


    SetVehicleNumberPlate(vehicleid, (numplate[0] == EOS) ? \"\\32\\0\" : numplate);


    SetVehicleVirtualWorld(vehicleid, iVirtualWorld);


    for (new i = 0; i != MAX_PLAYERS; i++)


        if (a_Players
!= -1) PutPlayerInVehicle(i, vehicleid, a_Players);

    SetVehiclePos(vehicleid, fVehX, fVehY, fVehZ);


    SetVehicleZAngle(vehicleid, fVehRot);


    SetVehicleVelocity(vehicleid, fVehVelocityX, fVehVelocityY, fVehVelocityZ);


    SetVehicleHealth(vehicleid, fVehHealth);


    return true;


}[/pawn]
« Utoljára szerkesztve: 2011. November 13. - 13:35:14 írta APC »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal