18.03.2017, 10:28
При разбитии машиной объекта тоже самое происходит?
BadFloat(Float:x) return(x >= 10.0 || x <= -10.0) ?true:false;
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
switch(weaponid){ case 0..18, 39..54: return 1;}//invalid weapons
if(hittype != BULLET_HIT_TYPE_NONE) if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) ) return 0;
new Float:vpos[3];
GetPlayerPos(playerid, vpos[0], vpos[1], vpos[2]);
if (weaponid < 22 || weaponid > 38 || hittype > 4) return 0;
if(!(-20000.0 <= vpos[2] <= 20000.0)) return 0;
if (hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID && (GetPVarInt(hitid, "PlayerInAFK") > 3 || !PData[playerid][spawned] || !PData[hitid][spawned])) return 0;
if(hittype == BULLET_HIT_TYPE_VEHICLE && hitid != INVALID_VEHICLE_ID)
{
if((floatcmp(floatabs(fX), 100.0) == 1) || (floatcmp(floatabs(fY), 100.0) == 1) || (floatcmp(floatabs(fZ), 100.0) == 1)) return 0;
}
new Float:kLibPos[3];
GetPlayerCameraPos(playerid,kLibPos[0],kLibPos[1],kLibPos[2]);
if ( kLibPos[2] < -50000.0 || kLibPos[2] > 50000.0 ) return 0;
if(hittype == BULLET_HIT_TYPE_PLAYER && (BadFloat(fX) || BadFloat(fY) || BadFloat(fZ))) return 0;
if (ServerInfo[AntiAim] == 1)
{
if(ServerInfo[AntiCBug] == 1 || GetPVarInt(playerid,"AntiC") == 1)
{
switch(weaponid)
{
case 23, 24, 25, 34:
{
new
server_tick = GetTickCount();
if(server_tick - GetPVarInt(playerid, "last_shot_player_tick") < 300 && server_tick - GetPVarInt(playerid, "last_key_is_pressed") > 1000 && ++last_shot_player{playerid} > 2 && !IsPlayerInAnyVehicle(playerid))
{
new msg[256];
formatex(msg,"{00F200}*** {62FF62}Игрок %s (ID: %d) подозревается в использовании RapidFire/Auto +C (Weapon: %s).",PlayerInfo[playerid][pName],playerid,wName(weaponid));
MessageToAdmins(GREEN,msg);
last_shot_player{playerid} = 0;
}
SetPVarInt(playerid, "last_shot_player_tick", server_tick);
}
}
}
if(hittype == BULLET_HIT_TYPE_PLAYER && IsPlayerConnected(hitid) && !IsPlayerNPC(hitid) && !IsPlayerInAnyVehicle(hitid))
{
new Float:Shot[3], Float:Hit[3];
GetPlayerLastShotVectors(playerid, Shot[0], Shot[1], Shot[2], Hit[0], Hit[1], Hit[2]);
new playersurf = GetPlayerSurfingVehicleID(playerid);
new hitsurf = GetPlayerSurfingVehicleID(hitid);
new Float:targetpackets = NetStats_PacketLossPercent(hitid);
new Float:playerpackets = NetStats_PacketLossPercent(playerid);
if(~(playersurf) && ~(hitsurf) && !IsPlayerInAnyVehicle(playerid) && !IsPlayerInAnyVehicle(hitid))
{
if(!IsPlayerAimingAtPlayer(playerid, hitid) && !IsPlayerInRangeOfPoint(hitid, 5.0, Hit[0], Hit[1], Hit[2]))
{
AimbotWarnings[playerid] ++;
if(AimbotWarnings[playerid] > 10 && targetpackets < 2.0 && playerpackets < 2.0)
{
new msg[256];
formatex(msg,"{00F200}*** {62FF62}Игрок %s (ID: %d) подозревается в использовании AimBot/Joypad (Weapon: %s).",PlayerInfo[playerid][pName],playerid,wName(weaponid)); // [ProAim Detector #2]
MessageToAdmins(GREEN,msg);
AimbotWarnings[playerid] = 0;
}
return 0;
}
else return 1;
}
else return 1;
}
}
return 1;
}
if(~(playersurf) && ~(hitsurf)
PHP Code:
|
PHP Code:
|
if(hittype != BULLET_HIT_TYPE_NONE) if( !( -1000.0 <= fX <= 1000.0 ) || !( -1000.0 <= fY <= 1000.0 ) || !( -1000.0 <= fZ <= 1000.0 ) ) return 0;
1. Не разрушаются только объекты, созданные стримером или вообще все?
Только стримером 2. Есть ли что-то в OnPlayerShootDynamicObject? Не использовал никогда 3. Попробуйте полностью закомментировать OnPlayerWeaponShot и проверить. Закомментировал, проблема не исчезла |
public OnPlayerShootDynamicObject(playerid, weaponid, STREAMER_TAG_OBJECT objectid, Float:x, Float:y, Float:z)
{
return 1;
}
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
quotepath = false
[i18n]
commitencoding = cp1251
logoutputencoding = cp1251