Help with this command
#1

Hello, I have a problem with this command, when I tipe /paliktidarba it show SERVER: Unknown command.
pawn Код:
if(strcmp("/paliktidarba",cmdtext,true) == 0)
    {
    if(PInfo[playerid][grove] == 1) return PInfo[playerid][grove] = 0;
    SData(playerid);
    Logged[playerid] = false;
    return 1;
    }
Where is the problem ?
Reply
#2

I think it should be like that :
if(!strcmp(cmdtext, "/paliktidarba", true, 13))
Reply
#3

Thanks it's working. But where was the problem ?
Reply
#4

The problem was in the condition, strcmp compare two strings, it will never == 0 I think
Use ZCMD + Sscanf , it's much easier and faster
Reply
#5

Ok, thanks man
Reply
#6

Actually, using if(!strmp(...)) is the same thing as using if(strmp(...) == 0)
Reply
#7

Quote:
Originally Posted by Stinged
Посмотреть сообщение
Actually, using if(!strmp(...)) is the same thing as using if(strmp(...) == 0)
I don't use strcmp so .. maybe because he forgot to insert the length of string [13]
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)