can some one help me? only work as rcon. if is player normal will kick or ban
#1

can some one help me? only work as rcon admin. if is player normal will kick or ban because is not an admin...

i give example code:
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerAdmin(playerid))
    {
    if(GetPlayerWeapon(playerid) == 38) // minigun checked
    {
    new string[128];
    new playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    format(string, sizeof(string), "*** %s (ID: %d) (CHEATs DETECTED) Cheats Detected [MINIGUN].", playername,playerid);
    SendClientMessageToAll(COLOR_PINK, string);
    GameTextForPlayer(playerid,"BAN FOR HACKER USE MINIGUN",4000,5);
    Ban(playerid);
    ResetPlayerWeapons(playerid);
    {
    else return Ban(playerid);
    }
    return 1;
    }
    return 1;
}
Reply
#2

What you want exactly?
Don't want it to ban players? If so, remove the if(IsPlayerAdmin(playerid)) if statment, and it's return, the else return Ban(playerid);....
Reply
#3

not... i mean.. this weapon ID: 38 is minigun..will only work as rcon admin.. if detect normal player will BAN ... sorry my bad english.
Reply
#4

change IsPlayerAdmin(playerid) to
pawn Код:
if(!IsPlayerAdmin(playerid)
Reply
#5

Quote:
Originally Posted by [Diablo]
Посмотреть сообщение
change IsPlayerAdmin(playerid) to
pawn Код:
if(!IsPlayerAdmin(playerid)
can you give the full of pawn code.. im newbie.. noob at all :=/ ...
and try compile.. to see have not some error appear
Reply
#6

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerAdmin(playerid))
    {
        if(GetPlayerWeapon(playerid) == 38) // minigun checked
        {
            new string[128];
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, sizeof(playername));
            format(string, sizeof(string), "*** %s (ID: %d) (CHEATs DETECTED) Cheats Detected [MINIGUN].", playername,playerid);
            SendClientMessageToAll(COLOR_PINK, string);
            GameTextForPlayer(playerid,"BAN FOR HACKER USE MINIGUN",4000,5);
            Ban(playerid);
        }
    }
    return 1;
}
this was written fast and it's not tested. although, i advise you to use a 1000ms timer to check for weapon hacks.
Reply
#7

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerAdmin(playerid))
    {
        if(GetPlayerWeapon(playerid) == 38) // minigun checked
        {
            new string[128];
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, sizeof(playername));
            format(string, sizeof(string), "*** %s (ID: %d) (CHEATS DETECTED) Cheats Detected [MINIGUN].", playername,playerid);
            SendClientMessageToAll(COLOR_PINK, string);
            GameTextForPlayer(playerid,"BAN FOR HACKER USE MINIGUN",4000,5);
            Ban(playerid);
        {
    {
    return 1;
}
It's useless to reset his weapons after you ban him. xD
Reply
#8

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
pawn Код:
public OnPlayerUpdate(playerid)
{
    if(!IsPlayerAdmin(playerid))
    {
        if(GetPlayerWeapon(playerid) == 38) // minigun checked
        {
            new string[128];
            new playername[MAX_PLAYER_NAME];
            GetPlayerName(playerid, playername, sizeof(playername));
            format(string, sizeof(string), "*** %s (ID: %d) (CHEATS DETECTED) Cheats Detected [MINIGUN].", playername,playerid);
            SendClientMessageToAll(COLOR_PINK, string);
            GameTextForPlayer(playerid,"BAN FOR HACKER USE MINIGUN",4000,5);
            Ban(playerid);
        {
    {
    return 1;
}
It's useless to reset his weapons after you ban him. xD
but this is..will ban admin... and normal player not will be ban ...
Reply
#9

No it won't.
pawn Код:
if(!IsPlayerAdmin(playerid))
see !. It means
pawn Код:
if(IsPlayerAdmin(playerid) == 0)
.
Reply
#10

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
No it won't.
pawn Код:
if(!IsPlayerAdmin(playerid))
see !. It means
pawn Код:
if(IsPlayerAdmin(playerid) == 0)
.
so
pawn Код:
if(IsPlayerAdmin(playerid) == 0)
what should i do yea..

. . if => if(IsPlayerAdmin(playerid) == 1) it has Loged as rcon?

is hard man..

because no function at rcon login section.. just only have:
OnRconLoginAttempt ...

if have OnRconLogin
can put

example:
pawn Код:
OnRconLogin(playerid);
{
if(IsPlayerAdmin(playerid) == 1)
{
SendClientMessage(playerid,COLOR_PINK," RCON LOGIN SUCCESFULLY AND NOW CAN USE MINIGUN");
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)