SA-MP Forums Archive
[FilterScript] Minigun detection for rcon admins - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Minigun detection for rcon admins (/showthread.php?tid=553945)



Minigun detection for rcon admins - Glossy42O - 01.01.2015

EDIT: Sorry not going to release.


Re: Minigun detection for rcon admins - Younes44 - 01.01.2015

Good Job dude....


Re: Minigun detection for rcon admins - biker122 - 01.01.2015

No. It will only send the message to playerid - ONLY if playerid is RCON admin
It won't send messages to all rcon admins.


Re: Minigun detection for rcon admins - HY - 01.01.2015

Let me understand... From you code it's only a player killing another player. Checks if killerid it's havin' minigun, and Sends message to player wich got killed only if that player wich got killed it's Admin? I think if that player wich got killed with minigun if it's an Admin, then he can ban him... No server messages, etc.

First of all, you should loop, to send message to RCON Admins, like:

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerAdmin(i))
    {
        SendClientMessage(i, -1, "Text only for RCONS");
    }
}
Then... You made code under OnPlayerDeath. That's not correct. This only will check if that player it's havin' that minigun only when kill somebody. I think better you create a timer, setting to true to 1 second.

pawn Код:
SetTimerEx("CheckMinigun", 1000, true, "i", playerid);
And in public you can make that command.

pawn Код:
forward CheckMinigun(playerid);

public CheckMinigun(playerid)
{
    if(GetPlayerWeapon(playerid) == 38) return Kick(playerid);
}
And.. if an Admin it's spawning a Minigun with a command, or at an event a player.

Your code needs to be improve, because it's coded very bad...

Also, why did you included zcmd. This only will confuse players.


Re: Minigun detection for rcon admins - Glossy42O - 01.01.2015

Thanks HY, no but it sends if killerid killed someone with minigun so it sends to rcon admins the message.

Thanks for the loop, still learning to script


EDIT: will edit later, i'm making a logo


Re: Minigun detection for rcon admins - HY - 01.01.2015

No, it doesn't send him to RCON. It's send to RCON only if player who got killed it's RCON.
Have you tried this code without logged as RCON?


Re: Minigun detection for rcon admins - Glossy42O - 01.01.2015

Yeah i tried. worked fine, when someone killed me it said "%s etc.." while i was logged in


Re: Minigun detection for rcon admins - Schneider - 01.01.2015

..then you've probably used a different script than you've provided here:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  if(GetPlayerWeapon(killerid) == 38)    // you check if the killer has a minigun, that's good.
  {
        if(IsPlayerAdmin(playerid))    // now you check if the player who got killed is rcon admin.
        {
          new hackername[MAX_PLAYER_NAME], str[128];     //
          GetPlayerName(playerid, hackername, sizeof(hackername));    // you get the name of the person who GOT killed  (not the killer).
          format(str, sizeof(str), "{FF0000}ATTENTION: %s has been automaticlly reported by the server for using hacks[REASON: Minigun]", killerid);  // The player who died is called a 'hacker'.
          SendClientMessage(playerid, -1, str);  // only if the player is rcon-admin he will get the (Wrong)message.
        }
  }
  return 1;
}
..also: You've included zcmd which is not used at all, this will give errors to people who do not have that include.

Maybe you should keep scripting and learning a little bit more on your own before you release stuff that does not work properly.


Re: Minigun detection for rcon admins - Glossy42O - 01.01.2015

Quote:
Originally Posted by Schneider
Посмотреть сообщение
..then you've probably used a different script than you've provided here:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  if(GetPlayerWeapon(killerid) == 38)    // you check if the killer has a minigun, that's good.
  {
        if(IsPlayerAdmin(playerid))    // now you check if the player who got killed is rcon admin.
        {
          new hackername[MAX_PLAYER_NAME], str[128];     //
          GetPlayerName(playerid, hackername, sizeof(hackername));    // you get the name of the person who GOT killed  (not the killer).
          format(str, sizeof(str), "{FF0000}ATTENTION: %s has been automaticlly reported by the server for using hacks[REASON: Minigun]", killerid);  // The player who died is called a 'hacker'.
          SendClientMessage(playerid, -1, str);  // only if the player is rcon-admin he will get the (Wrong)message.
        }
  }
  return 1;
}
..also: You've included zcmd which is not used at all, this will give errors to people who do not have that include.

Maybe you should keep scripting and learning a little bit more on your own before you release stuff that does not work properly.
oooh i see my mistakes, thanks

P.S: I used zcmd because i did /minigun test command to test it forgot to remove the include


Re: Minigun detection for rcon admins - biker122 - 01.01.2015

No HY, He probably tested it like:
* He logs in as RCON administrator.
> The other player kills him with a minigun
= He gets the message (%s was automatically reported ...)

If you need to send the message to all the online RCON administrators, you just need to do this:
The callback would be like:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerWeapon(killerid) == 38)
    {
        for(new i = 0; i < MAX_PLAYERS; i ++)
        {
            if(IsPlayerConnected(i))
            {
                if(IsPlayerAdmin(i))
                {  
                    new hackername[MAX_PLAYER_NAME], str[128];     //
                        GetPlayerName(playerid, hackername, sizeof(hackername));    // you get the name of the person who GOT killed  (not the killer).
                        format(str, sizeof(str), "{FF0000}ATTENTION: %s has been automaticlly reported by the server for using hacks [REASON: Minigun]", killerid);  // The player who died is called a 'hacker'.
                        SendClientMessage(playerid, -1, str);  // only if the player is rcon-admin he will get the (Wrong)message.
                    SendClientMessage(i, -1, str);
                }
            }
        }
    }
    return 1;
}
Also HY, If you're doing a for loop with players, you MUST check if the player is connected to the server (IsPlayerConnected)