Comparing string using strcmp help pls
#1

Guys I need to compare the string from INI.. I tried this but didnt work I want to comper if string in ini have value 0

pawn Код:
if (strcmp(Characters[playerid][Character1],"0") == 0)
Reply
#2

pawn Код:
if(strval(Characters[playerid][Character1]) == 0) {
    // It's 0
} else {
    // It's not 0
}
Reply
#3

Thx, gonna to try it!
Reply
#4

Thx mate it works, and can I ask you for example when I have string with no value (like numbers like this one) but I have some text, which function i should use here??
Reply
#5

Quote:
Originally Posted by Riwerry
Посмотреть сообщение
Thx mate it works, and can I ask you for example when I have string with no value (like numbers like this one) but I have some text, which function i should use here??
Then you should use strcmp, but I don't see why you would want to compare hardcoded strings.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)