User Tools

Site Tools


contributors:jh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
contributors:jh [2022/08/11 13:46] jerryhoppercontributors:jh [2022/08/25 15:49] (current) jerryhopper
Line 71: Line 71:
 soldier_c.SetFireMode(2); soldier_c.SetFireMode(2);
 soldier_c.SetFireWeaponWanted(1) soldier_c.SetFireWeaponWanted(1)
 +</code>
 +
 +
 +
 +
 +**RESTAPI** 
 +how to use restApi
 +
 +via ArkensoR (https://discord.com/channels/105462288051380224/976155351999201390/996058255010832525)
 +<code>
 +class TestCallback : RestCallback
 +{
 +    override void OnSuccess( string data, int dataSize )
 +    {
 +        Print(" !!! OnSuccess() size=" + dataSize );
 +        if( dataSize > 0 )
 +            Print(data); // !!! NOTE: Print() will not output string longer than 1024b, check your dataSize !!!
 +    };
 +}
 +...
 +auto ctx = GetGame().GetRestApi().GetContext("https://webhook.site/XXXX-YOUR-GUID-XXXXX");
 +TestCallback callback();
 +//ctx.POST(callback,"RequestPath?Argument=Something", "Hello World");
 +ctx.POST(callback,"RequestPath?Argument=Something", "{\"someVar\": 1337}");
 +</code>
 +
 +
 +**FileHandle**
 +
 +Scripts/Core/generated/System/FileHandle.c
 +
 +<code>
 +FileHandle file = FileIO.OpenFile("$profile:testiik.txt", FileMode.WRITE);
 +if (file != 0)
 +{
 +file.FPrint("A");
 +file.FPrint(file, "B");
 +file.FPrint(file, "C");
 +file.CloseFile();
 +}
 +
 </code> </code>
  
  
  
contributors/jh.1660222010.txt.gz · Last modified: 2022/08/11 13:46 by jerryhopper

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki