View Single Post
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 02-01-2014 , 23:15   Re: [TF2] Making Syringe projectile shoot straight?
Reply With Quote #12

"entity" is not a string. It is the ent index of the entity. It's a number, ranging anywhere from MaxClients+1 to 4096 (right?)


PHP Code:
public OnEntityCreated(entity, const String:classname[]) //syringe gun redo
{
    if (
StrEqual(classname"tf_projectile_syringe"false))
        
SDKHook(entitySDKHook_SpawnHook_SyringeSpawned);
}
public 
Hook_SyringeSpawned(syringe)
{
    if (
IsValidEntity(syringe)) //this check might not be necessary, but I don't know enough about SDKHooks to say for certain
        
SetEntityGravity(syringe0.1);

There is no need to check the entity's validness multiple times. Also, you cannot SetEntityGravity on a string, only on entities.

Also, I don't know how well setting the gravity to 0.1 would work. You might want to replace SetEntityGravity with the movetype suggestion above.
__________________

Last edited by ddhoward; 02-01-2014 at 23:27.
ddhoward is offline