AddSimpleModel
From SA-MP Wiki
(Difference between revisions)
Revision as of 08:39, 31 December 2018
Description:
Adds a new custom simple object model for download. The model files will be stored in player's Documents\GTA San Andreas User Files\SAMP\cache under the Server IP and Port folder in a CRC-form file name.
(virtualworld, baseid, newid, dffname[], txdname[])
virtualworld | The virtual world ID to make the model available at. Use -1 for all worlds.) |
baseid | The base object model ID to use. |
newid | The new object model ID ranged from -1000 to -30000 (29000 slots) to be used later with CreateObject or CreatePlayerObject. |
dffname | Name of the .dff model collision file located in models server folder. |
txdname | Name of the .txd model texture file located in models server folder. |
Return Values:
- 1: The function executed successfully.
- 0: The function failed to execute.
Example Usage: Using artconfig.txt
AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd");
Example Usage: Pawn Script
public OnGameModeInit() { AddSimpleModel(-1, 19379, -2000, "wallzzz.dff", "wallzzz.txd"); return 1; }
Note | There are currently no restrictions on when you can call this function, but be aware that if you do not call them inside OnFilterScriptInit/OnGameModeInit, you run the risk that some players, who are already on the server, may not have downloaded the models. |
[edit]
Related Functions
The following functions may be useful, as they are related to this function in one way or another.