Junior Member
|
10-04-2016
, 13:29
Re: CSGO Give weapons WC3 (specify race)
|
#7
|
Okay I got this somewhat working sure none of yall care lol but anyway
I have a small problem when switching races. When you switch races force drops and gives you new weapons just like when you spawn. Although every race spawns with right guns but not so much for switching races..
These are the races (again these are not real just test subjects)
Brute
Code:
#pragma semicolon 1
#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
#include "smlib"
public Plugin:myinfo =
{
name = "War3Source - Race - Brute Bruce",
author = "JC",
description = "A Brute Man Bruce Is"
};
new thisRaceID;
new bool:RaceDisabled=true;
public OnWar3RaceEnabled(newrace)
{
if(newrace==thisRaceID)
{
RaceDisabled=false;
}
}
public OnWar3RaceDisabled(oldrace)
{
if(oldrace==thisRaceID)
{
RaceDisabled=true;
}
}
// Chance/Info Arrays
new Float:BashChance[5]={0.0,0.09,0.15,0.25,0.35};
new Float:UnholyAura[5] = {1.25, 1.45, 1.75, 1.95, 2.10};
new DevotionAura[5]={0,25,50,75,100};
new SKILL_BASH, SKILL_SPEED, SKILL_HEALTH;
public OnPluginStart()
{
LoadTranslations("w3s.race.brute.phrases");
HookEvent("player_spawn", Event_Spawn);
}
public OnWar3LoadRaceOrItemOrdered(num)
{
if(num == thisRaceID)
{
thisRaceID=War3_CreateNewRaceT("brute");
SKILL_HEALTH=War3_AddRaceSkillT(thisRaceID,"DevotionAura",false,4,"25/50/75/100");
SKILL_SPEED = War3_AddRaceSkillT(thisRaceID, "UnholyAura", false, 4, "20%");
SKILL_BASH = War3_AddRaceSkillT(thisRaceID, "BashChance", false,4,"9/15/25/35%","0.2");
War3_CreateRaceEnd(thisRaceID);
War3_AddSkillBuff(thisRaceID, SKILL_HEALTH, iAdditionalMaxHealth, DevotionAura);
War3_AddSkillBuff(thisRaceID, SKILL_SPEED, fMaxSpeed, UnholyAura);
War3_AddSkillBuff(thisRaceID, SKILL_BASH, fBashChance, BashChance);
}
}
public OnMapStart()
{
}
public OnRaceChanged(client,oldrace,newrace)
{
if(oldrace==thisRaceID)
{
Client_RemoveAllWeapons(client, "weapon_knife", true);
}
if(newrace!=thisRaceID)
{
Client_GiveWeaponAndAmmo(client, "weapon_deagle", true, 90); // Change weapon_glock to the weapon you want. 90 is the amount of ammo given.
Client_GiveWeaponAndAmmo(client, "weapon_ak47", true, 90);
War3_SetBuff(client,fMaxSpeed,thisRaceID,1.0);
War3_SetBuff(client,fBashChance,thisRaceID,1.0);
//War3_SetMaxHP(client,100);
War3_SetBuff(client,iAdditionalMaxHealth,thisRaceID,0);
War3_SetCSArmor(client,100);
War3_SetCSArmorHasHelmet(client,true);
}
}
public OnSkillLevelChanged(client,race,skill,newskilllevel)
{
}
public Action:Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new i = GetClientOfUserId(GetEventInt(event, "userid"));
GiveWeapons(i);
}
GiveWeapons(client)
{
if(War3_GetRace(client)==thisRaceID)
{
Client_GiveWeaponAndAmmo(client, "weapon_deagle", true, 90); // Change weapon_glock to the weapon you want. 90 is the amount of ammo given.
Client_GiveWeaponAndAmmo(client, "weapon_ak47", true, 90);
}
}
assassin
Code:
#pragma semicolon 1
#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
#include "smlib"
public Plugin:myinfo =
{
name = "War3Source - Race - Assassin",
author = "JC",
description = "Silence Is Key"
};
new thisRaceID;
new bool:RaceDisabled=true;
public OnWar3RaceEnabled(newrace)
{
if(newrace==thisRaceID)
{
RaceDisabled=false;
}
}
public OnWar3RaceDisabled(oldrace)
{
if(oldrace==thisRaceID)
{
RaceDisabled=true;
}
}
// Chance/Info Arrays
new Float:InvisibilityAlphaTF[5]={1.0,0.74,0.58,0.46,0.30};
new Float:InvisibilityAlphaCS[5]={1.0,0.80,0.70,0.60,0.50};
new Float:ThornsReturnDamage[5] = {0.0, 0.10, 0.14, 0.18, 0.22};
new Float:fEvadeChance[5] = {0.0, 0.11, 0.13, 0.19, 0.21};
SKILL_INVIS, SKILL_THORNS, SKILL_EVADE;
public OnPluginStart()
{
LoadTranslations("w3s.race.assassin.phrases");
HookEvent("player_spawn", Event_Spawn);
}
public OnWar3LoadRaceOrItemOrdered(num)
{
if(num == thisRaceID)
{
thisRaceID=War3_CreateNewRaceT("assassin");
SKILL_INVIS=War3_AddRaceSkillT(thisRaceID,"Invisibility",false,4,"50% (CS), 30% (TF)");
SKILL_THORNS=War3_AddRaceSkillT(thisRaceID, "ThornsAura", false, 4);
SKILL_EVADE=War3_AddRaceSkillT(thisRaceID, "Evasion", false, 4);
War3_CreateRaceEnd(thisRaceID);
War3_AddSkillBuff(thisRaceID, SKILL_INVIS, fInvisibilitySkill, GameTF() ? InvisibilityAlphaTF : InvisibilityAlphaCS);
War3_AddSkillBuff(thisRaceID, SKILL_EVADE, fDodgeChance, fEvadeChance);
}
}
public OnMapStart()
{
}
public OnRaceChanged(client,oldrace,newrace)
{
if(oldrace==thisRaceID)
{
Client_RemoveAllWeapons(client, "weapon_knife", true);
}
if(newrace!=thisRaceID)
{
Client_GiveWeaponAndAmmo(client, "weapon_cz75a", true, 90); // Change weapon_glock to the weapon you want. 90 is the amount of ammo given.
Client_GiveWeaponAndAmmo(client, "weapon_mp9", true, 90);
War3_SetCSArmor(client,100);
War3_SetCSArmorHasHelmet(client,true);
}
}
public OnWar3EventPostHurt(victim, attacker, Float:damage, const String:weapon[32], bool:isWarcraft)
{
if(RaceDisabled)
{
return;
}
if(!isWarcraft && ValidPlayer(victim) && victim != attacker && War3_GetRace(victim) == thisRaceID)
{
new iThornsLevel = War3_GetSkillLevel(victim, thisRaceID, SKILL_THORNS );
if(iThornsLevel > 0 && !Hexed(victim, false))
{
// Don't return friendly fire damage
if(ValidPlayer(attacker) && GetClientTeam(victim) == GetClientTeam(attacker))
{
return;
}
if(!W3HasImmunity(attacker, Immunity_Skills))
{
new iDamage = RoundToFloor(damage * ThornsReturnDamage[iThornsLevel]);
if(iDamage > 0)
{
if(iDamage > 40)
{
iDamage = 40;
}
if (GAMECSANY)
{
// Since this is delayed we don't know if the damage actually went through
// and just have to assume... Stupid!
War3_DealDamageDelayed(attacker, victim, iDamage, "thorns", 0.1, true, SKILL_THORNS);
War3_EffectReturnDamage(victim, attacker, iDamage, SKILL_THORNS);
}
else
{
if(War3_DealDamage(attacker, iDamage, victim, _, "thorns", _, W3DMGTYPE_PHYSICAL))
{
War3_EffectReturnDamage(victim, attacker, War3_GetWar3DamageDealt(), SKILL_THORNS);
}
}
}
}
}
}
}
public Action:Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new i = GetClientOfUserId(GetEventInt(event, "userid"));
GiveWeapons(i);
}
GiveWeapons(client)
{
if(War3_GetRace(client)==thisRaceID)
{
Client_GiveWeaponAndAmmo(client, "weapon_cz75a", true, 90); // Change weapon_glock to the weapon you want. 90 is the amount of ammo given.
Client_GiveWeaponAndAmmo(client, "weapon_mp9", true, 90);
}
}
paladin
Code:
#pragma semicolon 1
#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
#include "smlib"
#include <sdktools>
public Plugin:myinfo =
{
name = "War3Source - Race - Paladin",
author = "JC",
description = "An Elite Solider Specializing in Ranged Combat"
};
new thisRaceID;
new bool:RaceDisabled=true;
public OnWar3RaceEnabled(newrace)
{
if(newrace==thisRaceID)
{
RaceDisabled=false;
}
}
public OnWar3RaceDisabled(oldrace)
{
if(oldrace==thisRaceID)
{
RaceDisabled=true;
}
}
// Chance/Info Arrays
new Float:LevitationGravity[5] = {1.0, 0.8, 0.65, 0.5, 0.4};
new Float:TrueshotDamagePercent[5] = {1.0, 1.07, 1.14, 1.21, 1.28};
new Float:CrazyDuration[5] = {0.0, 4.0, 6.0, 8.0, 10.0};
new Float:CrazyUntil[MAXPLAYERSCUSTOM];
new bool:bCrazyDot[MAXPLAYERSCUSTOM];
new CrazyBy[MAXPLAYERSCUSTOM];
new SKILL_TRUESHOT, SKILL_LOWGRAV, SKILL_CRAZY;
public OnPluginStart()
{
LoadTranslations("w3s.race.paladin.phrases");
CreateTimer(0.5, BloodCrazyDOTLoop, _, TIMER_REPEAT);
HookEvent("player_spawn", Event_Spawn);
}
public OnWar3LoadRaceOrItemOrdered(num)
{
if(num == thisRaceID)
{
thisRaceID=War3_CreateNewRaceT("paladin");
SKILL_LOWGRAV = War3_AddRaceSkillT(thisRaceID, "Levitation", false, 4, "0.4");
SKILL_TRUESHOT = War3_AddRaceSkillT(thisRaceID, "TrueshotAura", false, 4);
SKILL_CRAZY = War3_AddRaceSkillT(thisRaceID, "BloodCrazy", false);
War3_CreateRaceEnd(thisRaceID);
War3_AddSkillBuff(thisRaceID, SKILL_LOWGRAV, fLowGravitySkill, LevitationGravity);
}
}
public OnMapStart()
{
}
public OnWar3EventSpawn(client)
{
if(RaceDisabled)
{
return;
}
bCrazyDot[client] = false;
}
public OnRaceChanged(client,oldrace,newrace)
{
if(oldrace==thisRaceID)
{
Client_RemoveAllWeapons(client, "weapon_knife", true);
}
if(newrace!=thisRaceID)
{
Client_GiveWeaponAndAmmo(client, "weapon_fiveseven", true, 90); // Change weapon_glock to the weapon you want. 90 is the amount of ammo given.
Client_GiveWeaponAndAmmo(client, "weapon_SSG08", true, 90);
//War3_SetMaxHP(client,100);
War3_SetCSArmor(client,100);
War3_SetCSArmorHasHelmet(client,true);
}
}
public OnSkillLevelChanged(client,race,skill,newskilllevel)
{
}
public OnW3TakeDmgBulletPre(victim, attacker, Float:damage)
{
if(RaceDisabled)
{
return;
}
if(attacker != victim)
{
// Trueshot
if(ValidPlayer(attacker) && War3_GetRace(attacker) == thisRaceID)
{
// Don't increase friendly fire damage
if(ValidPlayer(victim) && GetClientTeam(victim) == GetClientTeam(attacker))
{
return;
}
new iTrueshotLevel = War3_GetSkillLevel(attacker, thisRaceID, SKILL_TRUESHOT);
if(iTrueshotLevel > 0 && !Hexed(attacker, false) && !W3HasImmunity(victim, Immunity_Skills))
{
War3_DamageModPercent(TrueshotDamagePercent[iTrueshotLevel]);
W3FlashScreen(victim, RGBA_COLOR_RED);
}
}
}
}
public Action:BloodCrazyDOTLoop(Handle:h,any:data)
{
if(RaceDisabled)
{
return;
}
new attacker;
for(new i=1; i <= MaxClients; i++)
{
if(!ValidPlayer(i, true) || !bCrazyDot[i])
{
continue;
}
attacker = CrazyBy[i];
if(ValidPlayer(attacker))
{
if(War3_GetGame() == Game_TF)
{
War3_DealDamage(i, 1, attacker, _, "bleed_kill");
}
else
{
if(War3_GetGame() == Game_CS && GetClientHealth(i) > 1)
{
War3_DecreaseHP(i, 1);
}
else
{
War3_DealDamage(i, 1, attacker, _, "bloodcrazy");
}
}
War3_ShowHealthLostParticle(i);
}
if(GetGameTime() > CrazyUntil[i])
{
bCrazyDot[i] = false;
}
}
}
public OnW3EnemyTakeDmgBulletPre(victim,attacker,Float:damage)
{
if(RaceDisabled)
{
return;
}
if(!W3IsOwnerSentry(attacker) && War3_GetRace(attacker) == thisRaceID && !Hexed(attacker, false) && !W3HasImmunity(victim,Immunity_Skills))
{
new skilllevel = War3_GetSkillLevel(attacker, thisRaceID, SKILL_CRAZY);
if(skilllevel > 0)
{
bCrazyDot[victim] = true;
CrazyBy[victim] = attacker;
CrazyUntil[victim] = GetGameTime() + CrazyDuration[skilllevel];
}
}
}
public Action:Event_Spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new i = GetClientOfUserId(GetEventInt(event, "userid"));
GiveWeapons(i);
}
GiveWeapons(client)
{
if(War3_GetRace(client)==thisRaceID)
{
Client_GiveWeaponAndAmmo(client, "weapon_fiveseven", true, 90); // Change weapon_glock to the weapon you want. 90 is the amount of ammo given.
Client_GiveWeaponAndAmmo(client, "weapon_SSG08", true, 90);
}
}
When races are switched you get the bruce weapons (ak47,deagle) for paladin and assassin but for bruce race you get the paladin weapons (scout,fiveseven). Theres no mix up on scripts I believe they say the right weapons, so whats the deal???
__________________
Don't get Drunk
Have some Skunk
Last edited by Yevorz; 10-04-2016 at 13:31.
|
|