Raised This Month: $10 Target: $400
 2% 

Solved Math and and hook "say"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 07-03-2020 , 13:07   Math and and hook "say"
Reply With Quote #1

Hey.

I was looking for plugin, which is - math examples, and who first write right sum *do something*.
But I didn't find.

Code:
Spoiler


I want to get from client right sum, then do something (in the comments of code explained)

Can you explain me it please?

Last edited by chickez; 07-06-2020 at 11:28. Reason: solved
chickez is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-04-2020 , 04:00   Re: Math and get integer from clcmd "say"
Reply With Quote #2

Hook say(with register_clcmd), read the arguments(the chat message) and process it to get the sum.
__________________
HamletEagle is offline
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 07-05-2020 , 04:58   Re: Math and get integer from clcmd "say"
Reply With Quote #3

I changed code a little.

Spoiler


This doesn't work. Error:
Code:
Error: Argument type mismatch (argument 2) on line 29
Warning: Symbol is assigned a value that is never used: "sum" on line 33
What's wrong? Why it doesn't get the sum?
chickez is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-05-2020 , 06:10   Re: Math and get integer from clcmd "say"
Reply With Quote #4

You have a lot of mistakes in that code. I suggest you dearch how to use read_argv, str_to_num, equal correctly and what they do.

Give it one more try. If you can't figure it out I'll show you the correct way.
__________________

Last edited by HamletEagle; 07-05-2020 at 06:10.
HamletEagle is offline
condoriano90
Member
Join Date: May 2020
Old 07-05-2020 , 06:53   Re: Math and get integer from clcmd "say"
Reply With Quote #5

nevermind

Last edited by condoriano90; 07-05-2020 at 06:54.
condoriano90 is offline
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 07-05-2020 , 07:32   Re: Math and get integer from clcmd "say"
Reply With Quote #6

Okey, i think, i know how to use read_argv(). So str_to_num doesn't know, if i'm right.

What about equali? It is for compare two strings. So I must use num_to_str for equali?

I tried this:
Spoiler


It's compiled without errors or warnings. I tried it on server, but when I wrote anything, it called func. When I predicted right sum, it's called "You're right!".
chickez is offline
chickez
Junior Member
Join Date: Jun 2020
Location: Slovakia
Old 07-05-2020 , 11:55   Re: Math and get integer from clcmd "say"
Reply With Quote #7

Okey, I was coding all day long.

I did it, i think.

Spoiler


It's working. But, if something is wrong, can you tell me what?
Thanks.

Last edited by chickez; 07-06-2020 at 11:29. Reason: a
chickez is offline
Reply


Thread Tools
Display Modes

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 05:33.


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