HTTP Response question
#1

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.
Reply
#2

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
Reply
#3

thanks

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


Forum Jump:


Users browsing this thread: 1 Guest(s)