Anticheat - 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: Anticheat (
/showthread.php?tid=126274)
Anticheat -
ihatetn931 - 07.02.2010
How would i make this anticheat so it dosen't ban admins
pawn Код:
public AntiWeaponHack(playerid)
{
new deathreason[256];
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
switch(GetPlayerWeapon(i))
{
case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
{
GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid
GetPlayerName(i, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason);
SendClientMessageToAll(COLOR_RED, string);
print(string);
Ban(playerid);
}
}
}
return 1;
}
Re: Anticheat -
Calgon - 07.02.2010
Sorry, you'll have to fix the indentation.
pawn Код:
public AntiWeaponHack(playerid)
{
new deathreason[256];
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
if( ! IsPlayerAdmin( i ) )
{
switch(GetPlayerWeapon(i))
{
case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
{
GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid
GetPlayerName(i, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason);
SendClientMessageToAll(COLOR_RED, string);
print(string);
Ban(playerid);
}
}
}
}
Re: Anticheat -
bajskorv123 - 07.02.2010
Rcon admin?
Код:
public AntiWeaponHack(playerid)
{
new deathreason[256];
new string[128], tmpname[MAX_PLAYER_NAME];
for (new i = 0; i < MAX_PLAYERS; i++)
{
switch(GetPlayerWeapon(i))
{
case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47:
{
GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid
GetPlayerName(i, tmpname, sizeof(tmpname));
format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason);
SendClientMessageToAll(COLOR_RED, string);
print(string);
if(!IsPlayerAdmin(i))//If the player isnt rcon admin because of the ! at start
{
Ban(playerid);
}
else//If the player is rcon admin
{
}
}
}
}
return 1;
}
EDIT: Damn that dude was before me >_<
Re: Anticheat -
ihatetn931 - 07.02.2010
Quote:
Originally Posted by CalgonX
Sorry, you'll have to fix the indentation.
pawn Код:
public AntiWeaponHack(playerid) { new deathreason[256]; new string[128], tmpname[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if( ! IsPlayerAdmin( i ) ) { switch(GetPlayerWeapon(i)) { case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47: { GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid GetPlayerName(i, tmpname, sizeof(tmpname)); format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason); SendClientMessageToAll(COLOR_RED, string); print(string); Ban(playerid); } } } }
|
Thank you both for your help, Yes i know i suck at indenting but i'm trying.
Re: Anticheat -
Calgon - 07.02.2010
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by CalgonX
Sorry, you'll have to fix the indentation.
pawn Код:
public AntiWeaponHack(playerid) { new deathreason[256]; new string[128], tmpname[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if( ! IsPlayerAdmin( i ) ) { switch(GetPlayerWeapon(i)) { case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47: { GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid GetPlayerName(i, tmpname, sizeof(tmpname)); format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason); SendClientMessageToAll(COLOR_RED, string); print(string); Ban(playerid); } } } }
|
Thank you both for your help, Yes i know i suck at indenting but i'm trying.
|
No, no, your indenting was fine, the board ruined mine. Also, why are you defining deathreason as a 256-cell string?
Re: Anticheat -
ihatetn931 - 07.02.2010
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by CalgonX
Sorry, you'll have to fix the indentation.
pawn Код:
public AntiWeaponHack(playerid) { new deathreason[256]; new string[128], tmpname[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if( ! IsPlayerAdmin( i ) ) { switch(GetPlayerWeapon(i)) { case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47: { GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid GetPlayerName(i, tmpname, sizeof(tmpname)); format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason); SendClientMessageToAll(COLOR_RED, string); print(string); Ban(playerid); } } } }
|
Thank you both for your help, Yes i know i suck at indenting but i'm trying.
|
No, no, your indenting was fine, the board ruined mine. Also, why are you defining deathreason as a 256-cell string?
|
Dunno to much about cells yet so i just set 256, Should i set it higher or lower
Re: Anticheat -
Calgon - 08.02.2010
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by CalgonX
Sorry, you'll have to fix the indentation.
pawn Код:
public AntiWeaponHack(playerid) { new deathreason[256]; new string[128], tmpname[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if( ! IsPlayerAdmin( i ) ) { switch(GetPlayerWeapon(i)) { case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47: { GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid GetPlayerName(i, tmpname, sizeof(tmpname)); format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason); SendClientMessageToAll(COLOR_RED, string); print(string); Ban(playerid); } } } }
|
Thank you both for your help, Yes i know i suck at indenting but i'm trying.
|
No, no, your indenting was fine, the board ruined mine. Also, why are you defining deathreason as a 256-cell string?
|
Dunno to much about cells yet so i just set 256, Should i set it higher or lower
|
Set it to 128. The only time you'll really need a 256 cell string is when you're reading files.
Re: Anticheat -
ihatetn931 - 08.02.2010
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by CalgonX
Quote:
Originally Posted by [SL~RP
ihatetn931 ]
Quote:
Originally Posted by CalgonX
Sorry, you'll have to fix the indentation.
pawn Код:
public AntiWeaponHack(playerid) { new deathreason[256]; new string[128], tmpname[MAX_PLAYER_NAME]; for (new i = 0; i < MAX_PLAYERS; i++) { if( ! IsPlayerAdmin( i ) ) { switch(GetPlayerWeapon(i)) { case 17, 36, 37, 38, 39, 40, 42, 41, 43, 44, 45, 47: { GetWeaponName(GetPlayerWeapon(i),deathreason,255); // <<-- i is the playerid GetPlayerName(i, tmpname, sizeof(tmpname)); format(string, sizeof(string), "[ANTI-CHEAT] %s has been auto-banned for Weapon Hacking [ %s ]", tmpname, deathreason); SendClientMessageToAll(COLOR_RED, string); print(string); Ban(playerid); } } } }
|
Thank you both for your help, Yes i know i suck at indenting but i'm trying.
|
No, no, your indenting was fine, the board ruined mine. Also, why are you defining deathreason as a 256-cell string?
|
Dunno to much about cells yet so i just set 256, Should i set it higher or lower
|
Set it to 128. The only time you'll really need a 256 cell string is when you're reading files.
|
will do, thanks for the info