SA-MP Forums Archive
[Help] string - 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: [Help] string (/showthread.php?tid=293387)



[Help] string - Speed - 28.10.2011

When fight is over i kill 3 times, he kill 4 times.

I am team blue [test2] and he is team red [test1] and i get message that i kill 3 times and he kill 4 times, but he get message that he kill 4 times, and I 0 time, where is problem?

pawn Код:
new string[128];
foreach(Player, u)
        {
            if(PlayerInfo[u][test1] == 1)
            {
                PlayerInfo[u][test1] = 0;
                SpawnPlayer(u);
                format(string, sizeof(string), "Test is stop by Admin %s, You: "#COL_WHITE"%d, "#COL_RED"Him: "#COL_WHITE"%d", PlayerName(playerid), red1, blue1);
                SendClientMessage(u, COLOR_RED, string);
            }
            else if(PlayerInfo[u][test2] == 1)
            {
                PlayerInfo[u][test2] = 0;
                SpawnPlayer(u);
                format(string, sizeof(string), "Test is stop by Admin %s, You: "#COL_WHITE"%d, "#COL_RED"Him: "#COL_WHITE"%d", PlayerName(playerid), blue1, red1);
                SendClientMessage(u, COLOR_RED, string);
                blue1 = 0;
                red1 = 0;
            }
        }



Re: [Help] string - jonrb - 28.10.2011

at a glance I would say that maybe your variable is being reset somewhere. If his ID comes before yours, this will be the case. I think.

Try resetting them outside the foreach loop.


Re: [Help] string - Speed - 28.10.2011

I solved it,,, LOCK