Comparing 2 strings using strcmp.
#1

Hello!

So I've been working on my house system and I am at my final touches. Basically my system works through names, it saves the names to the house and that's how it recognizes if its the owner or not. I am trying to make a lock house command but the problem is that I am not sure how to compare both strings, I've already tried several tutorials and wiki but none of them really help.

Код:
if(HouseInfo[i][HOwner] == !strcmp(HouseInfo[i][HOwner], PlayerName(playerid), false))
The HOwner variable is already a string with the owner's name stored in it. But I just can't figure out how to compare it to the player's name who's performing the command. [obviously starting from !strcmp is wrong].

Could anyone show me the correct formula please? Plus some explanation would be greatly appreciated.

Thanks!
Reply
#2

pawn Код:
if(!strcmp(HouseInfo[i][HOwner], PlayerName(playerid), false))
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
if(!strcmp(HouseInfo[i][HOwner], PlayerName(playerid), false))
Oh wow that's alot easier than I thought, thanks bud.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)