Raised This Month: $ Target: $400
 0% 

Voting menu won't display.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 12:37   Re: Voting menu won't display.
Reply With Quote #1

Nevermind, I fixed it, I noticed all these bugs.

I just wanted to thank you Exolent, You're doing an amazing job and you don't know how much I appreciate your kind help. Thanks alot.
Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-20-2011 , 12:38   Re: Voting menu won't display.
Reply With Quote #2

Quote:
Originally Posted by Diegorkable View Post
Nevermind, I fixed it, I noticed all these bugs.

I just wanted to thank you Exolent, You're doing an amazing job and you don't know how much I appreciate your kind help. Thanks alot.
Gotta find something to do in down time at work
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 14:08   Re: Voting menu won't display.
Reply With Quote #3

By the way, I have another question.

I need a script that shows the team score status of both teams by a command, so I copied it into my script but appearently it doesnt work, I did a set task in round_start that if it gets from the file a character that says that the match has started it'll show every round_start the current score. Here's the code of showing the score:

Why isn't that working?

PHP Code:
/* Global variables that are in this code */

new g_iScore[2]
new 
g_iLastTeamScore[2]

/* Global... */

public Event_TeamScore()
{
    new 
szTeamName[2]
    
read_data(1szTeamName1)
    
    new 
iTeam = (szTeamName[0] == 'T') ? 1
    
new iScore read_data(2)
    new 
iScoreOffset iScore g_iLastTeamScore[iTeam]
    
    if(
iScoreOffset 0)
    {
        
g_iScore[iTeam] += iScoreOffset
    
}
    
    
g_iLastTeamScore[iTeam] = iScore
    
    
if ((g_iScore[0] == 16) || (g_iScore[1] == 16))
    {
        
EndMatch()
    }
    
ClientCommand_SayScore()
}

public 
ClientCommand_SayScore()
{
        
set_hudmessage(2552552550.060.6206.012.0)
        
show_hudmessage(0"Score: (Terrorist) %d - (Counter-Terrorist) %d"g_iScore[0], g_iScore[1])
        return 
PLUGIN_HANDLED

Im sure that it gets to this public cuz i did a client_print to show if its in the public or not, and it printed.
Diegorkable is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-20-2011 , 14:33   Re: Voting menu won't display.
Reply With Quote #4

It looks fine to me.
Try printing variables inside the function just so you can see what's going on.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-20-2011 , 14:46   Re: Voting menu won't display.
Reply With Quote #5

What's not working correctly exactly? Is it showing the wrong score or not displaying at all? Also show how you hook TeamScore.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 17:38   Re: Voting menu won't display.
Reply With Quote #6

ok

This is the public of round_start:
the problem is that it doesnt display at all, try looking at it. I did that this Pug Plugin will be supported on an .ini file. It gets the current status of the gather by what's last written in the file, for this case, if the char is '2', then it counts the rounds that has passed + shows the score every round start.

PHP Code:
/* Global variables */
new getchar
/* ............ */


public round_start()
{
    
get_configsdir(pug_ini_file63);
    
format(pug_ini_file63"%s/pug.ini"pug_ini_file);
    
    if (!
file_exists(pug_ini_file))
    {
        
client_print(0print_chat"%s ERROR! Pug.ini file not found."PREFIX)
        return 
PLUGIN_HANDLED
    
}
    
    new 
doo fopen(pug_ini_file"r")
    
    
fseek(doo, -1SEEK_END)
    
getchar fgetc(doo)
    
    if (
getchar == '0')
    {
        return 
PLUGIN_HANDLED
    
}
    
    else if (
getchar == '1')
    {
        return 
PLUGIN_HANDLED
    
}
    
    else if(
getchar == '2')
    {
        
set_task(0.5"Event_TeamScore")
        
        if (
roundspassed == 15)
        {
            
SwitchTeams()
                        
client_print(0print_chat"%s 15 round have passed, switching teams."PREFIX)
        }
                
roundspassed++
    }
    
    else if(
getchar == '3')
    {
        if (
roundspassed2 == 0)
        {
            
set_hudmessage(2552552550.060.6206.012.0)
            
show_hudmessage(0"2nd HALF Started. Good Luck!")
            
roundspassed2++
            
set_task(5.0"Event_TeamScore2")
        }
    }
    
    return 
PLUGIN_HANDLED


Last edited by Diegorkable; 07-20-2011 at 17:42.
Diegorkable is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-20-2011 , 17:54   Re: Voting menu won't display.
Reply With Quote #7

You have to hook TeamScore using register_event()

You can't just send a task to Event_TeamScore and be able to read data from it.

Also, what else is supposed to be in pug.ini?

Also, use fgeti instead of fgetc.

Also, fseek is now depracated.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 17:49   Re: Voting menu won't display.
Reply With Quote #8

1 more question, will an sv_restart 1 reset the team score according to this public?
Diegorkable is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-20-2011 , 17:58   Re: Voting menu won't display.
Reply With Quote #9

Ok I'll answer to your "lines"

- Can you tell me what would be the exact command to register that event?

- So how would I be able to send a task to it and read data from it?

- Only numbers, example of content that would be in pug.ini after they start the match: '2'

- fgeti is depracated, anyways its not critical.

- so what can I use instead of fseek to go to the end of the line in the pug.ini file?

And as I asked before, will sv_restart 1 restart the score according to the Event Team Score public?
Diegorkable is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-20-2011 , 18:05   Re: Voting menu won't display.
Reply With Quote #10

Oops didn't see the depracated for fgeti, my bad.

register_event( "TeamScore", "Event_TeamScore", "a" );

You couldn't send a task the data that TeamScore holds, you could only send data that you have previously.

Yes, I think sv_restart would restart the score.
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
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 00:51.


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