AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   env_fire offsetting on new playermodel (https://forums.alliedmods.net/showthread.php?t=281577)

Knox Kye 04-14-2016 20:37

env_fire offsetting on new playermodel
 
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(fireProp_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(fireposNULL_VECTORNULL_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(client2);
                    if(
weapon>0){
                        
RemovePlayerItem(clientweapon); 
                    }
                }    
                else
                {
                    
CreateTimer(0.1,returnform,client);
                }
                
War3_CooldownMGR(client1.0thisRaceIDSKILL_CROWfalsefalse);
            }
            
        }
        else
        {
            
PrintHintText(client,"Level Your Ultimate First");
        }
    }
}





public 
Action:returnform(Handle:hany: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 :)

EFFx 04-14-2016 21:24

Re: env_fire offsetting on new playermodel
 
SourceMod.


All times are GMT -4. The time now is 18:34.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.