RequestSpawn: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
</source>| | </source>| | ||
note= Inside the function [[OnNPCClassSelect]], use Team, color, position to check if the class matches as it is not possible to obtain the class id directly.| | note= Inside the function [[OnNPCClassSelect]], use Team, color, position to check if the class matches as it is not possible to obtain the class id directly.| | ||
retvals=The function returns true on success and false on failure (npc is already spawned). | |||
relfuncs=*[[RequestClass]] | relfuncs=*[[RequestClass]] | ||
*[[OnNPCClassSelect]] | *[[OnNPCClassSelect]] | ||
}} | }} |
Revision as of 18:34, 25 May 2023
This function was added in v1.6 beta 4 patch2 and will not work on previous versions.
Description:
This will send a request to server for spawning in the currently selected class.
Parameters:
NoParams
Return Values:
The function returns true on success and false on failure (npc is already spawned).
relfuncs=*RequestClass
Important Note:
Inside the function OnNPCClassSelect, use Team, color, position to check if the class matches as it is not possible to obtain the class id directly.
Example
function OnNPCClassSelect() { if(GetPlayerTeam(GetMyID())==2) RequestSpawn(); else RequestClass(CLASS_NEXT); return 1 }