Raised This Month: $ Target: $400
 0% 

Map Chooser - sayNextMap()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 08-15-2006 , 20:04   Map Chooser - sayNextMap()
Reply With Quote #1

I finally decided to try my hand at Pawn, but I'm having a little trouble.

Code:
public sayNextMap() {     new name[32]         getNextMapName(name, 31)         new timeleft     timeleft = get_timeleft()         new minsuntilvote     minsuntilvote = timeleft / 60 - 2         if (timeleft < 65)     {     client_print(0, print_chat, "%L %s", LANG_PLAYER, "NEXT_MAP", name)     } else {     client_print(0, print_chat, "[AMX] There will be a vote in approximately %i minutes to choose the next map or extend the current one.", minsuntilvote)     } }
I haven't tested the 'minsuntilvote' feature, so I'm not entirely sure if the syntax is correct, but when I type nextmap after the map vote (i.e. when there's less than 65 seconds remaining) the if statement returns false, meaning the wrong client_print is displayed. Where have I gone wrong?

Thanks for your time.

Last edited by Lee; 08-16-2006 at 12:04. Reason: Small Tags
Lee is offline
Des12
Senior Member
Join Date: Jan 2005
Old 08-16-2006 , 00:25   Re: Map Chooster - sayNextMap()
Reply With Quote #2

client_print(0, print_chat, "%L %s %s", LANG_PLAYER, "NEXT_MAP", name)

Not exactly sure, but looks like you need 1 more '%s' for "name"
__________________
-Dest Romano

www.JustRP.com
A TSRP Server

Quote:
Originally Posted by Brad
Don't you go be bringing reality into this.
Des12 is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 08-16-2006 , 11:41   Re: Map Chooster - sayNextMap()
Reply With Quote #3

I didn't edit that; that's the default behaviour of the nextmap plugin. It still wouldn't explain why the incorrect client_print is being shown.

After further testing, the problem can only lie with 'if (timeleft < 65)', since 'minsuntilvote' displays the correct time. Any thoughts?
Lee is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 08-16-2006 , 21:06   Re: Map Chooser - sayNextMap()
Reply With Quote #4

Wow, it was nothing but stupidity. I was under the impression 65 seconds was over two minutes and simply changed that to 111 and it now works as desired. Whoops.
Lee 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 14:40.


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