Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function minigameCanDamage(%client, %victimObject)
- {
- %minigame1 = getMinigameFromObject(%client);
- %minigame2 = getMinigameFromObject(%victimObject);
- if(%client.isBot)
- {
- if(isObject(%client.spawnBrick))
- {
- %minigameHost1 = %minigame1.owner;
- if((%isHost1 = %client.spawnbrick.getGroup().client == %minigameHost1))
- {
- %isIncluded1 = %minigame1.useAllPlayersBricks;
- %botNum1 = 1;
- %botcount++;
- }
- }
- %otherBotCount++;
- }
- if(%victimObject.isBot)
- {
- if(isObject(%victimObject.spawnbrick))
- {
- %minigameHost2 = %minigame2.owner;
- if((%isHost2 = %victimObject.spawnbrick.getGroup().client == %minigameHost2))
- {
- %isIncluded2 = %minigame2.useAllPlayersBricks;
- %botnum2 = 1;
- %botcount++;
- }
- }
- %otherBotCount++;
- }
- %type = %victimObject.getType();
- if(%miniGame2 != %minigame1 && getBL_IDFromObject(%victimObject) == getBL_IDFromObject(%client))
- {
- %doHack = 1;
- if(%victimObject.getType() & $TypeMasks::PlayerObjectType)
- if(%victimObject.getControllingClient() > 0)
- %doHack = 0;
- if(%doHack)
- %minigame2 = %minigame1;
- }
- if($Server::LAN)
- {
- if(!isObject(%minigame1))
- return true;
- if(%type & $TypeMasks::PlayerObjectType)
- {
- if(%victimObject.isBot || %client.isBot)
- {
- if(%minigame1 != %minigame2)
- return false;
- if(%botCount == 2)
- {
- if((%isHost1 && %isHost2) || %isIncluded1 || %isIncluded2)
- return true;
- return false;
- }
- if(%minigame1.botDamage)
- {
- if(%client.getClassName() $= "AIPlayer" && !%client.isBot)
- {
- %cIsPlayerVehicle = !%client.isBot;
- if(%cIsPlayerVehicle && !%minigame1.vehicleDamage)
- return false;
- }
- if(!%otherBotCount)
- return true;
- if(%botcount == 2)
- {
- if((%isHost1 || %isIncluded1) && (%isHost2 || %isIncluded2))
- return true;
- return false;
- }
- if(%botNum1)
- {
- %a = 1;
- if(%isHost[%a] || %isIncluded[%a])
- return true;
- else
- return false;
- }
- if(%botNum2)
- {
- %a = 2;
- if(%isHost[%a] || %isIncluded[%a])
- return true;
- else
- return false;
- }
- return true;
- }
- else
- return false;
- }
- else
- {
- if(isObject(%victimObject.client))
- {
- if(%minigame1 != %minigame2)
- return false;
- if(%minigame1.weaponDamage)
- return true;
- }
- else
- {
- if(%minigame1.vehicleDamage)
- return true;
- }
- return true;
- }
- }
- else if(%type & $TypeMasks::VehicleObjectType)
- {
- if(%minigame1.vehicleDamage)
- return true;
- }
- else if(%type & $TypeMasks::fxbrickalwaysobjecttype)
- {
- if(%minigame1.brickDamage)
- return true;
- }
- else
- {
- if(%minigame1.weaponDamage)
- return true;
- }
- return false;
- }
- if(!isObject(%minigame1) && !isObject(%minigame2))
- return -1;
- if(%minigame1 != %minigame2)
- return false;
- if(!isObject(%minigame1))
- return false;
- %ruleDamage = 0;
- if(%type & $TypeMasks::PlayerObjectType)
- {
- if(%victimObject.isBot || %client.isBot)
- {
- if(%minigame1 != %minigame2)
- return false;
- if(%botCount == 2)
- {
- if((%isHost1 && %isHost2) || %isIncluded1 || %isIncluded2)
- return true;
- return false;
- }
- if(%minigame1.botDamage)
- {
- if(%client.getClassName() $= "AIPlayer" && !%client.isBot)
- {
- %cIsPlayerVehicle = !%client.isBot;
- if(%cIsPlayerVehicle && !%minigame1.vehicleDamage)
- return false;
- }
- if(!%otherBotCount)
- return true;
- if(%botcount == 2)
- {
- if((%isHost1 || %isIncluded1) && (%isHost2 || %isIncluded2))
- return true;
- return false;
- }
- if(%botNum1)
- {
- %a = 1;
- if(%isHost[%a] || %isIncluded[%a])
- return true;
- else
- return false;
- }
- if(%botNum2)
- {
- %a = 2;
- if(%isHost[%a] || %isIncluded[%a])
- return true;
- else
- return false;
- }
- return true;
- }
- else
- return false;
- }
- else
- {
- if(isObject(%victimObject.client))
- {
- if(%minigame1.weaponDamage)
- if(%victimObject.client == %client)
- if(%minigame1.selfdamage)
- return true;
- else
- return false;
- else
- return true;
- else
- return false;
- }
- else
- if(%minigame1.vehicleDamage)
- %ruleDamage = 1;
- return true;
- }
- }
- else if(%type & $TypeMasks::VehicleObjectType)
- {
- if(%minigame1.vehicleDamage)
- %ruleDamage = 1;
- }
- else if(%type & $TypeMasks::fxbrickalwaysobjecttype)
- {
- if(%minigame1.brickDamage)
- %ruleDamage = 1;
- }
- else
- {
- if(%minigame1.weaponDamage)
- %ruleDamage = 1;
- }
- if(%ruleDamage == 0)
- return false;
- if(%minigame1.useallplayersbricks)
- return true;
- else
- {
- %victimBL_ID = getBL_IDFromObject(%victimObject);
- if(%victimBL_ID == %minigame1.owner.getBLID())
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement