Stuck on variables.. again... Indexing arrays?
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
The Pawn language doesn't support the comparing of two strings directly like

pawn Код:
if (string == "Earl")
You need to use the "strcmp" function to compare strings, like so

pawn Код:
if(!strcmp(string,"Earl",true))
I'm sure you can figure out most of it, but the last parameter is a bool for if you want to ignore case or not when comparing. Also there is an optional parameter at the end of strcmp where you can put the length of the string for a different reason, it is not needed in this situation.

https://sampwiki.blast.hk/wiki/Strcmp
Awesome that did it perfectly Thanks a ton and thanks too for such a quick reply
Reply


Messages In This Thread
Stuck on variables.. again... Indexing arrays? - by plutoniumman - 06.08.2010, 20:30
Re: Stuck on variables.. again... Indexing arrays? - by JaTochNietDan - 06.08.2010, 20:35
Re: Stuck on variables.. again... Indexing arrays? - by plutoniumman - 06.08.2010, 20:40

Forum Jump:


Users browsing this thread: 1 Guest(s)