SourceMod Donor
Join Date: Sep 2004
Location: Germany
|
01-09-2008
, 11:10
Re: TF2: Possible to spawn a sentry gun?
|
#13
|
ok ... i spawned the sentry ... and updated it to level 2 ... heres the result:
Code:
delta entity: 58
+ DT_ObjectSentrygun m_flCycle, DPT_Float, index 1, bits 10, value 0.000
+ DT_ObjectSentrygun m_nNewSequenceParity, DPT_Int, index 6, bits 3, value 7
+ DT_ObjectSentrygun m_nResetEventsParity, DPT_Int, index 7, bits 3, value 5
+ DT_ObjectSentrygun m_iAmmoShells, DPT_Int, index 9, bits 9, value 120
+ DT_ObjectSentrygun m_nModelIndex, DPT_Int, index 264, bits 11, value 364
+ DT_ObjectSentrygun m_iHealth, DPT_Int, index 305, bits 13, value 90
+ DT_ObjectSentrygun m_iMaxHealth, DPT_Int, index 306, bits 13, value 90
+ DT_ObjectSentrygun m_iUpgradeLevel, DPT_Int, index 320, bits 3, value 2
+ DT_ObjectSentrygun m_iState, DPT_Int, index 323, bits 3, value 3
+ DT_ObjectSentrygun m_iUpgradeMetal, DPT_Int, index 324, bits 10, value 0
= 156 bits (20 bytes)
i have added all these changes to my spawn script, but it has no effect ... still the same problems :-/
here my current test-code:
PHP Code:
#include <sourcemod>
#include <dbi>
#include <timers>
#include <events>
#include <clients>
#include <sdktools>
new Float:ori[3];
public Plugin:myinfo = {
name = "bla",
author = "bla",
description = "bla",
version = "bla",
url = "bla"
};
public OnPluginStart() {
RegConsoleCmd("say", Command_Say);
}
public Action:Command_Say(client, args) {
new String:text[192];
GetCmdArg(1,text,sizeof(text));
if ( StrEqual(text,"sentry") ) {
//time to move away
GetClientAbsOrigin(client,ori);
CreateTimer(1.0,CreateSentry,client);
return Plugin_Handled;
}
return Plugin_Continue;
}
public Action:CreateSentry(Handle:timer,any:client) {
new Float:vbm[3];
vbm[0] = 24.0;
vbm[1] = 24.0;
vbm[2] = 66.0;
new Float:mwc[3];
mwc[0] = 1.0;
mwc[1] = 0.5;
mwc[2] = 0.0;
new Float:angle[3];
GetClientAbsAngles(client,angle);
angle[0] = 0.0;
angle[2] = 0.0;
new team = GetClientTeam(client);
new ent = CreateEntityByName("obj_sentrygun");
DispatchSpawn(ent);
//
TeleportEntity(ent, ori , angle , NULL_VECTOR );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_flAnimTime") , 51 , 4 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_nNewSequenceParity") , 4 , 4 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_nResetEventsParity") , 4 , 4 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iAmmoShells") , 150 , 4, true );
//SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_nModelIndex") , 353 , 4 , true );
SetEntityModel(ent,"models/buildables/sentry1.mdl");
SetEntDataEnt( ent , FindSendPropOffs("CObjectSentrygun","m_nSequence") , 0 , true );
SetEntDataFloat( ent , FindSendPropOffs("CObjectSentrygun","m_flPlaybackRate") , 1.0 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iMaxHealth") , 200 , 4, true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iHealth") , 200 , 4, true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_bBuilding") , 0 , 2, true );
SetEntDataFloat( ent , FindSendPropOffs("CObjectSentrygun","m_flPercentageConstructed") , 1.0 , true );
SetEntDataVector( ent , FindSendPropOffs("CObjectSentrygun","m_vecOrigin") , ori , true );
SetEntDataVector( ent , FindSendPropOffs("CObjectSentrygun","m_angRotation") , angle , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_bPlacing") , 0 , 2, true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_bDisabled") , 0 , 2 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iObjectType") , 3, true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iState") , 1, true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iUpgradeMetal") , 199 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_bHasSapper") , 0 , 2 , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_nSkin") , team==3?1:0 , 1 , true ); //paint red or blue
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_bServerOverridePlacement") , 1 , 1 , true);
SetEntDataVector( ent , FindSendPropOffs("CObjectSentrygun","m_vecBuildMaxs") , vbm , true );
SetEntDataVector( ent , FindSendPropOffs("CObjectSentrygun","m_flModelWidthScale") , mwc , true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iUpgradeLevel") , 1 , 4, true );
SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_iAmmoRockets") , 0 , 4, true );
SetEntDataEnt(ent, FindSendPropOffs("CObjectSentrygun","m_hBuilder"), client , true);
SetEntDataFloat( ent , FindSendPropOffs("CObjectSentrygun","m_flCycle") , 0.0 , true );
SetVariantInt(team) //Prep the value 3 for the call below
AcceptEntityInput(ent, "TeamNum", -1, -1, 0); //Change TeamNum to 3, 3=Blue Team | 2 = Red Team
SetVariantInt(team) //Same thing again but we are changing SetTeam
AcceptEntityInput(ent, "SetTeam", -1, -1, 0);
}
ah ... and when i spawn it, i got the following errors:
Code:
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
__________________
Last edited by Tauphi; 01-09-2008 at 11:29.
|
|