Raised This Month: $ Target: $400
 0% 

Hookevent Undefined symbol error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SNCurti
Member
Join Date: Feb 2016
Old 06-03-2016 , 11:10   Hookevent Undefined symbol error
Reply With Quote #1

Code:
public void OnPluginStart()
{
    HookEvent("teamplay_round_win", OnRoundWin);
    HookEvent("teamplay_round_stalemate", OnRoundStalemate);
    HookEvent("teamplay_round_start", OnRoundStart);
    HookEvent("player_spawn", OnPlayerSpawn);
    h_gCvarRoundtime = CreateConVar("CvarRoundtime", "9000.0");
}
Getting undefined symbol error for my HookEvent typEstes, I'm doing this on my phone so maybe that's it but I can't spot the indent error or formatting errors, again, it may be my phone.

Last edited by SNCurti; 06-03-2016 at 11:10.
SNCurti is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 06-03-2016 , 11:33   Re: Hookevent Undefined symbol error
Reply With Quote #2

Error has reference to line, what line?
I think error occur because you don't create callback function.
Kailo is offline
SNCurti
Member
Join Date: Feb 2016
Old 06-03-2016 , 11:35   Re: Hookevent Undefined symbol error
Reply With Quote #3

Quote:
Originally Posted by Kailo View Post
Error has reference to line, what line?
I think error occur because you don't create callback function.
Code:
#include <sdktools_gamerules>
#include <sdktools_sound>
#include <sdkhooks>
#pragma semicolon 1
int inDash[MAXPLAYERS+1];
Handle h_gCvarRoundtime = INVALID_HANDLE;
Handle RoundTimer = INVALID_HANDLE;
public void OnPluginStart()
{
    HookEvent("teamplay_round_win", OnRoundWin);
    HookEvent("teamplay_round_stalemate", OnRoundStalemate);
    HookEvent("teamplay_round_start", OnRoundStart);
    HookEvent("player_spawn", OnPlayerSpawn);
    h_gCvarRoundtime = CreateConVar("CvarRoundtime", "9000.0");
}
public void OnClientConnected(int client)
{
    SDKHook(client, SDKHook_GroundEntChangedPost, OnGroundChange);
}
public void OnGroundChange(int entity)
{
    if (IsClientInGame(entity))
    {
        if (IsPlayerAlive(entity))
        {
            if (inDash[entity] == 0)
            {
                inDash[entity] = 1;
            {
            else
            {
                inDash[entity] = 0;
            }
        }
    }
}
public Action OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
{
    int SpawnedPlayer = GetClientOfUserId(GetEventInt (event, "userid", 0));
    if (GetEntityFlags(client) & FN_ONGROUND)
    {
        inDash[client] = 0;
    }
    else
    {
        inDash[client] = 1;
    }
}
public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
{
    RoundTimer = CreateTimer(GetConVarFloat(h_gCvarRoundtime), TimerRound);
    if (IsSoundPrecached("vo/announcer_you_must_not_fail_this_time.wav"))
    {
        EmitSoundToAll("vo/announcer_you_must_not_fail_this_time.wav", _, _, SNDLEVEL_RAIDSIREN, _, SNDVOL_NORMAL, _, _, _, _, _, _);
    }
    PrintToChatAll("You must not fail this time!");
}
public Action TimerRound(Handle timer, Handle hndl)
{
    GameRules_SetPropString("m_iRoundState", "Roundstate_Stalemate");
}
public Action OnRoundStalemate(Event event, const char[] name, bool dontBroadcast)
{
    KillTimer(RoundTimer);
}
public Action OnRoundWin(Event event, const char[] name, bool dontBroadcast)
{
    KillTimer(RoundTimer);
}
public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon, int &subtype, int &cmdnum, int &tickcount, int &seed, int mouse[2])
{
    float clientOrigin[3];
    if (IsClientInGame(client))
    {
        if (IsPlayerAlive(client) && !(GetEntityFlags(client) & FN_ONGROUND))
        {
            if  (GetClientButtons(client) & IN_JUMP)
            {
                if  (inDash[client] == 0)
                {
                    inDash[client]++;
                    GetClientAbsOrigin(client, clientOrigin);
                    PushClient(client, clientOrigin);
                }
            }
        }
    }
}
stock PushClient(client, float ClientEyeAngles[3])
{
    float movementVector[3];
    float changedVelocity[3];
    GetAngleVectors(ClientEyeAngles, movementVector, NULL_VECTOR, NULL_VECTOR);
    NormalizeVector(movementVector, movementVector);
    ScaleVector(movementVector, distanceScale);
    Entity_GetAbsVelocity(client, changedVelocity);
    for (int i = 0; i < 3; i++)
    {
        switch (i)
        {
            case 1:
            {
                changedVelocity[i] += movementVector
                2 (changedVelocity[i]);
            case 2:
            {
                changedVelocity[i] += movementVector
                2 (changedVelocity[i]);
            case 3:
            {
                changedVelocity[i] = 0.0;
                changedVelocity[i] += movementVector[i];
            }
        
    }
    Entity_SetAbsVelocity(client, changedVelocity);
}
Your plugin failed to compile! Read the errors below:
SourcePawn Compiler 1.7.1
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2014 AlliedModders LLC

/groups/sourcemod/upload_tmp/textz1T9TF.sp(10) : error 017: undefined symbol "OnRoundWin"
/groups/sourcemod/upload_tmp/textz1T9TF.sp(11) : error 017: undefined symbol "OnRoundStalemate"
/groups/sourcemod/upload_tmp/textz1T9TF.sp(12) : error 017: undefined symbol "OnRoundStart"
/groups/sourcemod/upload_tmp/textz1T9TF.sp(13) : error 017: undefined symbol "OnPlayerSpawn"

Last edited by SNCurti; 06-03-2016 at 11:37.
SNCurti is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 06-03-2016 , 12:15   Re: Hookevent Undefined symbol error
Reply With Quote #4

Code:
public void OnGroundChange(int entity)
{
    if (IsClientInGame(entity))
    {
        if (IsPlayerAlive(entity))
        {
            if (inDash[entity] == 0)
            {
                inDash[entity] = 1;
            {
            else
            {
                inDash[entity] = 0;
            }
        }
    }
}
The { marked in red should be }.

Inside OnPlayerSpawn you're using client instead of SpawnedPlayer.
FN_ONGROUND should be FL_ONGROUND.
Inside PushClient you're using distanceScale which doesn't exist.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 06-03-2016 at 12:19.
DJ Tsunami is offline
SNCurti
Member
Join Date: Feb 2016
Old 06-03-2016 , 19:40   Re: Hookevent Undefined symbol error
Reply With Quote #5

Quote:
Originally Posted by DJ Tsunami View Post
Code:
public void OnGroundChange(int entity)
{
    if (IsClientInGame(entity))
    {
        if (IsPlayerAlive(entity))
        {
            if (inDash[entity] == 0)
            {
                inDash[entity] = 1;
            {
            else
            {
                inDash[entity] = 0;
            }
        }
    }
}
The { marked in red should be }.

Inside OnPlayerSpawn you're using client instead of SpawnedPlayer.
FN_ONGROUND should be FL_ONGROUND.
Inside PushClient you're using distanceScale which doesn't exist.
Thank you! It works.
SNCurti is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:28.


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