Samp Interface

ELTacoBanido

Новичок
Автор темы
29
1
35960


I Need to click on the rock every time i open this interface, its randomized, how can i detect which row is the rock and send a click to the server?
 

trefa

3d print
Всефорумный модератор
2,111
1,275
and
 

ELTacoBanido

Новичок
Автор темы
29
1
and

i gave it a look and i think that the paramters returned from onShowTextDraw Are = textdrawId,flags, letterWidth, letterHeight, letterColor, lineWidth, lineHeight, boxColor, shadow, outline, backgroundColor, style, selectable, position, modelId, rotation, zoom, color, text

wich none of them could help me find wich selectable box have a rock.
 

ELTacoBanido

Новичок
Автор темы
29
1
Посмотреть вложение 36007
you need a condition that this rock
Lua:
if modelId == 896 then
--code
end
I Expectect it to return 3 nulls and one containing 896
Посмотреть вложение 36007
you need a condition that this rock
Lua:
if modelId == 896 then
--code
end
Still dont get it as it returned 896 more than 1 time even that it only is one rock, made this and it selected the wrong wone
Lua:
    function sampev.onShowTextDraw(id, data)
            if data.modelId == 896 then
                sampSendClickTextdraw(id)
            end

         end
 

trefa

3d print
Всефорумный модератор
2,111
1,275
I Expectect it to return 3 nulls and one containing 896

Still dont get it as it returned 896 more than 1 time even that it only is one rock, made this and it selected the wrong wone
Lua:
    function sampev.onShowTextDraw(id, data)
            if data.modelId == 896 then
                sampSendClickTextdraw(id)
            end

         end
Maybe the server is protected from bots
 

ELTacoBanido

Новичок
Автор темы
29
1
Maybe the rock overlaps each other?

I Have no ideia on how textDraw works, but maybe the rock has nothing todo with the original text draw and it is just an overlay, maybe calculate the rock position and click on the right button...
Maybe the rock overlaps each other?
Ok, so here i got the source of everything, its a mess but i think its possible to understand.



Код:
CreateDynamic3DTextLabel("{FFFFFF}Os mineradores aqui podem {DBED15}/deixar rocha",0xEB0000FF, -548.2949,2336.7649,83.4777, 2.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID, 1, -1,-1,-1, 100.0);

ShowModelSelectionMenuEx2(playerid, rocas, 4, "Selecciona la roca", OBJETIVOROCA, 16.0, 0.0, -55.0, 1.0, 0x000000FF, 0x000000FF);

if(extraid == OBJETIVOROCA)
    {
        if(response)
        {
            switch(modelid)
            {
                case 897: // ROCA
                {
                    new string[128], Query[200], ganancias;
                    switch(PlayerInfo[playerid][pNivelMinero])
                    {
                        case 1:
                        {
                            new intento = random(3);
                            switch(intento)
                            {
                                case 0: {    ganancias=148;    }
                                case 1: {    ganancias=150;    }
                                case 2: {    ganancias=146;    }
                            }
                        }
                        case 2:
                        {
                            new intento = random(3);
                            switch(intento)
                            {
                                case 0: {    ganancias=200;    }
                                case 1: {    ganancias=210;    }
                                case 2: {    ganancias=207;    }
                            }
                        }
                        case 3..100:
                        {
                            new intento = random(3);
                            switch(intento)
                            {
                                case 0: {    ganancias=240;    }
                                case 1: {    ganancias=255;    }
                                case 2: {    ganancias=247;    }
                            }
                        }
                    }
                    format(string, sizeof(string), "%s tira una roca a la procesadora.", NombreJugador(playerid));
                    ProxDetector(15.0, playerid, string, COLOR_VERDECLARO,COLOR_VERDECLARO,COLOR_VERDECLARO,COLOR_VERDECLARO,COLOR_VERDECLARO);
                    new exp = random(3);
                    switch(exp)
                    {
                        case 0: { SCM(playerid,-1,"Esta vez no ganaste habilidad."); }
                        case 1: { SCM(playerid,-1,"Esta vez no ganaste habilidad."); }
                        case 2:
                        {
                            if(PlayerInfo[playerid][pExpPescador] < 49)
                            {
                                SCM(playerid,0x0080C2FF,"Has aumentado tu experiencia con +1 punto de habilidad");
                                PlayerInfo[playerid][pExpMinero]++;
                                format(Query, 200, "UPDATE `usuarios` SET `ExpMinero`='%d' WHERE `Username`='%s'",PlayerInfo[playerid][pExpMinero],NombreJugador(playerid));
                                mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
                            }
                            else if(PlayerInfo[playerid][pExpPescador] >= 49)
                            {
                                SCM(playerid,-1,"Felicidades, has aumentado tu nivel en este trabajo");
                                PlayerInfo[playerid][pExpMinero] = 0;
                                PlayerInfo[playerid][pNivelMinero]++;
                                format(Query, 200, "UPDATE `usuarios` SET `ExpMinero`='%d',`NivelMinero`='%d' WHERE `Username`='%s'",PlayerInfo[playerid][pExpMinero],PlayerInfo[playerid][pNivelMinero],NombreJugador(playerid));
                                mysql_function_query(Conecction, Query, true, "OnQueryFinish", "ii", 0, playerid);
                            }
                        }
                    }
                    format(string, sizeof(string), "¡Buen trabajo!, tus ganancias son {00CC00}$%d", ganancias);
                    DarDinero(playerid, ganancias);
                    SCM(playerid, -1, string);
                    SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
                    RemovePlayerAttachedObject(playerid,2);
                    rocajugador[playerid] = 11392;
                }
            }
        }
    }
    return 1;
 
Последнее редактирование: