05.03.2015, 19:54
- This update allows you to call natives & public functions that contain references (e.g. GetPlayerPos, GetPlayerName)
You will need to update the plugin & shoebill-api to use this new feature. (update-shoebill.bat/sh in your root server folder)
This is how to use it:
Код:
@Command public boolean getmyname(Player player) { // /getmyname command AmxCallable nativeMethod = null; for(AmxInstance instance : Shoebill.get().getAmxInstanceManager().getAmxInstances()) { if((nativeMethod = instance.getNative("GetPlayerName")) != null) break; } if(nativeMethod != null) { ReferenceString str = new ReferenceString("", 32); nativeMethod.call(player.getId(), str, str.getLength()); //native GetPlayerName(playerid, str[], len); player.sendMessage(Color.ORANGE, "Your name is " + str.getValue()); } else player.sendMessage(Color.ORANGE, "* Not found!"); return true; }
These 3 datatypes are available for referencing:
+ ReferenceString
+ ReferenceFloat
+ ReferenceInt
they are all located in the net.gtaun.shoebill.amx.types.