pawn Код:
stock SetVehicleNumberPlateEx(vehicleid, numberplate[])
{
static
iLoopIdx,
iReturnValue,
iDamageStatus[4],
Float: fPos[3],
Float: fAngle,
Float: fVelocity[3],
Float: fHealth
;
if ( !GetVehicleModel(vehicleid) )
return 0;
if ( strlen(numberplate) > 32 )
numberplate[32] = 0;
GetVehiclePos(vehicleid, fPos[0], fPos[1], fPos[2]);
GetVehicleZAngle(vehicleid, fAngle);
GetVehicleVelocity(vehicleid, fVelocity[0], fVelocity[1], fVelocity[2]);
GetVehicleHealth(vehicleid, fHealth);
GetVehicleDamageStatus(vehicleid, iDamageStatus[0], iDamageStatus[1], iDamageStatus[2], iDamageStatus[3]);
new bPlayerData[MAX_PLAYERS] = { -1, ... };
for ( iLoopIdx = 0; iLoopIdx < 500; iLoopIdx++ )
{
if ( IsPlayerInVehicle(iLoopIdx, vehicleid) )
{
bPlayerData[iLoopIdx] = GetPlayerVehicleSeat(iLoopIdx);
RemovePlayerFromVehicle(iLoopIdx);
SetPlayerPos(iLoopIdx, fPos[0], fPos[1], fPos[2]); // if RPFV would not work
}
}
iReturnValue = SetVehicleNumberPlate(vehicleid, numberplate);
SetVehicleToRespawn(vehicleid);
for ( iLoopIdx = 0; iLoopIdx < 500; iLoopIdx++ )
{
if ( bPlayerData[iLoopIdx] != -1 )
{
PutPlayerInVehicle(iLoopIdx, vehicleid, bPlayerData[iLoopIdx]);
}
}
SetVehiclePos(vehicleid, fPos[0], fPos[1], fPos[2]);
SetVehicleZAngle(vehicleid, fAngle);
SetVehicleVelocity(vehicleid, fVelocity[0], fVelocity[1], fVelocity[2]);
SetVehicleHealth(vehicleid, fHealth);
UpdateVehicleDamageStatus(vehicleid, iDamageStatus[0], iDamageStatus[1], iDamageStatus[2], iDamageStatus[3]);
return iReturnValue;
}