Strcmp - stopped working.
#1

Brief: in this example, I am attempting to check if a player's name matches the string of the house renter. If they are not the same, the script still continues for whatever reason:
pawn Код:
if(!strcmp(hInfo[id][hrenter],GetName(playerid), false))
Reply
#2

Hmm, try to remove ,, ! '' before strcmp
because at the moment I think I think the checks and put every player who is not a house renter
Reply
#3

Quote:
Originally Posted by rumen98
Посмотреть сообщение
Hmm, try to remove ,, ! '' before strcmp
because at the moment I think I think the checks and put every player who is not a house renter
I'll try it.

EDIT: nope, now It thinks I own all businesses.
Reply
#4

hmm I dont know ....
Reply
#5

The other possibility could be that either the first or the second argument is empty which cases also a 0 as return

But to be sure that it is strcmp you should print both arguments before strcmp and add a control check after strcmp
Reply
#6

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
The other possibility could be that either the first or the second argument is empty which cases also a 0 as return

But to be sure that it is strcmp you should print both arguments before strcmp and add a control check after strcmp
The issue might be in my loop. Thanks for the help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)