AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Giving projectiles forward velocity (https://forums.alliedmods.net/showthread.php?t=331405)

topyke 03-19-2021 19:00

Giving projectiles forward velocity
 
I'm trying to give created projectiles from custom weapons in tf2 velocity. however, I'm getting errors when trying to compile the code. Could someone help me? My code is here (starts at line 11)
Code:

public void OnPluginStart()
{
 HookEvent("player_shoot", Event_PlayerShoot);
}

public void Event_PlayerShoot(Event event, const char[] name, bool dontBroadcast)
{
  int victim_id = event.GetInt("userid");
  int weapon_id = event.GetInt("weaponid");
  int mode_id = event.GetInt("mode");
 
 
  /* CODE */
 
  if (weapon_id == 230)
  {
          public OnEntityCreated(entity, const String:classname[])
{
    if (StrEqual(classname, "tf_projectile_healing_bolt", false))
        SDKHook(entity, SDKHook_Spawn, Hook_SyringeSpawned);
}
public Hook_SyringeSpawned(syringe)
{
    if (IsValidEntity(syringe))
        void TeleportEntity(int entity, const float origin[NULL_VECTOR], const float angles[NULL_VECTOR], const float velocity[3])
}
  }
 
  }
}

The errors I got was
(27)Error 029: invalid expression, assumed zero
(27)error 017: undefined symbol "OnentityCreated"
(27)error 029: invalid expression, assumed zero


All times are GMT -4. The time now is 09:38.

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