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

Equation Quest


Post New Thread Reply   
 
Thread Tools Display Modes
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-23-2012 , 15:28   Re: Equation Quest
Reply With Quote #11

I've seen this a long time ago on a ZM server. I used to play a lot there just because that plugin was a big reason. Good job!
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 04-24-2012 , 23:22   Re: Equation Quest
Reply With Quote #12

you can add upgrates for hp, armor, speed and gravity;

nice idea
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-25-2012 , 01:36   Re: Equation Quest
Reply With Quote #13

Quote:
Originally Posted by Blue Snake. View Post
Any sugestions?
What about integer divisions?

You could better use MySQL queries.
Sending TeamInfo messages for each chat message is not a brilliant idea.
__________________

Last edited by claudiuhks; 04-25-2012 at 01:42.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Blue Snake.
Member
Join Date: May 2011
Location: Romania
Old 04-25-2012 , 07:08   Re: Equation Quest
Reply With Quote #14

I'll do integer division in the next version, thanks.

About team info, it's not my function, i've copied it from colorchat.inc because it's not on the amxmodx compiler.

Last edited by Blue Snake.; 04-25-2012 at 07:11.
Blue Snake. is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 04-25-2012 , 11:49   Re: Equation Quest
Reply With Quote #15

Quote:
Originally Posted by Blue Snake. View Post
About team info, it's not my function, i've copied it from colorchat.inc because it's not on the amxmodx compiler.
I said sending TeamInfo messages for each chat message is not a brilliant idea. Your reply is not very descriptive about what you mean.
You may send only SayText messages instead.
__________________

Last edited by claudiuhks; 04-25-2012 at 11:50.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
Blue Snake.
Member
Join Date: May 2011
Location: Romania
Old 04-25-2012 , 12:34   Re: Equation Quest
Reply With Quote #16

You mean i should not hook say_team, only say?
Blue Snake. is offline
GuTo
Senior Member
Join Date: Mar 2010
Location: Brazil - SP
Old 04-25-2012 , 14:52   Re: Equation Quest
Reply With Quote #17

nice man thanks
__________________
GuTo is offline
Send a message via Skype™ to GuTo
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-09-2016 , 06:13   Re: Equation Quest
Reply With Quote #18

You should start the task when a player join the game, not from plugin_init.
new nr1, nr2, type; should be declared as local variables, not global.
This could be reduced a lot:
Spoiler


To something like:
Code:
inWaitTime = false     nr1 = random_num(1, 1000)     nr2 = random_num(1, 1000)     type = random_num(0,3)         new const math_sign[] = {"+", "-", "*", "/"}     new players[32], limit, operation, id;     get_players(players, limit);     for(new i=0 ; i<limit ; ++i)     {         id = players[i]         if(eqEnabled[id])             ColorChat(id, BLUE, "^x04[EQ]^x01 Solve the equation^x03 %d^x01 %s^x03 %d^x01. The faster you answer correctly, the more points you earn...", nr1, nr2, math_sign[type])     }     switch(type)     {         case 0:         {             operation = nr1 + nr2         }         case 1:         {             operation = nr1 - nr2         }         case 2:         {             operation = nr1 * nr2         }         case 3:         {             operation = nr1 / nr2         }     }     num_to_str(operation, correctAnswer, charsmax(correctAnswer));         set_task(get_pcvar_float(timeCvar), "timeOut", taskParam);     questionTime = floatround(halflife_time());
Notice that I cached players[i], you should do the same in other places.

In answer:
  • read_args(say,192) is wrong, you should go until sizeof - 1, not until sizeof. You can directly use charsmax.
  • Do not create variables in a loop, initialize them before.
  • Use formatex, it's faster. But, after all, you don't need to format, just use copy() native.
    Code:
    copy(sTemp, charsmax(sTemp), topNames[j]); copy(topNames[j], charsmax(topNames[]), topNames[j+1]); copy(topNames[j+1], charsmax(topNames[]), sTemp);

I'll just stop here because it's enough for now. Also, you should just attach or link to the needed include file, don't just copy paste it inside your plugin.

Unapproved until you make some changes.
__________________
HamletEagle 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 11:18.


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