@@ -2740,10 +2740,12 @@ end
2740
2740
---- -------------------------------------------------
2741
2741
-- dummy
2742
2742
function ConnectNPC (amx , name , script )
2743
+ notImplemented (' ConnectNPC' )
2743
2744
return true
2744
2745
end
2745
2746
2746
2747
function IsPlayerNPC (amx , player )
2748
+ notImplemented (' IsPlayerNPC' )
2747
2749
return false
2748
2750
end
2749
2751
@@ -2756,9 +2758,40 @@ function IsPlayerStreamedIn(amx, otherPlayer, player)
2756
2758
end
2757
2759
2758
2760
function SetPlayerChatBubble (amx , player , text , color , dist , exptime )
2761
+ notImplemented (' SetPlayerChatBubble' )
2759
2762
return false
2760
2763
end
2761
2764
2765
+
2766
+ -- In MTA we can't set the type of the request.
2767
+ -- When we add 'data' it becomes POST request.
2768
+ -- TODO: arguments "index" and "type" here only for compatibility.
2769
+ function HTTP (amx , index , type , url , data , callback )
2770
+ if type == 3 then
2771
+ notImplemented (' HTTP' , ' A HEAD type have not support right now' )
2772
+ end
2773
+ local request = fetchRemote (" http://" .. url ,
2774
+ function (responseData , error )
2775
+ if error == 0 then
2776
+ procCallInternal (amx , callback , index , 200 , responseData )
2777
+ elseif error >= 1 and error <= 89 then
2778
+ procCallInternal (amx , callback , index , 3 , responseData )
2779
+ return 0 ;
2780
+ elseif error == 1006 or error == 1005 then
2781
+ procCallInternal (amx , callback , index , 1 , responseData )
2782
+ return 0 ;
2783
+ elseif error == 1007 then
2784
+ procCallInternal (amx , callback , index , 5 , responseData )
2785
+ return 0 ;
2786
+ else
2787
+ procCallInternal (amx , callback , index , error , responseData )
2788
+ return 0 ;
2789
+ end
2790
+ end , data , false )
2791
+
2792
+ return 0 ;
2793
+ end
2794
+
2762
2795
function Create3DTextLabel (amx , text , r , g , b , a , x , y , z , dist , vw , los )
2763
2796
text = text :lower ()
2764
2797
for mta ,samp in pairs (g_CommandMapping ) do
@@ -3429,7 +3462,7 @@ g_SAMPSyscallPrototypes = {
3429
3462
TextDrawSetPreviewModel = {},
3430
3463
TextDrawSetPreviewRot = {},
3431
3464
AttachObjectToObject = {},
3432
- HTTP = {},
3465
+ HTTP = {' i ' , ' i ' , ' s ' , ' s ' , ' s ' },
3433
3466
3434
3467
Create3DTextLabel = {' s' , ' c' , ' f' , ' f' , ' f' , ' f' , ' i' , ' i' },
3435
3468
CreatePlayer3DTextLabel = {' p' , ' s' , ' c' , ' f' , ' f' , ' f' , ' f' , ' i' , ' i' },
0 commit comments