SA-MP Forums Archive
Screen stuck - 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: Screen stuck (/showthread.php?tid=416753)



Screen stuck - Louris - 18.02.2013

Something happen with this code. Previously was all good, but now when I type /sumo screen stuck for ~2 seconds and it flood this line:
Код:
SendClientMessage(playerid, 0xDEEE20FF, "Norėdami iљeiti raљykite /isumo.");
Code:

Код:
        COMMAND:sumo( playerid, params[ ] )
{
        for(new i; i < MAX_PLAYERS; i++)
        {
        if(Sumoprasidejes[i]) return SendClientMessage(playerid, 0xDEEE20FF, "Registracija uћdaryta!");
        if(DM[playerid]) return SendClientMessage(playerid, 0xDEEE20FF, "Jūs DM zonoje!");
        if(TMDM[playerid]) return SendClientMessage(playerid, 0xDEEE20FF, "Jūs Team DM zonoje!");
        SetPlayerPos(playerid,1572.8695,-1238.7939,277);
        SendClientMessage(playerid, 0xDEEE20FF, "Norėdami iљeiti raљykite /isumo.");
        Sumo[playerid] = true;
        sumo[playerid] = Create3DTextLabel("Uћsiregistravęs", 0xFF6347AA, 30.0, 40.0, 50.0, 40.0, 0);
        Attach3DTextLabelToPlayer(sumo[playerid], playerid, 0.0, 0.0, 0.6);
        }
        return 1;
}



Re: Screen stuck - Scenario - 18.02.2013

You're running all of your code inside of a loop that is executed 500 times. Of course the server is going to freeze, and OF COURSE the message is going to spam- it's being sent 500 times afterall!


Re : Re: Screen stuck - Louris - 18.02.2013

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
You're running all of your code inside of a loop that is executed 500 times. Of course the server is going to freeze, and OF COURSE the message is going to spam- it's being sent 500 times afterall!
How to fix that?