Jump to content
  • 0

Problema sistem OX - nu ajunge la timer...


iRay

Question

Salut, am luat si eu sistemul din GM-ul FRZ si l-am pus intr-un gm edit bigzone.

Am incercat pe server, totul merge, pun intrebare ma asez pe X sau O ( am incercat si cu mai multi jucatori ), dar nu mai ajunge la timer-ul respectiv sa zica daca e corect sau gresit etc...

Timer-ul arata asa:

Quote

stock OXQuestion() {
    PlayersLeft = 0;
    foreach(Player, i) {
        if(OXMember == 1) {
            if(OXAnswer == 1) {
                new Float:xx1,Float:yy1,Float:zz1;
                GetPlayerPos(i,xx1,yy1,zz1);
                new Float:minx1, Float:maxx2, Float:miny1,Float:maxy2;
                if(53.5470 < 21.1342)
                {
                    minx1 = 53.5470;
                    maxx2 = 21.1342;
                }
                else
                {
                    minx1 = 21.1342;
                    maxx2 = 53.5470;
                }
                if(3529.3352 < 3549.6067)
                {
                    miny1 = 3529.3352;
                    maxy2 = 3549.6067;
                }
                else
                {
                    miny1 = 3549.6067;
                    maxy2 = 3529.3352;
                }
                if(xx1 > minx1 && xx1 < maxx2 && yy1 > miny1 && yy1 < maxy2)
                {
                    SCM(i,COLOR_GREEN,"OX: {FFFFFF}Raspunsul corect este "GREEN"O"WHITE". Buna treaba!");
                    PlayersLeft++;
                } else {
                    SCM(i,COLOR_GREEN,"OX: {FFFFFF}Raspunsul corect este "GREEN"O"WHITE". Raspunsul tau e gresit!");
                    SpawnPlayer(i);
                    OXInscrieri = 1;
                }
            }
            else if(OXAnswer == 2) {
                new Float:xx1,Float:yy1,Float:zz1;
                GetPlayerPos(i,xx1,yy1,zz1);
                new Float:minx1, Float:maxx2, Float:miny1,Float:maxy2;
                if(-13.4163 < 19.8895)
                {
                    minx1 = -13.4163;
                    maxx2 = 19.8895;
                }
                else
                {
                    minx1 = 19.8895;
                    maxx2 = -13.4163;
                }
                if(3529.6685 < 3549.6089)
                {
                    miny1 = 3529.6685;
                    maxy2 = 3549.6089;
                }
                else
                {
                    miny1 = 3549.6089;
                    maxy2 = 3529.6685;
                }
                if(xx1 > minx1 && xx1 < maxx2 && yy1 > miny1 && yy1 < maxy2)
                {
                    SCM(i,COLOR_GREEN,"OX: {FFFFFF}Raspunsul corect este "RED"X"WHITE". Buna treaba!");
                    PlayersLeft++;
                } else {
                    SCM(i,COLOR_GREEN,"OX: {FFFFFF}Raspunsul corect este "GREEN"X"WHITE". Raspunsul tau e gresit!");
                    SpawnPlayer(i);
                    OXInscrieri = 1;
                }
            }
        }
    }
    format(gString,sizeof(gString),"OX: {FFFFFF}Concurenti ramasi in concurs: "RED"%d"WHITE".",PlayersLeft);
    foreach(Player, i) { SCM(i,COLOR_GREEN,gString); }
    if(OXAnswer == 1) {
        foreach(Player, i) {
            if(PlayerInfo[pAdmin] > 0)
                SCM(i,-1,"{E88E3F}( OX News ): {FFFFFF}Raspunsul este "GREEN"O"WHITE".");
            if(OXMember == 1) {
                format(gString, sizeof(gString),"{E88E3F}( OX News ): {FFFFFF}Raspunsul corect este "GREEN"O{FFFFFF}.");
                SCM(i,COLOR_WHITE,gString);
            }
        }
    } else if(OXAnswer == 2) {
        foreach(Player, i) {
            if(PlayerInfo[pAdmin] > 0)
                SCM(i,-1,"{E88E3F}( OX News ): {FFFFFF}Raspunsul este "RED"X"WHITE".");
            if(OXMember == 1) {
                format(gString, sizeof(gString),"{E88E3F}( OX News ): {FFFFFF}Raspunsul corect este "RED"X{FFFFFF}.");
                SCM(i,COLOR_WHITE,gString);
            }
        }
    }
    return 1;
}

Dialogurile de pus intrebare + cel truefalse arata asa:

Quote

if(dialogid == DIALOG_OX_QUESTION) {
            if(!response) return 1;
            if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_OX_QUESTION, DIALOG_STYLE_INPUT, "Pune o intrebare", "Scrie noua ta intrebare:", "Okay", "Cancel");
            ShowPlayerDialog(playerid, DIALOG_OX_TRUEFALSE, DIALOG_STYLE_MSGBOX, "Adevarat sau Fals", "X - Fals\n\nO - Adevarat", "Adev.", "Fals");
            PlayersLeft = 0;
   foreach(Player, i)
            {
                if(PlayerInfo[pAdmin] > 0 && OXMember == 0) {
                    format(gString, sizeof(gString),"{E88E3F}( OX News ): {FFFFFF}Intrebare: %s.",inputtext);
                    SCM(i,COLOR_WHITE,gString);
                }
                if(OXMember >= 1)
                {
                    SendClientMessage(i,COLOR_WHITE,"");
                    SendClientMessage(i,COLOR_WHITE,"");
                    SendClientMessage(i,COLOR_WHITE,"");
                    SendClientMessage(i,COLOR_WHITE,"");
                    SendClientMessage(i,COLOR_WHITE,"");
                    SendClientMessage(i,COLOR_WHITE,"");
                    SendClientMessage(i,COLOR_WHITE,"");
                    format(gString, sizeof(gString),"{E88E3F}( OX News ): {FFFFFF}Intrebare: %s.",inputtext);
                    SCM(i,COLOR_WHITE,gString);
                    format(gString, sizeof(gString),"{E88E3F}( OX News ): {FFFFFF}Daca crezi ca intrebarea este adevarata, pozitioneaza-te pe O{FFFFFF}.");
                    SCM(i,COLOR_WHITE,gString);
                    format(gString, sizeof(gString),"{E88E3F}( OX News ): {FFFFFF}Daca crezi ca intrebarea este falsa, pozitioneaza-te pe X{FFFFFF}.");
                    SCM(i,COLOR_WHITE,gString);
                }
            }
            return 1;
        }
        if(dialogid ==  DIALOG_OX_TRUEFALSE)
        {
            if(response)
            {
                OXAnswer = 1;
                GameTextForPlayer(playerid, "~g~Adevarat!", 3000, 1);
                SetTimer("OXQuestion", 15000,false);
            }
            if(!response)
            {
                OXAnswer = 2;
                GameTextForPlayer(playerid, "~r~Fals!", 3000, 1);
                SetTimer("OXQuestion", 15000,false);
            }
   foreach(Player, i)
                if(OXMember[playerid] >= 1)
                    SCM(i,-1,"{E88E3F}( OX News ): {FFFFFF}Ai 15 secunde sa te poti decide!");
            return 1;
        }

 

Vreo idee? 

Multumesc anticipat si sarbatori fericite tuturor !

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.