strfind problem
#7

Quote:
Originally Posted by Gammix
Посмотреть сообщение
Why would you suggest him a command processor. I don't think that piece of code is even related to any command processor or even sscanf.

He's just asking a method to detect what values a player typed (known as params in YCMD, ZCMD..).

My code will work because you can't have direct integers from a command, you always have to convert it using strval, strtok, sscanf...

And strval don't read int values, they convert https://sampwiki.blast.hk/wiki/Strval
No, your code was not working how you posted it. You tried to convert an integer (garageid) to integer (using strval).

Thanks for repeating my words.

I'm just trying to help him, with whatever method he chooses and prevent him running into another invalid code.

Look at this (what you posted):

switch(strval(garageid))

garageid is integer. strval converts a string into integer.
The use of strval isn't wrong here (in the switch), but garageid is not a string that can be converted by strval.
Reply


Messages In This Thread
strfind problem - by TiXz0r - 04.05.2015, 22:47
Re: strfind problem - by Gammix - 05.05.2015, 03:09
Re: strfind problem - by Threshold - 05.05.2015, 03:29
AW: strfind problem - by NaS - 05.05.2015, 04:35
Re: AW: strfind problem - by Gammix - 05.05.2015, 04:57
Re: strfind problem - by TiXz0r - 05.05.2015, 12:31
AW: Re: AW: strfind problem - by NaS - 05.05.2015, 13:26
Re: strfind problem - by TiXz0r - 05.05.2015, 13:52
Re: strfind problem - by MP2 - 05.05.2015, 13:55
Re: strfind problem - by TiXz0r - 05.05.2015, 13:59

Forum Jump:


Users browsing this thread: 3 Guest(s)