AddSimpleModel

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 08:39, 31 December 2018
RoboN1X (Talk | contribs)

← Previous diff
Revision as of 08:43, 31 December 2018
RoboN1X (Talk | contribs)

Next diff →
Line 6: Line 6:
{{Parameters|virtualworld, baseid, newid, dffname[], txdname[]}} {{Parameters|virtualworld, baseid, newid, dffname[], txdname[]}}
-{{Param|virtualworld|The [[SetPlayerVirtualWorld|virtual world ID]] to make the model available at. Use -1 for all worlds.)}}+{{Param|virtualworld|The [[SetPlayerVirtualWorld|virtual world ID]] to make the model available at. Use -1 for all worlds.}}
{{Param|baseid|The base [[Game_Object_ID_List|object model ID]] to use.}} {{Param|baseid|The base [[Game_Object_ID_List|object model ID]] to use.}}
{{Param|newid|The new object model ID ranged from -1000 to -30000 (29000 slots) to be used later with [[CreateObject]] or [[CreatePlayerObject]].}} {{Param|newid|The new object model ID ranged from -1000 to -30000 (29000 slots) to be used later with [[CreateObject]] or [[CreatePlayerObject]].}}
Line 13: Line 13:
{{ReturnsSuccess}} {{ReturnsSuccess}}
 +
 +{{Note|When virtualworld is set, the [[OnPlayerFinishedDownloading|models will be downloaded once the player enters the specific world]]}}
{{Example|Using '''artconfig.txt'''}} {{Example|Using '''artconfig.txt'''}}
Line 27: Line 29:
</pawn> </pawn>
-{{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.}}+{{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.}}
{{RelatedFunctions}} {{RelatedFunctions}}
{{AddSimpleModelTimed}} {{AddSimpleModelTimed}}
 +
 +{{RelatedCallbacks}}
 +{{OnPlayerFinishedDownloading}}
[[Category:Scripting Functions]] [[Category:Scripting Functions]]

Revision as of 08:43, 31 December 2018



This function was added in SA-MP 0.3.DL R1 and will not work in earlier versions!


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.


Parameters:
(virtualworld, baseid, newid, dffname[], txdname[])
virtualworldThe virtual world ID to make the model available at. Use -1 for all worlds.
baseidThe base object model ID to use.
newidThe new object model ID ranged from -1000 to -30000 (29000 slots) to be used later with CreateObject or CreatePlayerObject.
dffnameName of the .dff model collision file located in models server folder.
txdnameName of the .txd model texture file located in models server folder.


Return Values:

  • 1: The function executed successfully.
  • 0: The function failed to execute.


Image:32px-Ambox_warning_orange.png

Note

When virtualworld is set, the models will be downloaded once the player enters the specific world


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;
}
Image:32px-Circle-style-warning.png

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.

Template:AddSimpleModelTimed

Related Callbacks

The following callbacks might be useful as well, as they are related to this callback in one way or another.