20.01.2014, 13:54
Quote:
what are you doing with the first 2 hits? you do nothing with that oldhealth, the only time it compares is from shot 3 - 4 ...
|
Quote:
and the time inbetween could be less than 50ms, which isn't enough for the clients to update getting shot and taking damage.
|
pawn Код:
new hit[MAX_PLAYERS], Float:oldhealth[MAX_PLAYERS], Float:newhealth[MAX_PLAYERS];
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(hittype)
{
case BULLET_HIT_TYPE_PLAYER:
{
hit[hitid]++;
switch(hit[hitid])
{
case 1..5: GetPlayerHealth(hitid, oldhealth[hitid]); //changed 1..5 instead of 1..3 [can be increased if still not enough]
case 6..10: //changed 4..6 instead of 6..10 [can be increased if still not enough]
{
GetPlayerHealth(hitid, newhealth[hitid]);
if(newhealth[hitid] == oldhealth[hitid])
{
//Ban(playerid); //cheat
SendClientMessage(playerid, -1, "cheat");
}
}
default:hit[hitid] = 0;
}
}
}
return 1;
}