Strlen and sscanf
#3

Quote:
Originally Posted by AmigaBlizzard
View Post
First of all, using sscanf to extract the full text inside params and copy it back into params is quite useless.
Just delete that line as it won't do anything, except check if params is empty.

Replace the sscanf line by
PHP Code:
if (strlen(params) == 0) return SendUsageMSG(playerid"/addhint [TEXT]"); 
For storing the entered text into your enum, use format:
PHP Code:
format(hInfo[hintid][hText], 50params); 
Using "hInfo[hintid][hText] = params[50]", you were only copying the 51st character into your hText variable (or the text starting from the 51st character till the end, which would never be anything because the length of your text is limited by 50 characters.
Worked, thank you so much!
Reply


Messages In This Thread
Strlen and sscanf - by Ahmed21 - 10.02.2017, 10:29
Re: Strlen and sscanf - by AmigaBlizzard - 10.02.2017, 10:51
Re: Strlen and sscanf - by Ahmed21 - 10.02.2017, 11:10

Forum Jump:


Users browsing this thread: 1 Guest(s)