Hey guys,
I was coding a race for the war3source mod for CSS.
And I was creating a race that changed you into the crow player model and let you fly. All the while having a env_fire on my body but with negated damage.
Every time I go from the original player model to the crow the flame offsets to about a metre or two behind me. I know this from using the third-person plugin.
I did a vector check to post to chat my position but it doesnt change when I switch to the bird.
Here's the code for the flame.
PHP Code:
public Action:FireWalk(Handle:timer,any:client)
{
if(War3_GetRace(client)==thisRaceID && IsPlayerAlive(client))
{
new Float:pos[3];
GetClientAbsOrigin(client,pos);
new fire = CreateEntityByName("env_fire");
SetEntPropEnt(fire, Prop_Send, "m_hOwnerEntity", client);
DispatchKeyValue(fire, "firesize", "50");
DispatchKeyValue(fire, "health", "5");
DispatchKeyValue(fire, "firetype", "Normal");
DispatchKeyValue(fire, "damagescale", "0.0");
DispatchKeyValue(fire, "spawnflags", "256");
SetVariantString("WaterSurfaceExplosion");
AcceptEntityInput(fire, "DispatchEffect");
DispatchSpawn(fire);
TeleportEntity(fire, pos, NULL_VECTOR, NULL_VECTOR);
AcceptEntityInput(fire, "StartFire");
SetVariantString("!activator");
AcceptEntityInput(fire, "SetParent", client);
DispatchKeyValue(fire, "extinguish", "5.0");
CreateTimer(5.0,FireWalk,client);
}
}
And this is the code for changing into the bird
PHP Code:
public OnAbilityCommand(client,ability,bool:pressed)
{
if(War3_GetRace(client==thisRaceID) && pressed && ValidPlayer(client,true))
{
new skill_level=War3_GetSkillLevel(client,thisRaceID,SKILL_CROW);
if(skill_level>0)
{
if(War3_SkillNotInCooldown(client,thisRaceID,SKILL_CROW,true))
{
if(!bFlying[client])
{
bFlying[client]=true;
War3_SetBuff(client,bFlyMode,thisRaceID,true);
PrintHintText(client,"Bird Form!");
SetEntityModel(client, "models/crow.mdl");
new weapon=GetPlayerWeaponSlot(client, 2);
if(weapon>0){
RemovePlayerItem(client, weapon);
}
}
else
{
CreateTimer(0.1,returnform,client);
}
War3_CooldownMGR(client, 1.0, thisRaceID, SKILL_CROW, false, false);
}
}
else
{
PrintHintText(client,"Level Your Ultimate First");
}
}
}
public Action:returnform(Handle:h, any:client)
{
if(IS_PLAYER(client)&&IS_PLAYER(client))
{
bFlying[client]=false;
War3_SetBuff(client,bFlyMode,thisRaceID,false);
PrintHintText(client,"Human Form!");
GivePlayerItem(client, "weapon_knife");
if(GetClientTeam(client)==3)
{
SetEntityModel(client, "models/player/ct_urban.mdl");
}
if(GetClientTeam(client)==2)
{
SetEntityModel(client, "models/player/t_leet.mdl");
}
}
}
Please help