can some one help me? only work as rcon. if is player normal will kick or ban -
mature1990 - 03.02.2012
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;
}
Re : can some one help me? only work as rcon. if is player normal will kick or ban -
ricardo178 - 03.02.2012
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);....
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
mature1990 - 03.02.2012
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.
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
[Diablo] - 03.02.2012
change IsPlayerAdmin(playerid) to
pawn Код:
if(!IsPlayerAdmin(playerid)
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
mature1990 - 03.02.2012
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
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
[Diablo] - 03.02.2012
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.
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
[MG]Dimi - 03.02.2012
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
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
mature1990 - 03.02.2012
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
...
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
[MG]Dimi - 03.02.2012
No it won't.
pawn Код:
if(!IsPlayerAdmin(playerid))
see !. It means
pawn Код:
if(IsPlayerAdmin(playerid) == 0)
.
Re: can some one help me? only work as rcon. if is player normal will kick or ban -
mature1990 - 03.02.2012
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;
}