RemoveBuildingForPlayer

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 17:20, 5 December 2011
Funky1234 (Talk | contribs)

← Previous diff
Revision as of 00:08, 6 December 2011
Smithy (Talk | contribs)
(Notes go above example)
Next diff →
Line 5: Line 5:
{{AddedIn0.3d|function}} {{AddedIn0.3d|function}}
- 
-{{note|"You cannot natively restore a building for a player after RemoveBuildingForPlayer has been called, however you can use an include such as the Global Remove Building include produced by funky1234 (a link is located further down this page)."}} 
{{Parameters|playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius}} {{Parameters|playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius}}
Line 15: Line 13:
{{Param|Float:fZ|The Z coordinate around which the objects will be removed.}} {{Param|Float:fZ|The Z coordinate around which the objects will be removed.}}
{{Param|Float:fRadius|The radius. Objects within this radius from the coordinates above will be removed.}} {{Param|Float:fRadius|The radius. Objects within this radius from the coordinates above will be removed.}}
 +
{{NoReturn}} {{NoReturn}}
 +
 +{{note|You cannot natively restore objects removed with RemoveBuildingForPlayer, however you can use an include such as the Global Remove Building include produced by funky1234 (link below).}}
 +funky1234's Global Remove Building include: http://forum.sa-mp.com/showthread.php?p=1551937
 +
<pawn> <pawn>
public OnPlayerConnect(playerid) public OnPlayerConnect(playerid)
{ {
- /* When the player connects model "615" which is veg_tree3 will be deleted within a range of 200.0 + // When the player connects model "615" which is veg_tree3 will be deleted within a range of 200.0
-from the point: 0.0, 0.0, 0.0, which is the center of San Andreas. */+ // 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); RemoveBuildingForPlayer(playerid, 615, 0.0, 0.0, 0.0, 200.0);
return 1; return 1;
} }
</pawn> </pawn>
- 
-funky1234's Global Remove Object include (with RestoreBuilding support): http://forum.sa-mp.com/showthread.php?p=1551937 
{{RelatedFunctions}} {{RelatedFunctions}}
{{DestroyObject}} {{DestroyObject}}
 +{{DestroyPlayerObject}}
[[Category:Scripting Functions]] [[Category:Scripting Functions]]

Revision as of 00:08, 6 December 2011




Description:

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


RemoveBuildingForPlayer was added in SA-MP 0.3d This function was added in SA-MP 0.3d and will not work in earlier versions!


Parameters:
(playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius)
playeridThe ID of the player to remove the objects for.
modelidThe model to remove.
Float:fXThe X coordinate around which the objects will be removed.
Float:fYThe Y coordinate around which the objects will be removed.
Float:fZThe Z coordinate around which the objects will be removed.
Float:fRadiusThe radius. Objects within this radius from the coordinates above will be removed.


Return Values:

This function does not return any specific values.


Image:32px-Ambox_warning_orange.png

Note

You cannot natively restore objects removed with RemoveBuildingForPlayer, however you can use an include such as the Global Remove Building include produced by funky1234 (link below).

funky1234's Global Remove Building include: http://forum.sa-mp.com/showthread.php?p=1551937


public OnPlayerConnect(playerid)
{
    // When the player connects model "615" which is veg_tree3 will be deleted 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;
}

Related Functions

The following functions may be helpful as they relate to this function in one way or another.

Personal tools