Поднимаю немного староватую тему.В общем искал..искал и вот нашел интересный код.Должен защитить от такого вида читов: [pwn]/*..................................*/
//both players died
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerState(killerid) == PLAYER_STATE_WASTED && GetPlayerState(playerid) == PLAYER_STATE_WASTED)//there are times when both kill each other at the same time
{
// double kill
}
}
/*..................................*/
//fake kill no one dies
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerState(killerid) != PLAYER_STATE_WASTED && GetPlayerState(playerid) != PLAYER_STATE_WASTED)//no one died ??
{
// examine playerid/killerid here, or just return 1; or ignore it
}
}
/*..................................*/
// ends up like this..
//before main
#define MAX_WEAPONS 54
//look for a weapons id script, make a range table
//the slot is the id and returns the var set for your weapon
new Float:weaponrange[MAX_WEAPONS]={
4.0, //fist
4.0, //knuckle
4.0, //golf club
4.0, //night stick
4.0, //knife
4.0, //base ball bat
4.0, //shovel
4.0, //pool cue
4.0, //katana
4.0, //chainsaw
4.0, //p dildo
4.0, //sw vibro
4.0, //lw vibro
4.0, //silver vibro
4.0, //flowers
4.0, //cane
199.0, //Grenade
199.0, //Tear Gas
199.0, //Molotov Cocktail
201.0, //vehicle missile
0.0, //20, set null
0.0, //21, set null
36.0, //spistol
36.0, //double pistol
36.0, //deagle
41.0, //Shotgun
41.0, //swan off
41.0, //Combat shotgun
35.0, //Micro Uzi
45.0, //MP5
71.0, //AK47
110.0, //M4
35.0, //Tec9
102.0, //country rifel
200.0, //sniper
200.0, // rocket
200.0, // heat seaker
50.0, // flame
200.0, // mini
200.0, // satchel
0.0, //detonator det null
5.0, // spary can
5.0, // fire ext
0.0, //43 null,
0.0, //44,null
0.0, //45,null
0.0, //46,null
0.0, //47,null
0.0, //48, //none
10.0, // ran over
10.0, // blades
200.0, // Explosion
0.0, // Drowned
20.0 // Collision
};//these are all weapon ids/id kill
// also make a var for you /kill
// set it to 1 when player calls /kill set to zero on spawn.
new kill_tag[MAX_PLAYER];
//de-sync weapons you do not use
SetDisabledWeapons(9,16,18,20,21,26,28,32,36,37,38,39,40,43,44,45,46,47,48);
// but its easy fo find weapon ranges.
////////
public OnPlayerDeath(playerid, killerid, reason)
{
new pname[MAX_PLAYER_NAME];//or how you have players names
new string[64];
if(GetPlayerState(playerid) != PLAYER_STATE_WASTED)//cheater did not die
{
GetPlayerName(playerid, pname, sizeof (pname));
format(string, sizeof(string), "system Suspects %s of fake kill", pname);
printf("system Suspects %s of fake kill",pname);
SendClientMessageToAll(0xFF0000AA, string);
//or we can examine playerid and set a count ie distance, weapon vs reason, count *n
}
//if(reason !=0)//maybe check killer is on foot
//{
//if(reason != 54)//although i have seen players fallen to death by other players
//{
//if(reason != 49)//maybe check killerid vehicle
//{
//if(reason != 50)//maybe check killerid vehicle//add other reasons to filter them out
//{
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED && GetPlayerWeapon(killerid) != reason && kill_tag[playerid] == 0)//cheater died but weapon reason miss match
{
// examine playerid/killerid distance here, count ++
if(GetDistanceBetweenPlayers(playerid,killerid) > weaponrange[(GetPlayerWeapon(killerid))])// i used a well known function here GetDistanceBetweenPlayers // the next part i call the weapons range and compare distance
{
// weapon was used beyond max range
}
}
//}
//}
//}
//}
//i will test out the distance check and make update changes if needed
if(GetDistanceBetweenPlayers(playerid,killerid) > weaponrange[(GetPlayerWeapon(killerid))] && kill_tag[playerid] == 0)// i used a well known function here .. GetDistanceBetweenPlayers
{
// weapon was used beyond max range
}
}[/pwn]
Исправляйте ошибки и проверяйте. Код не мой,так что за него не отвечаю.