User Tools

Site Tools


scripting:reference:system_functions:playerbuildingownershipfunctions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
scripting:reference:system_functions:playerbuildingownershipfunctions [2020/01/29 04:34] – created mitscripting:reference:system_functions:playerbuildingownershipfunctions [2023/07/18 04:15] (current) mit
Line 2: Line 2:
  
 Functions allowing you to query and manipulate the ownership of buildings Functions allowing you to query and manipulate the ownership of buildings
 +
 +==== sysPlayerGetNumBuildingsOwned ====
 +^ Format | sysPlayerGetNumBuildingsOwned ( PlayerID )|
 +^ Description | Returns the number of buildings the specified player currently owns |
 +^ Returns | Number owned |
 +//Example//: <note>
 +<code>Event( "Custom", "CountBuildings" )
 +{
 +    $numOwned = sysPlayerGetNumBuildingsOfType( $gPlayerID )
 +    *msg %PLAYER% You currently own $numOwned buildings
 +}
 +</code>
 +</note>
  
 ==== sysPlayerGetNumBuildingsOfType ==== ==== sysPlayerGetNumBuildingsOfType ====
-^ Format | sysPlayerGetNumBuildingsOfType ( [PlayerID][BuildingType)|+^ Format | sysPlayerGetNumBuildingsOfType ( PlayerID, BuildingType )|
 ^ Description | Returns the number of buildings of a particular type that the specified player currently owns | ^ Description | Returns the number of buildings of a particular type that the specified player currently owns |
-^ Parameters | **[PlayerID]** - ID number of the player | 
-^ | **[BuildingType]** - Building type number | 
 ^ Returns | Number owned | ^ Returns | Number owned |
 //Example//: <note> //Example//: <note>
Line 17: Line 28:
 </code> </code>
 </note> </note>
 +
 +==== sysPlayerGetNumBuildingsOfBuildSkill ====
 +^ Format | sysPlayerGetNumBuildingsOfBuildSkill ( PlayerID, Skill Name/Num )|
 +^ Description | Returns the number of buildings the specified player currently owns that require the specified build skill |
 +^ Returns | Number owned |
 +//Example//: <note>
 +<code>Event( "Custom", "CountBuildings" )
 +{
 +    $numOwned = sysPlayerGetNumBuildingsOfBuildSkill ( $gPlayerID, "Baker" )
 +    *msg %PLAYER% You currently own $numOwned buildings that require the Baker skill to construct
 +}
 +</code>
 +</note>
 +
 ==== sysPlayerGetNearestOwnedBuildingOfType ==== ==== sysPlayerGetNearestOwnedBuildingOfType ====
-^ Format | sysPlayerGetNearestOwnedBuildingOfType ( [PlayerID][BuildingType][WorldX][WorldY) |+^ Format | sysPlayerGetNearestOwnedBuildingOfType ( PlayerID, BuildingType, WorldX, WorldY ) |
 ^ Description | Locates the nearest building of the specified type owned by the player. If no WorldX, WorldY is specified, the players current position is used instead | ^ Description | Locates the nearest building of the specified type owned by the player. If no WorldX, WorldY is specified, the players current position is used instead |
-^ Parameters | Player ID number  | 
-^  | Building type number  | 
-^  | WorldX, WorldY | 
 ^ Returns | BuildingID or 0 if the player doesn't own a building of that type | ^ Returns | BuildingID or 0 if the player doesn't own a building of that type |
 //Example//:<note> //Example//:<note>
Line 41: Line 63:
 </note> </note>
 ==== sysPlayerGetOwnedBuilding ==== ==== sysPlayerGetOwnedBuilding ====
-^ Format | sysPlayerGetOwnedBuilding ( [PlayerID][Index) | +^ Format | sysPlayerGetOwnedBuilding ( PlayerID, Index ) | 
-^ Description | Used to get the IDs of buildings owned by the player +^ Description | Used to get the IDs of a specific building owned by the player |
-^ Parameters | [PlayerID] - Player ID number +
-^  | [Index] - Number in the list of owned buildings  |+
 ^ Returns | BuildingID or 0 if the player doesnt own that many buildings | ^ Returns | BuildingID or 0 if the player doesnt own that many buildings |
 +^ Notes | **Index** indicates which building in the player's owned list you're querying. 
 //Example//:<note> //Example//:<note>
 <code>Function SendOwnedBuildingsList( $playerID ) <code>Function SendOwnedBuildingsList( $playerID )
scripting/reference/system_functions/playerbuildingownershipfunctions.1580294048.txt.gz · Last modified: 2020/01/29 04:34 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki