SAMP/RemoveBuildingForPlayer

Материал из Pawno Info Wikipedia

RemoveBuildingForPlayer

Wiki added.png

Добавлено

Фукнция работает только начиная с версии SA-MP 0.3d и не будет работать в предыдущих версиях!


Removes a standard San Andreas model for a single player within a specified range.


Parameters: (playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius) playerid The ID of the player to remove the objects for. modelid The model to remove. Float:fX The X coordinate around which the objects will be removed. Float:fY The Y coordinate around which the objects will be removed. Float:fZ The Z coordinate around which the objects will be removed. Float:fRadius The radius around the specified point to remove objects with the specified model.

Return Values: This function does not return any specific values.


Wiki removed.png

Предупреждение

There appears to be a limit of around 1000 lines/objects. There is no workaround.
When removing the same object for a player, they will crash. Commonly, players crash when reconnecting to the server because the server removes buildings on OnPlayerConnect.

public OnPlayerConnect(playerid) {

   // When the player connects, objects with model 615 will be removed within a
   // range of 200.0 from the point 0.0, 0.0, 0.0, which is the center of San Andreas.
   RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0);
   return 1;

}


Wiki tip.png

Подсказка

В версии 0.3.7 можно удалить все объекты на карте, используя следующие аргументы:
RemoveBuildingForPlayer(playerid, -1, 0.0, 0.0, 0.0, 6000.0);