Problem With for() And SendClientMessage !!!! [+REP]
#1

Hello All Again !
Today I Don't Know I'v Found Something Wrong In My Gamemode ! ! !
If Any One Help Me I'll Give Him/Her +REP

These Are MY Codes And It Didn't Work
It Should Send Message Too All Players But Nothing Will Happend
And There's No Error In My Compiler ! :O


PHP код:
stock SendClientMessageExToAll(color eText[] , pText[])
{
    for(new 
0MAX_PLAYERSi++)
    {
       if(
IsPlayerConnected(i))
       {
         if(
Lang[i] == FARSISendClientMessage(color pText);
         if(
Lang[i] == ENGLISHSendClientMessage(color eText);
       }
    }
    return 
1;

Reply
#2

There are many things that could be wrong. I believe your code is not working because your LANG variable doesn't match any of the IF statements.

Have you looked at "Lang[i]" and made sure it has a value that matches one of the two "FARSI" or "ENGLISH"?

Have you defined:
PHP код:
#define FARSI 1
#define ENGLISH 2 
So that the code can read them as appropriate.

If that's not working, use a printf and debug and you'll manage to find your problem instantly.


Good luck.
Reply
#3

i know man i defined them :
PHP код:
new Lang[MAX_PLAYERS];
#define FARSI 1
#define ENGLISH 2 
Reply
#4

That's not what i'm saying, i'm saying does "Lang[i]" match the value of either 1 or 2?

If it has a value that isn't 1 or 2, it will not be read and dis-regarded in the IF statment (Not sending your message).
Reply
#5

Persian: bbin ghabl az inke SendClientMessage bedi be player, in Lang ro vasash set kon, Lang[playerid] = x;, bad too OnPlayerConnect bezar ke Lang[playerid] = PERSIAN; ke badan change esh mide
Reply
#6

I understood in OnDialogResponse i set if player choose list item q language is english
And if choose list item 2 language is farsi
So therejs no problem !!…



… if any one can help me please help
Reply
#7

I mean if(listitem == 0) Lang[playerid] = ENGLISH;
And if(listitem == 1) Lang[playerid] = FARSI;
Reply
#8

Bump. !!!

Any HELP?!
Really Need
Reply
#9

Try printing the Lang variable to see what the output is.
Reply
#10

Thanks All I've Fixed This LoooooL With The Real Amazing And Joking Way ))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)