Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-24 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 03:13:38 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: I make superheroes..  (Read 322 times)
gghh3322
Jr. Member
**
Posts: 56


View Profile
« on: September 05, 2010, 02:38:59 AM »

Code:
/**
* File: War3Source_UndeadScourge.sp
* Description: The Undead Scourge race for War3Source.
* Author(s): Anthony Iacono
*/

#pragma semicolon 1

#include <sourcemod>
#include "W3SIncs/War3Source_Interface"
#include <sdktools>


// War3Source stuff
new thisRaceID;
new Float:NewPos[66][3];
new Float:OldPos[66][3];
new now[66];

public Plugin:myinfo =
{
name = "SH hero invisible man",
author = "GGHH3322",
description = "SH Race",
version = "1.0.0.0",
url = "not"
};

// War3Source Functions
public OnPluginStart()
{
CreateTimer(1.0,Invisble,_,TIMER_REPEAT);
}
public OnWar3LoadRaceOrItemOrdered(num)
{
if(num==40)
{



thisRaceID=SHRegisterHero(
"Invisible Man",
"invisibleman",
"equip knife and stop 5sec, you are 100% invisble ",
"equip knife and stop 5sec, you are 100% invisble ",
false
);
}
}

public OnWar3EventSpawn(client)
{
//PrintToChatAll("SPAWN %d",client);

if(SHHasHero(client,thisRaceID))
{
InitPassiveSkills(client); //sets suicide
}
}

public OnRaceSelected(client)
{
if(!SHHasHero(client,thisRaceID))
{
War3_SetBuff(client,fInvisibilitySkill,thisRaceID,1.0);
}
else
{
if(IsPlayerAlive(client)){
InitPassiveSkills(client);
}
}
}

public Action:Invisble(Handle:timer,any:userid)
{
if(thisRaceID>0)
{
for(new i=1;i<=MaxClients;i++)
{
if(SHHasHero(i,thisRaceID))
{
Invsing(i);
}
}
}
}

public InitPassiveSkills(client){
if(SHHasHero(client,thisRaceID))
{
}
}
public Invsing(client)
{
new String:weapon[128];//weapon Char Array
GetClientWeapon(client, weapon, 128);// Get client Weapon(Knife)
GetClientAbsOrigin(client,NewPos[client]);
if((NewPos[client][0]!=OldPos[client][0]) || (NewPos[client][1]!=OldPos[client][1]) || (NewPos[client][2]!=OldPos[client][2]))
{
now[client]=0;
War3_SetBuff(client,fInvisibilitySkill,thisRaceID,now[client]);
if(StrEqual(weapon,"weapon_knife") && now[client]<1)
{
PrintHintText(client,"Your are not invisible Man.");
}
}
else
{
if(StrEqual(weapon,"weapon_knife"))
{
if(now[client]>=9)
{
War3_SetBuff(client,fInvisibilitySkill,thisRaceID,0.0);
PrintHintText(client,"Your completely invisible Man.");
}
else{
now[client]+=2;
PrintHintText(client,"Your invisibility is : %d\%",100-now[client]*10);
War3_SetBuff(client,fInvisibilitySkill,thisRaceID,now[client]*0.01);
}
}
}
OldPos[client][0]=NewPos[client][0];
OldPos[client][1]=NewPos[client][1];
OldPos[client][2]=NewPos[client][2];
}
but it's not invisible.
It's not working in SH the fInvisibilitySkill...?
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #1 on: September 05, 2010, 07:32:53 AM »

its reaching that part of the code right?
Logged

DarkEnergy
gghh3322
Jr. Member
**
Posts: 56


View Profile
« Reply #2 on: September 05, 2010, 09:03:37 AM »

Yes
PrintHintText(client,"Your completely invisible Man.");
that message showed
Logged
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2045



View Profile WWW Email
« Reply #3 on: September 05, 2010, 04:13:18 PM »

will be fixed next release

also you are not passing correct values to the buff system. values are from 0.0 to 1.0, you need to convert (100-now[client]*10) to  a float properly
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!