SA-MP Forums Archive
Problem With for() And SendClientMessage !!!! [+REP] - 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)
+--- Thread: Problem With for() And SendClientMessage !!!! [+REP] (/showthread.php?tid=501576)



Problem With for() And SendClientMessage !!!! [+REP] - amirab - 19.03.2014

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;




Re: Problem With for() And SendClientMessage !!!! [+REP] - Firewire - 19.03.2014

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.


Re: Problem With for() And SendClientMessage !!!! [+REP] - amirab - 19.03.2014

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



Re: Problem With for() And SendClientMessage !!!! [+REP] - Firewire - 19.03.2014

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).


Re: Problem With for() And SendClientMessage !!!! [+REP] - Aliassassin123456 - 19.03.2014

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


Re: Problem With for() And SendClientMessage !!!! [+REP] - amirab - 19.03.2014

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


Re: Problem With for() And SendClientMessage !!!! [+REP] - amirab - 19.03.2014

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


Re: Problem With for() And SendClientMessage !!!! [+REP] - amirab - 19.03.2014

Bump. !!!

Any HELP?!
Really Need


Re: Problem With for() And SendClientMessage !!!! [+REP] - Knappen - 19.03.2014

Try printing the Lang variable to see what the output is.


Re: Problem With for() And SendClientMessage !!!! [+REP] - amirab - 20.03.2014

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