SA-MP Forums Archive
2 questions - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 2 questions (/showthread.php?tid=270273)



2 questions - Gh0sT_ - 19.07.2011

Hello, I have created one topic today but nvm, I will create it again

So, I have 2 questions:


1. Which way is the best to make things like "anti airbrk", "anti bunny hop"?
2. For example, there's command "/admins". I want to make it in GUI. If I loop the players, it will show only 1 player in GUI, because if I use SendClientMessage - it shows 1message for 1admin, for example there's 2 admins so it will be:

Admins online:
name1,
name2

So, I want to make it in GUI with all online admins in this format: name\nname\nname


Re: 2 questions - Amit_B - 19.07.2011

1. Anti airbreak - you can do it by detecting the player speed.
Anti bunny hop - hmm... detecting velocity + pressing KEY_JUMP should work

2. You need to create an string variable, which is updating by loop that looking for the admins.
When the loop ends, show a message dialog box, and put the string variable instead of the text.


Re: 2 questions - XGh0stz - 19.07.2011

While there might be better effective ways now, but it used to be simply checking to see if the facing angle changes when the player moves for detecting Air Break. Bunny Hop is probably best just to check for repeated keystrokes within 5 seconds or so

for (Loop) Line
If (Admin) Line
Get that Player Name Line
Send Message with that Name Line

Something like that would list all the admins online with new message lines for each admin


Re: 2 questions - Gh0sT_ - 19.07.2011

Ok, now I understand that thing with looping players, but maybe someone can give me an example with airbreak and bunnyhop? Like Ghostz or Amit said.

THANKS.


Re : 2 questions - DRIFT_HUNTER - 19.07.2011

My /admins command
pawn Код:
CMD:admins(playerid, params[])
{
    new longstring[1024],shortstring[128],Count = 0;
    foreach(Player, i)
    {
        if(pInfo[i][pLevel] > 1 && pInfo[i][pHide] == 0)
        {
            Count++;
            format(shortstring, sizeof(shortstring), ""GREE"%s"W"["GREE"%s"W"|"GREE"ID:%d"W"]\n", pName[i], LevelName(i),i);
            strcat(longstring,shortstring);
        }
    }
    if(Count == 0) return ShowPlayerDialog(playerid, Dialog:Empty, BOX,W"Online Admins",embed_red"There is no admins online","Ok","");
    ShowPlayerDialog(playerid, Dialog:Empty, BOX,W"Online Admins",longstring,"Ok","");
    return 1;
}



Re: 2 questions - Gh0sT_ - 20.07.2011

I done it already, now I need some examples for AntiAirBrk/Anti Bunnyhop as Gh0stz or Amit said


Re: 2 questions - Raimis_R - 20.07.2011

Anti Bunny Hop

pawn Код:
if (PRESSED(newkeys, KEY_JUMP) && HOLDING(oldkeys, KEY_SPRINT))
    {
        ClearAnimations( playerid );
    }