Hey guys I've had a crack coding my first race with some help from your tutorials. Little did I know I need a testing platform which I don't have nor can I get to work.
I was wondering if anyone could either tell me if it works or test it for me.
#include <sourcemod>
#include "War3Source/War3Source_Interface"
#include <sdktools>
#include <sdktools_functions>
new raceID;
public Plugin:myinfo =
{
name = "Splatgutz", //Race Name!
author = "Splatted", //Author of the race!
description = "Myfirstrace", //Description for the race!
version = "1.0", //Race Version!
url = "sevensinsgaming.com/" //
};
new ComballEffect,FireSprite,HyBeam,TeleBeam;
public OnWar3PluginReady()
{
raceID=War3_CreateRace("Splatgutz",
"splatgutz
"You are now Splatgutz",
"Respawned as Splatgutz",
"Kebab Sauce Slowdown",
"Slowdown the enemy you shoot!",
"Harden",
"Lightspeed","Use your ultimate for 10 seconds of 225-300% speed"");
}
public OnPluginStart()
{
HookEvent("player_Attacker",PlayerAttackerEvent);
}
public PlayerSpawnEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
new victim=GetClientOfUserId(GetEventInt("userid"));
new attacker=GetClientOfUserId(GetEventInt("attacker"));
if(victim>0 && attacker>0)
{
new skill_attacker=War3_GetSkillLevel(attacker,victim,skillnumber);
if(skill_attacker>0)
{
new Float:speed=1.0;
switch(skill_attacker)
{
case 1:
speed=0.8;
case 2:
speed=0.7;
case 3:
speed=0.5;
case 4:
speed=0.2;
}
War3_SetOverrideSpeed(victim,speed,skillnumber);
TE_SetupBeamRingPoint(vec,25.10,10.0.0,ComballEffect,TeleBeam,,5,25,1.3,15.0,0.0,ringColor,20,1.0);
TE_SetupBeamRingPoint(vec,60.60,25.0.0,FireSprite,HyBeam,10,29,1.3,15.0,10.0,ringColor,50,5.3);
TE_SendToAll();
CreateTimer(5.0,fix_speed,GetEventInt("userid"));
}
}
public Action:fix_speed(Handle:timer,any:userid)
{
new client=GetClientOfUserId(userid);
if(client>0)
{
War3_SetOverrideSpeed(victim,0.0,skillnumber);
}
}
CreateTimer(5.0,fix_speed,GetEventInt("userid"));
{
case 0:
add_health=4;
case 1:
add_health=8;
case 2:
add_health=16;
case 3:
add_health=32;
case 4:
add_health=64;
{
public Action:fix_speed(Handle:timer,any:userid)
{
new client=GetClientOfUserId(userid);
if(client>0)
{
War3_SetOverrideSpeed(victim,0.0,skillnumber);
}
}
enum War3Immunity
{
Immunity_Ultimates = 1,
Immunity_HealthTake = 1,
{
War3_ChatMessage(client,"You can't stop me, and Toughtnut !",);
}
}
public OnSkillLevelChanged(client,race,skill,oldskilllevel,newskilllevel)
{
if(race==raceID && skill==0)
{
War3_SetMinSpeed(client,speed)
}
if(race==raceID && skill==1)
{
new Float:speed=1.0;
switch(newskilllevel)
{
case 0:
speed=1.3;
case 1:
speed=1.5;
case 2:
speed=1.6;
case 3:
speed=1.7;
case 4:
speed=1.8;
}
War3_SetMaxSpeed(client,speed);
}
}
public OnMapStart()
{
FireSprite=PrecacheModel("materials/sprites/halo01.vmt");
ComballEffect=PrecacheModel("models/effects/comball_tape.vmt");
HyBeam=PrecacheModel("sprites/hydragutbeamcap.vmt");
TeleBeam=PrecacheModel("sprites/tp_beam001.vmt");
}
public OnRaceSelected(client,oldrace,newrace)
{
if(newrace!=raceID)
{
War3_SetMaxSpeed(client,1.0);
War3_SetMinGravity(client,1.0);
War3_SetMinHealth(client,100);
}
}
}





Logged







DarkEnergy