- 29
- 1
- Версия MoonLoader
- .025-beta
The server creates this text draw with 4 slots, one has a rock, i need to click on the rock to continue
I need to detect the rock on the screen and send a click on it using https://blast.hk/wiki/lua:sampsendclicktextdraw, but the problem lies on how to detect wich is the rock slot
if i return the model ID on every render i get this:
So they made a sort of a anti bot system here, but i got their server source, and this is the related function (iam not much of a pwn coder)
the command is /dejar roca
so, /dejar and the argument is roca >
JavaScript:
CMD:dejar(playerid,params[])
{
new item[32],ID,Trabajo,TrabajoVip,TrabajoN[32],TrabajoVipN[32],string[128];
if(!sscanf(params,"s[32]", item))
{
if(strcmp(item, "roca",true)==0)
{
if(!IsPlayerInRangeOfPoint(playerid, 10.0, -548.2949,2336.7649,83.4777)) return SCM(playerid, -1, "No estas en el lugar adecuado.");
new rocas[5];
rocas[0] = rocajugador[playerid];
rocas[1] = 11392;
rocas[2] = 11392;
rocas[3] = 11392;
ShowModelSelectionMenuEx2(playerid, rocas, 4, "Selecciona la roca", OBJETIVOROCA, 16.0, 0.0, -55.0, 1.0, 0x000000FF, 0x000000FF);
}
the OBJETIVOROCA function >
JavaScript:
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;
}
If anyone can help me find a solution to that, thanks anyway!!