Raised This Month: $51 Target: $400
 12% 

Undefined Symbol


Post New Thread Reply   
 
Thread Tools Display Modes
QOOOOOOOOQ
Senior Member
Join Date: Dec 2012
Old 01-20-2014 , 04:36   Re: Undefined Symbol
Reply With Quote #11

Alright thanks, will try it soon.
QOOOOOOOOQ is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 01-20-2014 , 05:44   Re: Undefined Symbol
Reply With Quote #12

Quote:
Originally Posted by Impact123 View Post
The prototype he has is perfectly fine, see here.
Ha, i never looked at that
Interesting.
xf117 is offline
Send a message via ICQ to xf117
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 01-20-2014 , 09:53   Re: Undefined Symbol
Reply With Quote #13

Quote:
Originally Posted by GsiX View Post
if he miss the curly bracket, the compiler give wrong error line.
I understand that. He said the file is large, and unless the timer function is the very last thing in the file, other things would more than likely come up as undefined if he missed a closing bracket somewhere. Or at least when I miss one I get more than one function being seen as undefined.
Marcus_Brown001 is offline
V1SoR
Member
Join Date: Jan 2011
Old 01-20-2014 , 09:57   Re: Undefined Symbol
Reply With Quote #14

Are you actually creating the timer outside of any function? Technically it may be nothing bad for SourcePawn, but it's against all SM standards and conventions. Also, I have no clue when would the entirety of that code be executed. Couple it with the TIMER_DATA_HNDL_CLOSE flag(which you most likely don't need) and you might get an idea of what you're doing wrong.

Last edited by V1SoR; 01-20-2014 at 09:57.
V1SoR is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 01-20-2014 , 10:23   Re: Undefined Symbol
Reply With Quote #15

Code:
hChooseTeamMenuTimer = CreateTimer(0.5, Timer_ChooseTeamMenu);

public Action:Timer_ChooseTeamMenu(Handle:hTimer)
{
    hChooseTeamMenuTimer = INVALID_HANDLE;

    for (new vWho = 1; vWho <= MaxClients; vWho++)
    {
        if(IsClientInGame(vWho) && GetClientTeam(vWho) == TEAM_SPECTATORS)
        {
            bTempBlockTeams[vWho] = false;
            FakeClientCommand(vWho, "chooseteam");
        }
    }
}

Last edited by Visual77; 01-20-2014 at 17:39.
Visual77 is offline
GsiX
gee, six eggs
Join Date: Aug 2012
Location: Land Below The Wind
Old 01-20-2014 , 10:59   Re: Undefined Symbol
Reply With Quote #16

Quote:
Originally Posted by Marcus_Brown001 View Post
I understand that. He said the file is large, and unless the timer function is the very last thing in the file, other things would more than likely come up as undefined if he missed a closing bracket somewhere. Or at least when I miss one I get more than one function being seen as undefined.
Quote:
Originally Posted by QOOOOOOOOQ View Post
I see, I'll just fix other errors
__________________
If i happen to insulted you unintentionally,
it was me and Google Translate who did it.
GsiX is offline
QOOOOOOOOQ
Senior Member
Join Date: Dec 2012
Old 01-20-2014 , 21:28   Re: Undefined Symbol
Reply With Quote #17

Quote:
Originally Posted by V1SoR View Post
Are you actually creating the timer outside of any function? Technically it may be nothing bad for SourcePawn, but it's against all SM standards and conventions. Also, I have no clue when would the entirety of that code be executed. Couple it with the TIMER_DATA_HNDL_CLOSE flag(which you most likely don't need) and you might get an idea of what you're doing wrong.
No. It's inside OnClientDisconnect, of which all the other appropriate lines in the function have correct syntax afaik, no errors and looks alright. PS: Brackets and parenthesis in the method are all seemingly correct too, in case you were wondering.

Quote:
Originally Posted by Visual77 View Post
Code:
hChooseTeamMenuTimer = CreateTimer(0.5, Timer_ChooseTeamMenu);

public Action:Timer_ChooseTeamMenu(Handle:hTimer)
{
    hChooseTeamMenuTimer = INVALID_HANDLE;

    for (new vWho = 1; vWho <= MaxClients; vWho++)
    {
        if(IsClientInGame(vWho) && GetClientTeam(vWho) == TEAM_SPECTATORS)
        {
            bTempBlockTeams[vWho] = false;
            FakeClientCommand(vWho, "chooseteam");
        }
    }
}
Why not just use TIMER_DATA_HNDL_CLOSE instead of that way? Seems like it's more reasonable to use the other way, as it's designed it specifically for that reason, no? Also I've always wondered why add an extra check for IsClientInGame if them being a valid client on the server is already true? Also... what's the point of MaxClients instead of MAXPLAYERS... they'd both end up with the same end-result no?

Last edited by QOOOOOOOOQ; 01-20-2014 at 21:32.
QOOOOOOOOQ is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 01-20-2014 , 21:42   Re: Undefined Symbol
Reply With Quote #18

It is common practice to verify that the client is in-game inside of a timer for the fact that from the time you start the timer to the time that the timer function is called, there is the potential for the client to leave the server. If you then try to do actions on the client that has left the server, you will more than likely get errors with invalid client index. Even if the timer is for a very small time interval, you should always check if the client is in-game first.
Marcus_Brown001 is offline
Visual77
Veteran Member
Join Date: Jan 2009
Old 01-21-2014 , 03:24   Re: Undefined Symbol
Reply With Quote #19

Quote:
Originally Posted by QOOOOOOOOQ View Post
Why not just use TIMER_DATA_HNDL_CLOSE instead of that way? Seems like it's more reasonable to use the other way, as it's designed it specifically for that reason, no? Also I've always wondered why add an extra check for IsClientInGame if them being a valid client on the server is already true? Also... what's the point of MaxClients instead of MAXPLAYERS... they'd both end up with the same end-result no?
Shouldn't TIMER_DATA_HNDL_CLOSE only be used when a datapack is passed to the timer and CreateDataTimer isn't being used? It's to avoid adding CloseHandle to the datapack timer function from my understanding.
MAXPLAYERS is bad form for loops, it's a fixed value of 64 or 65. MaxClients is all the players on the server - could be 8 players if your server has 8 players.

You need IsClientInGame because native GetClientTeam(client) can error out if the client is not in game? What Marcus_Brown001 said btw too. If you wouldn't have GetClientTeam in your loop, you most likely wouldn't need
IsClientInGame. For example, just resetting a boolean on all clients back to false wouldn't be needing IsClientInGame.

http://docs.sourcemod.net/api/index....d=show&id=411&

Last edited by Visual77; 01-21-2014 at 03:37.
Visual77 is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 01-21-2014 , 07:26   Re: Undefined Symbol
Reply With Quote #20

Createdatatimer automatically closes the handle when it expires, the flag is not necessary for datatimers.
You only need to close it if you manually create a data pack and pass that, be it a timer, or anywhere.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 23:26.


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