SA-MP Forums Archive
strcmp bad checking or what? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: strcmp bad checking or what? (/showthread.php?tid=277651)



strcmp bad checking or what? - Riddick94 - 18.08.2011

Debug:
pawn Код:
printf("DEBUG: |%s|, |%s|", SerwerInfo[sLosowyKod], message);
Generated:
Код:
[21:26:21] DEBUG: |5w*t5#.2a,fniu4u|
- there's no second code '%s' - message. Why?

Checking:
pawn Код:
if(!strcmp(SerwerInfo[sLosowyKod], message))
{
//rest
}
It's OnPlayerText callback. Message is my new way to send message. Just returning false for OnPlayerText callback. Messeage is my string of the message.


Re: strcmp bad checking or what? - Riddick94 - 18.08.2011

Anyone?


Respuesta: strcmp bad checking or what? - uprp - 18.08.2011

serwer? Isnt it server?


Re: strcmp bad checking or what? - Riddick94 - 18.08.2011

Look at my Location and stop posting stupid posts. Let's back to the topic.


Re: strcmp bad checking or what? - Gh0sT_ - 18.08.2011

Maybe You've created variables sLosowyKod and message as integer.


Re: strcmp bad checking or what? - AndreT - 18.08.2011

Show us how you get the message string. The problem could possibly be there.


Re: strcmp bad checking or what? - Riddick94 - 19.08.2011

No AndreT because i removed everything from OnPlayerText callback /* */ and put only code. And i changed message to text (from callback) and nothing too.

enum sLosowyKod[16];
pawn Код:
sLosowyKod[16],
bool:sCodeActive,
pawn Код:
if(SerwerInfo[sCodeActive])
    {
        printf("DEBUG: |%s|, |%s|", SerwerInfo[sLosowyKod], text);
        if(!strcmp(SerwerInfo[sLosowyKod], text))
        {
            new flowpoints = 5 + random(10);
            GivePlayerFlow(playerid, flowpoints);
            SerwerInfo[sCodeActive] = false;

            new string[128];
            format(string, sizeof(string), "* %s [ID: %d] przepisał najszybciej kod i otrzymał %d punktуw Flow.", PlayerName(playerid), playerid, flowpoints);
            SendClientMessageToAll(-1, string);
        }
    }
All should be okey for me.. maybe someone see the problem? - i changed it only to OnPlayerText callback and go test it again.


Re: strcmp bad checking or what? - Riddick94 - 19.08.2011

Not working. Screen:
http://www.bankfotek.pl/image/1056199.jpeg

Debug:
Код:
|->b7-rrg!cl2-6j9
edit://
Sorry for double-post.


Re: strcmp bad checking or what? - Riddick94 - 19.08.2011

What? sorry ****** i'm from Poland i don't understand what you mean exactly. I know what you said but not understand..


Re: strcmp bad checking or what? - Riddick94 - 19.08.2011

So anybody see the problem? i need to bump because it's pissing me off (and 2nd page).