Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-08-20, 21:55


DeVa$taToR

Playmaker






Wiek: 26
Na forum: 3589 dni
Posty: 14
Nick w MP: XeRoX

Piwa: 121

Respekt: 60

Tak sobie znalaz?em kalkulator cleo, niestety nie dzia?a on do ko?ca tak, jak nale?y, wi?c wystawiam sam kod i jak kto? chce, to niech naprawi i korzysta :P

Kod:

{$CLEO}
{$INCLUDE SF}
0000: NOP
repeat
wait 50
until 0AFA: is_samp_available

0B34: samp register_client_command "cc" to_label @calculate
0AC8: 31@ = allocate_memory_size 64
0AC8: 30@ = allocate_memory_size 64
0AC8: 29@ = allocate_memory_size 64
0AC8: 28@ = allocate_memory_size 64
0AC8: 25@ = allocate_memory_size 124 //formula
0AC8: 26@ = allocate_memory_size 64 //result
27@ = 0 //27@ = switcher

0B5A: get_screen_resolution 22@ 23@
22@ /= 10
22@ *= 4
23@ /= 10
23@ *= 1

0B80: dialog 24@ = create "Calculator"
0B84: dialog 24@ set_pos_XY 22@ 23@ size 300 120
0B91: dialog 24@ add_static id 1 text "Formula" pos_XY 25 20 size 300 20
0B91: dialog 24@ add_static id 2 text "=" pos_XY 105 40 size 300 20
0B91: dialog 24@ add_static id 3 text "Result" pos_XY 25 60 size 300 20
0B86: dialog 24@ set_visible false


while true
wait 0
if 27@ == 1
then
27@ = 0
33@ = 0
0B94: dialog 24@ set_control 1 text 25@
0B94: dialog 24@ set_control 3 text 26@
0B86: dialog 24@ set_visible true
end

if 33@ > 15000
then
0B86: dialog 24@ set_visible false
end
end

:calculate
SAMP.IsCommandTyped(0@)
//
//4 numbers
//
if
0AD4: $nefolosit = 0@ format "%d%c%d%c%d%c%d" 1@ 31@ 2@ 30@ 3@ 29@ 4@
then
0AD3: 31@ = format "%c" 31@
0AD3: 30@ = format "%c" 30@
0AD3: 29@ = format "%c" 29@

0085: 5@ = 1@ // result
0085: 6@ = 2@ // num2
0085: 7@ = 3@ // num3
0093: 1@ = integer 1@ to_float
0093: 2@ = integer 2@ to_float
0093: 3@ = integer 3@ to_float
0093: 4@ = integer 4@ to_float
0093: 5@ = integer 5@ to_float
0093: 6@ = integer 6@ to_float
0093: 7@ = integer 7@ to_float
if 0AB1: @p_3 3 31@ 30@ 29@
then
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 3@ operator 30@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 4@ operator 29@ _returnedNum 5@
else
if 0AB1: @n_2 2 30@ 29@
then
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 3@ operator 30@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 4@ operator 29@ _returnedNum 5@
else
if 0AB1: @p_n 2 30@ 29@
then
0AB1: @do_maths 3 num 2@ num2 3@ operator 30@ _returnedNum 2@
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 4@ operator 29@ _returnedNum 5@
else
if 0AB1: @p_n 2 29@ 30@
then
0AB1: @do_maths 3 num 3@ num2 4@ operator 29@ _returnedNum 3@
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 3@ operator 30@ _returnedNum 5@
else
if 0AB1: @p_2 2 30@ 29@
then
0AB1: @do_maths 3 num 2@ num2 3@ operator 30@ _returnedNum 2@
0AB1: @do_maths 3 num 2@ num2 4@ operator 29@ _returnedNum 2@
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
else
0AF8: samp add_message_to_chat "Error: Unknown order of operations (the script is incorrect)" color -1
end
end
end
end
end

0AD3: 25@ = format "%.0f %s %.0f %s %.0f %s %.0f" 1@ 31@ 6@ 30@ 7@ 29@ 4@
if 0AB1: @decimal_check_result 1 5@
then
0AD3: 26@ = format "%0.4f" 5@
else
0AD3: 26@ = format "%.0f" 5@
end
27@ = 1
else
//
//3 numbers
//
if
0AD4: $nefolosit = 0@ format "%d%c%d%c%d" 1@ 31@ 2@ 30@ 3@
then
0AD3: 31@ = format "%c" 31@
0AD3: 30@ = format "%c" 30@
0085: 4@ = 1@ // result
0085: 5@ = 2@ // num2
0093: 1@ = integer 1@ to_float
0093: 2@ = integer 2@ to_float
0093: 3@ = integer 3@ to_float
0093: 4@ = integer 4@ to_float
0093: 5@ = integer 5@ to_float

if 0AB1: @p_2 2 31@ 30@
then
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@
0AB1: @do_maths 3 num 4@ num2 3@ operator 30@ _returnedNum 4@
else
if
0AB1: @no_priority 1 30@ //no
then
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@
0AB1: @do_maths 3 num 4@ num2 3@ operator 30@ _returnedNum 4@
else
0AB1: @do_maths 3 num 2@ num2 3@ operator 30@ _returnedNum 2@
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@
end
end

0AD3: 25@ = format "%.0f %s %.0f %s %.0f" 1@ 31@ 5@ 30@ 3@
if 0AB1: @decimal_check_result 1 4@
then
0AD3: 26@ = format "%0.4f" 4@
else
0AD3: 26@ = format "%.0f" 4@
end
27@ = 1
else
//
//2 numbers
//
if
0AD4: $nefolosit = 0@ format "%d%c%d" 1@ 31@ 2@
then
0AD3: 31@ = format "%c" 31@
0085: 4@ = 1@ // result
0093: 1@ = integer 1@ to_float
0093: 2@ = integer 2@ to_float
0093: 4@ = integer 4@ to_float
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@

0AD3: 25@ = format "%.0f %s %.0f" 1@ 31@ 2@
if 0AB1: @decimal_check_result 1 4@
then
0AD3: 26@ = format "%0.4f" 4@
else
0AD3: 26@ = format "%.0f" 4@
end
27@ = 1
else
printf "Usage: /cc 2+2+2+2 [ + - / x * ]" 5000
end
end
end
SAMP.CmdRet

//0AB1: @do_maths 3 num num2 operator _returnedNum
:do_maths
if 0C14: strcmp string1 2@ string2 "+"
then
005B: 0@ += 1@ // (float)
else
if 0C14: strcmp string1 2@ string2 "-"
then
0063: 0@ -= 1@ // (float)
else
if or
0C14: strcmp string1 2@ string2 "x"
0C14: strcmp string1 2@ string2 "*"
then
006B: 0@ *= 1@ // (float)
else
if 0C14: strcmp string1 2@ string2 "/"
then
0073: 0@ /= 1@ // (float)
end
end
end
end
0AB2: ret 1 0@

//if 0AB1: @ 1
:p_3
31@ = 0
if or
0C14: strcmp string1 0@ string2 "x"
0C14: strcmp string1 0@ string2 "*"
0C14: strcmp string1 0@ string2 "/"
then
31@++
end

if or
0C14: strcmp string1 1@ string2 "x"
0C14: strcmp string1 1@ string2 "*"
0C14: strcmp string1 1@ string2 "/"
then
31@++
end

if or
0C14: strcmp string1 2@ string2 "x"
0C14: strcmp string1 2@ string2 "*"
0C14: strcmp string1 2@ string2 "/"
then
31@++
end

if 31@ == 3
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0

:p_2
31@ = 0
if or
0C14: strcmp string1 0@ string2 "x"
0C14: strcmp string1 0@ string2 "*"
0C14: strcmp string1 0@ string2 "/"
then
31@++
end

if or
0C14: strcmp string1 1@ string2 "x"
0C14: strcmp string1 1@ string2 "*"
0C14: strcmp string1 1@ string2 "/"
then
31@++
end

if 31@ == 2
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0


:n_2
31@ = 0
if or
0C14: strcmp string1 0@ string2 "x"
0C14: strcmp string1 0@ string2 "*"
0C14: strcmp string1 0@ string2 "/"
then
31@++
end

if or
0C14: strcmp string1 1@ string2 "x"
0C14: strcmp string1 1@ string2 "*"
0C14: strcmp string1 1@ string2 "/"
then
31@++
end

if 31@ > 0
then
059A: return_false
else
0485: return_true
end
0AB2: ret 0


:p_n
31@ = 0
if or
0C14: strcmp string1 0@ string2 "x"
0C14: strcmp string1 0@ string2 "*"
0C14: strcmp string1 0@ string2 "/"
then
31@++
end

if or
0C14: strcmp string1 1@ string2 "x"
0C14: strcmp string1 1@ string2 "*"
0C14: strcmp string1 1@ string2 "/"
then
wait 0
else
31@++
end

if 31@ == 2
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0


//if 0AB1: @is_priority 1
:priority
if or
0C14: strcmp string1 0@ string2 "x"
0C14: strcmp string1 0@ string2 "*"
0C14: strcmp string1 0@ string2 "/"
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0

//if 0AB1: @not_priority 1
:no_priority
if or
0C14: strcmp string1 0@ string2 "x"
0C14: strcmp string1 0@ string2 "*"
0C14: strcmp string1 0@ string2 "/"
then
059A: return_false
else
0485: return_true
end
0AB2: ret 0

//if 0AB1: @decimal_check_result 1
:decimal_check_result
0092: 1@ = float 0@ to_integer
0093: 1@ = integer 1@ to_float
if or
0025: 1@ > 0@ // (float)
0025: 0@ > 1@ // (float)
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0


Aby u?y? kalkulatora, nale?y w okienku chatu wpisa? "/cc [dzia?anie]" np. "/cc 2+2".
Rozwi?zanie pojawia si? na g?rze ekranu.
Kalkulator dodaje, odejmuje, mno?y i dzieli. (+, -, x, /)

C?? jest w nim zepsutego? Wykonuje zazwyczaj p?? podanego dzia?ania, ?le odejmuje, nie ogarnia liczb ujemnych i chyba nie potrafi dzieli? x=D, wi?c mo?ecie t? wstawk? potraktowa? jako snippeta. heh.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 2 piw(a):
Jakubsoneq, NAME1337
Wysłany: 2016-08-22, 20:32


Haribo

Taki Żeluś






Wiek: 29
Na forum: 4680 dni
Posty: 224
Nick w MP: Haribo

Piwa: 2818

Respekt: 220,2
Respekt: 220,2Respekt: 220,2

Ostrzeżeń: 60%
Ma potencja?, widz? nawet mo?liwo?? wykorzystania przy eventach na ekranie typu "podaj rozwi?zanie dzia?ania".

Szkoda, ?e zbugowane. Mo?e kto? kto ogarnia CLEO we?mie si? za to? W og?le z jakiego powodu obliczenia nie s? poprawne? Kto? ?le to napisa? czy po prostu CLEO nie obs?uguje dzia?a? matematycznych?

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-22, 21:54


DeVa$taToR

Playmaker






Wiek: 26
Na forum: 3589 dni
Posty: 14
Nick w MP: XeRoX

Piwa: 121

Respekt: 60

"Haribo" napisał/a:

Ma potencja?, widz? nawet mo?liwo?? wykorzystania przy eventach na ekranie typu "podaj rozwi?zanie dzia?ania".


Mo?na z tego skorzysta?, kiedy trzeba co? policzy? na szybko, a nie chce si? odpala? windowsowego calc.exe lub bra? telefonu do r?ki, ale masz racj?. Na wielu serwerach co jaki? czas pojawia si? dzia?anie na dole ekranu.

"Haribo" napisał/a:

Szkoda, ?e zbugowane. Mo?e kto? kto ogarnia CLEO we?mie si? za to? W og?le z jakiego powodu obliczenia nie s? poprawne? Kto? ?le to napisa? czy po prostu CLEO nie obs?uguje dzia?a? matematycznych?


Kto? ?le to napisa?. Skrypt jest niedopracowany, a ja w sumie... m?g?bym si? za niego zabra?, ale nie mam zbytnio pomys?u i czasu :mrgreen:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-17, 19:23


borsuk







Wiek: 17
Na forum: 3547 dni
Posty: 468

Piwa: 15622

Respekt: 412
Respekt: 412

Ostrzeżeń: 80%
"Reus_" napisał/a:

"Ziomalloo" napisał/a:

"DeVa$taToR" napisał/a:

a ja w sumie... m?g?bym si? za niego zabra?, ale nie mam zbytnio pomys?u i czasu :mrgreen:

Takis m?dry? Kazdy tak moze powiedziec udowodnij hmm ??


jak jestes taki skrypter to zrob to w pawno skrypterze jeden..


a co do cheatu to fajny! rozwalilem nie jeden serwer na tym :)


OK zara daje kod

[ Dodano: 2016-12-17, 19:33 ]
chwila 30 min hehe

[ Dodano: 2016-12-17, 19:36 ]
Jednak sie poddaje w PAWN jest takie cos niemozliwe bo params nie obs?uguje + ,- ,/ ,* wiec sam zr?b jak chcesz :D

Ostatnio zmieniony przez ToxiC. 2016-12-18, 11:59, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-18, 10:54


NitroFuN

El Barto






Wiek: 25
Na forum: 4126 dni
Posty: 532

Piwa: 1195

Respekt: 650,5
Respekt: 650,5Respekt: 650,5

Podpis
GG: 61963221 - Discord: NitroFuN#2819


Gracz SA:MP - 2010-2019
Support Team - 26.11.2017 - 16.01.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-12-19, 12:16


borsuk







Wiek: 17
Na forum: 3547 dni
Posty: 468

Piwa: 15622

Respekt: 412
Respekt: 412

Ostrzeżeń: 80%
Sory ale pomy?ka da si? jeszcze ?atwiej format(wynik, sizeof(wynik), "Wynik to %i", params); System sam ci podzieli i reszta bo poka?e ci params czyli jak wpiszesz 2+2 to si? wpisze w formacie i si? obliczy samo ps. Dzia?a sprawdzalem zr?b to w dcmd lub zcmd najlepiej potem podam ca?y kod bo jestem na telku

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-03, 23:06


monday







Wiek: 33
Na forum: 3288 dni
Posty: 2



Respekt: 50

@DeVa$taToR

Czesc, to ja napisalem ten kod, milo ze ktos go uzywa :)
Faktycznie mod nie ogarnia liczb ujemnych aczkolwiek niezdarzylo mi sie aby podal bledny wynik odejmowania, dzielenia lub zeby przekalkulowal "pol podanego dzialania", pamietajac ze mod robi kalkulacje na maksymalnie 4 liczbach jak bylo oswiadczone w temacie w ktorym ten mod pierwotnie sie pojawil:
http://ugbase.eu/Thread-Calculator

[ Dodano: 2017-06-08, 03:33 ]
Jesli ktos jest zainteresowany to dzisiaj opublikowalem kod ktory automatycznie rozwiazuje zadania matematyczne, szczerze mowiac to nie pamietam na jakim serwerze go testowalem ale dzialal bez zarzutu

Kod:

{$CLEO}
{$INCLUDE SF}
0000:
repeat
wait 50
until 0AFA: is_samp_available
0B34: samp register_client_command "activate" to_label @activate
0BE3: raknet setup_incoming_rpc_hook @on_new_chatline

//Settings:
11@ = 0 //delay

0AC8: 31@ = allocate_memory_size 64
0AC8: 30@ = allocate_memory_size 64
0AC8: 29@ = allocate_memory_size 64
0AC8: 28@ = allocate_memory_size 64
0AC8: 25@ = allocate_memory_size 124 //formula
0AC8: 26@ = allocate_memory_size 64 //result
0AC8: 22@ = allocate_memory_size 64 //answer
27@ = 0 //27@ = switcher
0AC8: 16@ = allocate_memory_size 260 //chatline with formul


while true
wait 0
if and
27@ == 1
24@ == 1
then
24@ = 0
//0AB1: @GETCHATENTRYTEXT 1 id 99 to 0@
samp.GetChatString(99, 16@, 0, 0, 0)
//0AF8: samp add_message_to_chat 0@ color -1


//
//4 numbers
//

if or
//0AD4: $nefolosit = 0@ format "%d%c%d%c%d%c%d" 1@ 31@ 2@ 30@ 3@ 29@ 4@
0AD4: 12@ = 16@ format "{FFFFFF}[{FFBB88}»{FFFFFF}] Calculate '%d%c%d%c%d%c%d' and type /ans <answer> [Prize: $%d and %d score]" 1@ 31@ 2@ 30@ 3@ 29@ 4@ 9@ 10@
0AD4: 12@ = 16@ format "{FFFFFF}[{FFBB00}»{FFFFFF}] Calculate '%d%c%d%c%d%c%d' and type /ans <answer> [Prize: $%d and %d score]" 1@ 31@ 2@ 30@ 3@ 29@ 4@ 9@ 10@
then
0AD3: 31@ = format "%c" 31@
0AD3: 30@ = format "%c" 30@
0AD3: 29@ = format "%c" 29@

0085: 5@ = 1@ // result
0085: 6@ = 2@ // num2
0085: 7@ = 3@ // num3
0093: 1@ = integer 1@ to_float
0093: 2@ = integer 2@ to_float
0093: 3@ = integer 3@ to_float
0093: 4@ = integer 4@ to_float
0093: 5@ = integer 5@ to_float
0093: 6@ = integer 6@ to_float
0093: 7@ = integer 7@ to_float
if 0AB1: @p_3 3 31@ 30@ 29@
then
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 3@ operator 30@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 4@ operator 29@ _returnedNum 5@
else
if 0AB1: @n_2 2 30@ 29@
then
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 3@ operator 30@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 4@ operator 29@ _returnedNum 5@
else
if 0AB1: @p_n 2 30@ 29@
then
0AB1: @do_maths 3 num 2@ num2 3@ operator 30@ _returnedNum 2@
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 4@ operator 29@ _returnedNum 5@
else
if 0AB1: @p_n 2 29@ 30@
then
0AB1: @do_maths 3 num 3@ num2 4@ operator 29@ _returnedNum 3@
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
0AB1: @do_maths 3 num 5@ num2 3@ operator 30@ _returnedNum 5@
else
if 0AB1: @p_2 2 30@ 29@
then
0AB1: @do_maths 3 num 2@ num2 3@ operator 30@ _returnedNum 2@
0AB1: @do_maths 3 num 2@ num2 4@ operator 29@ _returnedNum 2@
0AB1: @do_maths 3 num 5@ num2 2@ operator 31@ _returnedNum 5@
else
0AF8: samp add_message_to_chat "Error: Unknown order of operations (the script is incorrect)" color -1
end
end
end
end
end

0AD3: 25@ = format "%.0f %s %.0f %s %.0f %s %.0f" 1@ 31@ 6@ 30@ 7@ 29@ 4@
//if 0AB1: @decimal_check_result 1 5@
//then
//0AD3: 26@ = format "%0.4f" 5@
//else
//0AD3: 26@ = format "%.0f" 5@
//end
0092: 5@ = float 5@ to_integer
0AD3: 22@ = format "/ans %d" 5@
//wait 11@
0AF9: samp say_msg 22@
else
//
//3 numbers
//
if
0AD4: 12@ = 16@ format "{FFFFFF}[{FFBB00}»{FFFFFF}] Calculate '%d%c%d%c%d' and type /ans <answer> [Prize: $%d and %d score]" 1@ 31@ 2@ 30@ 3@ 9@ 10@
then
0AD3: 31@ = format "%c" 31@
0AD3: 30@ = format "%c" 30@
0085: 4@ = 1@ // result
0085: 5@ = 2@ // num2
0093: 1@ = integer 1@ to_float
0093: 2@ = integer 2@ to_float
0093: 3@ = integer 3@ to_float
0093: 4@ = integer 4@ to_float
0093: 5@ = integer 5@ to_float

//0AD3: 25@ = format "Formula detected: %.0f %s %.0f %s %.0f" 1@ 31@ 5@ 30@ 3@
//0AF8: samp add_message_to_chat 25@ -1

if 0AB1: @p_2 2 31@ 30@
then
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@
0AB1: @do_maths 3 num 4@ num2 3@ operator 30@ _returnedNum 4@
else
if
0AB1: @no_priority 1 30@ //no
then

// 0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@

if 0C29: 15@ = string1 31@ string2 "+"
then
005B: 4@ += 2@ // (float)
else
if 0C29: 15@ = strcmp string1 31@ string2 "-"
then
0063: 4@ -= 2@ // (float)
else
if or
0C29: 15@ = string1 31@ string2 "x"
0C29: 15@ = string1 31@ string2 "*"
then
006B: 4@ *= 2@ // (float)
else
if 0C29: 15@ = string1 31@ string2 "/"
then
0073: 4@ /= 2@ // (float)
end
end
end
end

if 0C29: 15@ = string1 30@ string2 "+"
then
005B: 4@ += 3@ // (float)
else
if 0C29: 15@ = strcmp string1 30@ string2 "-"
then
0063: 4@ -= 3@ // (float)
else
if or
0C29: 15@ = string1 30@ string2 "x"
0C29: 15@ = string1 30@ string2 "*"
then
006B: 4@ *= 3@ // (float)
else
if 0C29: 15@ = string1 30@ string2 "/"
then
0073: 4@ /= 3@ // (float)
end
end
end
end


// 0AB1: @do_maths 3 num 4@ num2 3@ operator 30@ _returnedNum 4@




else
0AB1: @do_maths 3 num 2@ num2 3@ operator 30@ _returnedNum 2@
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@
end
end



//if 0AB1: @decimal_check_result 1 4@
//then
//0AD3: 26@ = format "%0.4f" 4@
//else
//0AD3: 26@ = format "%.0f" 4@
//end

//0AD3: 25@ = format "Formula detected: %.0f %s %.0f %s %.0f" 1@ 31@ 5@ 30@ 3@
//0AF8: samp add_message_to_chat 25@ -1

0092: 4@ = float 4@ to_integer
0AD3: 22@ = format "/ans %d" 4@
wait 11@
0AF9: samp say_msg 22@
//0AF8: samp add_message_to_chat 22@ -1
else
//
//2 numbers
//
if or
0AD4: 12@ = 16@ format "{FFFFFF}[{FFBB88}»{FFFFFF}] Calculate '%d%c%d' and type /ans <answer> [Prize: $%d and %d score]" 1@ 31@ 2@ 9@ 10@
0AD4: 12@ = 16@ format "{FFFFFF}[{FFBB00}»{FFFFFF}] Calculate '%d%c%d' and type /ans <answer> [Prize: $%d and %d score]" 1@ 31@ 2@ 9@ 10@
then
0AD3: 31@ = format "%c" 31@
0085: 4@ = 1@ // result
0093: 1@ = integer 1@ to_float
0093: 2@ = integer 2@ to_float
0093: 4@ = integer 4@ to_float
0AB1: @do_maths 3 num 4@ num2 2@ operator 31@ _returnedNum 4@

0AD3: 25@ = format "%.0f %s %.0f" 1@ 31@ 2@
//if 0AB1: @decimal_check_result 1 4@
//then
//0AD3: 26@ = format "%0.4f" 4@
//else
//0AD3: 26@ = format "%.0f" 4@
//end
0092: 4@ = float 4@ to_integer
0AD3: 22@ = format "/ans %d" 4@
//wait 11@
0AF9: samp say_msg 22@
else
// printf "Expected chatline is not the same as the servers' one" 5000
end
end
end
end
end


:activate
0B12: 27@ = 27@ XOR 1
if 27@ == 1
then
0AD1: show_formatted_text_highpriority "activated" time 700
else
0AD1: show_formatted_text_highpriority "deactivated" time 700
end
samp.CmdRet

:on_new_chatline
0BE5: raknet 23@ = get_hook_param PARAM_PACKETID
if 23@ == RPC_ScrClientMessage
then
24@ = 1
end
0BE0: raknet hook_ret true

:getChatEntryText
0AF7: samp 1@ = get_base
1@ += 0x212A6C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: 1 1@


//0AB1: @do_maths 3 num num2 operator _returnedNum
:do_maths
//0AF8: samp add_message_to_chat 2@ -1

if 0C29: 3@ = string1 2@ string2 "+"
then
005B: 0@ += 1@ // (float)
else
if 0C29: 3@ = strcmp string1 2@ string2 "-"
then
0063: 0@ -= 1@ // (float)
else
if or
0C29: 3@ = string1 2@ string2 "x"
0C29: 3@ = string1 2@ string2 "*"
then
006B: 0@ *= 1@ // (float)
else
if 0C29: 3@ = string1 2@ string2 "/"
then
0073: 0@ /= 1@ // (float)
else
0AF8: samp add_message_to_chat "Unrecognized uperator" -1
0AF8: samp add_message_to_chat 2@ -1
end
end
end
end
0AB2: ret 1 0@

//if 0AB1: @ 1
:p_3
31@ = 0
if or
0C29: 15@ = string1 0@ string2 "x"
0C29: 16@ = string1 0@ string2 "*"
0C29: 17@ = string1 0@ string2 "/"
then
31@++
end

if or
0C29: 15@ = string1 1@ string2 "x"
0C29: 16@ = string1 1@ string2 "*"
0C29: 17@ = string1 1@ string2 "/"
then
31@++
end

if or
0C29: 15@ = string1 2@ string2 "x"
0C29: 16@ = string1 2@ string2 "*"
0C29: 17@ = string1 2@ string2 "/"
then
31@++
end

if 31@ == 3
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0

:p_2
//0AF8: samp add_message_to_chat 0@ -1
//0AF8: samp add_message_to_chat 1@ -1

31@ = 0
if or
0C29: 15@ = string1 0@ string2 "x"
0C29: 16@ = string1 0@ string2 "*"
0C29: 17@ = string1 0@ string2 "/"
then
31@++
end

if or
0C29: 16@ = string1 1@ string2 "x"
0C29: 17@ = string1 1@ string2 "*"
0C29: 15@ = string1 1@ string2 "/"
then
31@++
end

if 31@ == 2
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0


:n_2
31@ = 0
if or
0C29: 15@ = string1 0@ string2 "x"
0C29: 16@ = string1 0@ string2 "*"
0C29: 17@ = string1 0@ string2 "/"
then
31@++
end

if or
0C29: 15@ = string1 1@ string2 "x"
0C29: 16@ = string1 1@ string2 "*"
0C29: 17@ = string1 1@ string2 "/"
then
31@++
end

if 31@ > 0
then
059A: return_false
else
0485: return_true
end
0AB2: ret 0


:p_n
31@ = 0
if or
0C29: 15@ = string1 0@ string2 "x"
0C29: 16@ = string1 0@ string2 "*"
0C29: 17@ = string1 0@ string2 "/"
then
31@++
end

if or
0C29: 15@ = string1 1@ string2 "x"
0C29: 16@ = string1 1@ string2 "*"
0C29: 17@ = string1 1@ string2 "/"
then
wait 0
else
31@++
end

if 31@ == 2
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0


//if 0AB1: @is_priority 1
:priority
if or
0C29: 15@ = string1 0@ string2 "x"
0C29: 16@ = string1 0@ string2 "*"
0C29: 17@ = string1 0@ string2 "/"
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0

//if 0AB1: @not_priority 1
:no_priority
if or
0C29: 15@ = string1 0@ string2 "x"
0C29: 16@ = string1 0@ string2 "*"
0C29: 17@ = string1 0@ string2 "/"
then
059A: return_false
else
0485: return_true
end
0AB2: ret 0

//if 0AB1: @decimal_check_result 1
:decimal_check_result
0092: 1@ = float 0@ to_integer
0093: 1@ = integer 1@ to_float
if or
0025: 1@ > 0@ // (float)
0025: 0@ > 1@ // (float)
then
0485: return_true
else
059A: return_false
end
0AB2: ret 0


Linie warte edytowania:
-te zaczynajace sie na: 0AD4: 12@ = 16@ format "{FFFFFF}[{FFBB88}»{FFFFFF}] Calculate
-te zaczynajace sie na: 0AD3: 22@ = format "/ans %d"
-komenda aktywujaca: 0B34: samp register_client_command "activate" to_label @activate

Mod byl testowany z:
-Cleo 4.1 (z 4.3 prawdopodobnie nie bedzie dzialac)
-Samp Functions 5.1 (z najnowszym tez powinien dzialac)
-SA-MP 0.3z R1 (z 0.3.7 tez powinien dzialac)

Postaw piwo autorowi tego posta
 

 
Tagi: kalkulator :: in-game :: [kod]
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » GTA SAN ANDREAS » SA: MULTIPLAYER » Cheats Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku