SA-MP Forums Archive
HTTP Response question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HTTP Response question (/showthread.php?tid=665142)



HTTP Response question - Koreadars - 23.03.2019

Is it possible not to use the data parameter as string, but only as integer? (a_http)
Code:
forward HTTPR(index, response_code, data);
instead of
Code:
forward HTTPR(index, response_code, data[]);
I can't test it now, so I'm asking.


Re: HTTP Response question - Shaneisace - 23.03.2019

Quote:
Originally Posted by Koreadars
View Post
Is it possible not to use the data parameter as string, but only as integer? (a_http)
Code:
forward HTTPR(index, response_code, data);
instead of
Code:
forward HTTPR(index, response_code, data[]);
I can't test it now, so I'm asking.
Yes just use "strval()" this will convert a string into an integer like this:

Code:
forward HTTPR(index, response_code, data[]);
public HTTPR(index, response_code, data[]) {
	prtinf("Response is now an int: %d", strval(data));
}
Wiki: https://sampwiki.blast.hk/wiki/Strval


Re: HTTP Response question - Koreadars - 23.03.2019

thanks

I knew about strval, just wanted to know if it's possible to declare data instead of data[]