AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   [AMXX] Calculator v1.2.0 (https://forums.alliedmods.net/showthread.php?t=172415)

Larcyn 11-20-2011 06:32

[AMXX] Calculator v1.2.0
 
7 Attachment(s)
[AMXX] Calculator

Information:
A simple calculator with the four main operators. Pretty useless, but fun.

Addition
Subtraction
Multiplication
Division

Changelog:
v1.0.0 - Initial release
v1.0.1 - Optimized (Thanks to Korxu)
v1.1.0 - Added chat support (How to use tutorial in SMA)
v1.1.1 - Optimized
v1.2.0 - Optimized & Added new Chat code (Thanks to Sylwester & Fysiks)

Screenshot:
http://tidsresenaren.creftan.com/calc.png


If you have any code suggestions please post them below.

ConnorMcLeod 11-20-2011 06:54

Re: [AMXX] Calculator
 
Add chat support would be cool.

Like someone writes :

Calc : 3 * 5 + 3

Print 18

Calc : 3 * ( 5 + 3 )

Print 24

Sylwester 11-20-2011 07:13

Re: [AMXX] Calculator
 
That's not something a beginner can do.

Korxu 11-20-2011 07:40

Re: [AMXX] Calculator
 
PHP Code:

if(iPlayerOperator[iPlayer] == 0)
        
client_print(iPlayerprint_chat"[AMXX] Result: %i"Value[iPlayer][1] + Value[iPlayer][2])
        
    else if(
iPlayerOperator[iPlayer] == 1)
        
client_print(iPlayerprint_chat"[AMXX] Result: %i"Value[iPlayer][1] - Value[iPlayer][2])
        
    else if(
iPlayerOperator[iPlayer] == 2)
        
client_print(iPlayerprint_chat"[AMXX] Result: %i"Value[iPlayer][1] * Value[iPlayer][2])
        
    else if(
iPlayerOperator[iPlayer] == 3)
         
client_print(iPlayerprint_chat"[AMXX] Result: %.2f"float(Value[iPlayer][1]) / float(Value[iPlayer][2])) 

:arrow::arrow:
PHP Code:

    switch ( iPlayerOperator iPlayer ] )
    {
        case 
0:
        {
            
client_print iPlayerprint_chat"[AMXX] Result: %i"Value iPlayer ] [ ] + Value iPlayer ] [ ] )
        }
        
        case 
1:
        {
            
client_print iPlayerprint_chat"[AMXX] Result: %i"Value iPlayer ] [ ] - Value iPlayer ] [ ] )
        }
        
        case 
2:
        {
            
client_print iPlayerprint_chat"[AMXX] Result: %i"Value iPlayer ] [ ] * Value iPlayer ] [ ] )
        }
        
        case 
3:
        {
            
client_print iPlayerprint_chat"[AMXX] Result: %.2f"float Value iPlayer ] [ ] ) / float Value iPlayer ] [ ] ) )
        }
    } 


ConnorMcLeod 11-20-2011 08:00

Re: [AMXX] Calculator
 
Quote:

Originally Posted by Sylwester (Post 1599605)
That's not something a beginner can do.

Then this plugin is useless, faster to switch on windows and to use calculator :)

m0skVi4a 11-20-2011 09:10

Re: [AMXX] Calculator
 
LOL
Nice plugin :)

FOUTA 11-20-2011 09:24

Re: [AMXX] Calculator
 
press WINDOWS KEY + R
type calc

you will get your calculator :D isnt it faster???

Larcyn 11-20-2011 09:36

Re: [AMXX] Calculator
 
@ConnorMcLeod
I'll try to add that feature soon.

@Korxu
Thanks for that, updated.

@FOUTA
Well, that's true. But it was meant to be possible while playing CS.

FOUTA 11-20-2011 15:20

Re: [AMXX] Calculator
 
Quote:

Originally Posted by Larcyn (Post 1599682)
@ConnorMcLeod
I'll try to add that feature soon.

@Korxu
Thanks for that, updated.

@FOUTA
Well, that's true. But it was meant to be possible while playing CS.

I play my cs in a window, so when i launch RUN, it doesnt get out of cs :D simple

Napoleon_be 11-21-2011 03:57

Re: [AMXX] Calculator
 
nice plugin larcyn;


All times are GMT -4. The time now is 13:58.

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