AddCharModel
From SA-MP Wiki
(Difference between revisions)
Revision as of 08:45, 31 December 2018 RoboN1X (Talk | contribs) (note --> warning) ← Previous diff |
Revision as of 08:48, 31 December 2018 RoboN1X (Talk | contribs) Next diff → |
||
Line 32: | Line 32: | ||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{SetPlayerSkin}} | {{SetPlayerSkin}} | ||
+ | {{GetPlayerCustomSkin}} | ||
[[Category:Scripting Functions]] | [[Category:Scripting Functions]] |
Revision as of 08:48, 31 December 2018
Description:
Adds a new custom character 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.
(baseid, newid, dffname[], txdname[])
baseid | The base skin model ID to use (behavior of the character.) |
newid | The new skin model ID ranged from 20000 to 30000 (10000 slots) to be used later with SetPlayerSkin |
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
AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd");
Example Usage: Pawn Script
public OnGameModeInit() { AddCharModel(305, 20001, "lvpdpc2.dff", "lvpdpc2.txd"); AddCharModel(305, 20002, "lapdpd2.dff", "lapdpd2.txd"); return 1; }
Warning | 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. |
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- SetPlayerSkin: Set a player's skin.