Zero94 Posted September 5, 2012 Share Posted September 5, 2012 (edited) {$CLEO .cs}//----------MAIN-------------thread 'MONEY'ifPlayer.WantedLevel($PLAYER_CHAR) = 0else_jump @Reset_WLjump @Check_Playa:Check_Playawait 0ifPlayer.Defined($PLAYER_CHAR)else_jump @Check_Playajump @Money:Moneyif0AB0: key_pressed 78else_jump @MoneyPlayer.Money($PLAYER_CHAR) +=500000jump @Money:Reset_WLPlayer.WantedLevel($PLAYER_CHAR) = 0jump @Check_Playa I just tried to script something with my (almost nothing) knowledges. When I press N CJ will be rewarded with 500000$. The problem is when I press N nothing happens. The problem is the game crash after the loading save screen. Edited September 5, 2012 by Zero94 Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted September 5, 2012 Share Posted September 5, 2012 (edited) {$CLEO}thread 'MONEY':Check_Playawait 0if0256: player $PLAYER_CHAR defined else_jump @Check_Playaif and010F: player $PLAYER_CHAR wanted_level > 0 0AB0: key_pressed 78else_jump @Check_PlayaPlayer.Money($PLAYER_CHAR) +=500000jump @Check_Playa Edited September 5, 2012 by Michael-Knight1 Link to comment Share on other sites More sharing options...
HeresOtis Posted September 5, 2012 Share Posted September 5, 2012 {$CLEO}0000:while true wait 0 if 0256: player $PLAYER_CHAR defined then if and 810F: not player $PLAYER_CHAR wanted_level > 0 0AB0: key_pressed 78 then 0109: player $PLAYER_CHAR money += 500000 wait 250 end endend For your understanding: {$CLEO .cs}0000: NOP :Noname_2wait 0 if Player.Defined($PLAYER_CHAR)else_goto @Noname_59 if and not Player.WantedLevel($PLAYER_CHAR) > 0 Key.VirtualKeyCode(VK_KEY_N)else_goto @Noname_59 Player.Money($PLAYER_CHAR) += 500000wait 250 :Noname_59jump @Noname_2 Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted September 5, 2012 Share Posted September 5, 2012 {$CLEO}0000:while true wait 0 if 0256: player $PLAYER_CHAR defined then if and 810F: not player $PLAYER_CHAR wanted_level > 0 0AB0: key_pressed 78 then 0109: player $PLAYER_CHAR money += 500000 wait 250 end endend For your understanding: {$CLEO .cs}0000: NOP :Noname_2wait 0 if Player.Defined($PLAYER_CHAR)else_goto @Noname_59 if and not Player.WantedLevel($PLAYER_CHAR) > 0 Key.VirtualKeyCode(VK_KEY_N)else_goto @Noname_59 Player.Money($PLAYER_CHAR) += 500000wait 250 :Noname_59jump @Noname_2 small mistake... He Need if wanted level 0 , no if not wanted level 0 . 010F: player $PLAYER_CHAR wanted_level > 0 Thanks Link to comment Share on other sites More sharing options...
HeresOtis Posted September 5, 2012 Share Posted September 5, 2012 small mistake... He Need if wanted level 0 , no if not wanted level 0 . 010F: player $PLAYER_CHAR wanted_level > 0 Thanks LMAO. You're not too smart now are you. Let's have the creator of this topic confirm my script. I believe my script is correct. Mines check if the wanted level is not greater than zero, so it's equal to or less than zero. You're saying the same thing that my script is doing, but you're providing the wrong code to do it. Check yourself before you check someone else. Link to comment Share on other sites More sharing options...
Zero94 Posted September 5, 2012 Author Share Posted September 5, 2012 {$CLEO}0000:while true wait 0 if 0256: player $PLAYER_CHAR defined then if and 810F: not player $PLAYER_CHAR wanted_level > 0 0AB0: key_pressed 78 then 0109: player $PLAYER_CHAR money += 500000 wait 250 end endend For your understanding: {$CLEO .cs}0000: NOP :Noname_2wait 0 if Player.Defined($PLAYER_CHAR)else_goto @Noname_59 if and not Player.WantedLevel($PLAYER_CHAR) > 0 Key.VirtualKeyCode(VK_KEY_N)else_goto @Noname_59 Player.Money($PLAYER_CHAR) += 500000wait 250 :Noname_59jump @Noname_2 small mistake... He Need if wanted level 0 , no if not wanted level 0 . 010F: player $PLAYER_CHAR wanted_level > 0 Thanks He's right. CJ will be rewarded IF the wanted level is 0. So its expression: if and 810F: not player $PLAYER_CHAR wanted_level > 0 By the way I don't understand. I use both code syntaxes (either the simplified one than the opcodes one) and I don't know which syntax should be better. I don't write in English very well. I hope you understand me homies. By the way I'll try the code tomorrow morning, cause right now I'm on my mother's netbook. Link to comment Share on other sites More sharing options...
HeresOtis Posted September 5, 2012 Share Posted September 5, 2012 By the way I don't understand. I use both code syntaxes (either the simplified one than the opcodes one) and I don't know which syntax should be better. I don't write in English very well. I hope you understand me homies. By the way I'll try the code tomorrow morning, cause right now I'm on my mother's netbook. The top code is scripted in high-level structure/construct. It's easier to understand and keeps the script more organized. The bottom one is the top code, just the outcome of the decompiled script, which you may understand easier since you said you don't have that much coding knowledge. Link to comment Share on other sites More sharing options...
Link2012 Posted September 6, 2012 Share Posted September 6, 2012 People should stop learning from low-level. Link to comment Share on other sites More sharing options...
Zero94 Posted September 6, 2012 Author Share Posted September 6, 2012 (edited) The script works. I tried the easy-to-understand code first, and he gave me a few errors during the compiling. With the better-organized code the script worked without problems. Thanks a lot. I should read a few tutorials before attempting further attempts in scripting. Thanks again. edit: I've read the CLEO Tutorial by ZAZ (not all the thread). {$CLEO .cs}:CarBuy034A: name_thread 'CARBUY':CarBuy_10001: wait 0 msif0AB0: key_pressed 74004D: jump_if_false @CarBuy_108D4: [email protected] = create_panel_with_title 'CHEAT7' position 340.0 120.0 width 240.0 columns 1 interactive 1 background 1 alignment 008DB: set_panel [email protected] column 0 header 'CARSHOP' data 'INFERNUS' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy' 'dummy'090E: set_panel [email protected] active_row 0:CarBuy_2wait 0if0256: player $PLAYER_CHAR definedjf @CarBuy_0if00E1: key_pressed 0 15jf @CarBuy_3jump @CarBuy_0 :CarBuy_3if00E1: key_pressed 0 16jf @CarBuy_103E6: remove_text_box08D7: [email protected] = panel [email protected] active_rowif0039: [email protected] == 0jf @CarBuy_4if and00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot 663.2672 -1856.4081 5.4609 radius 1.0 1.0 1.00247: request_model #ADMIRAL:CarSpawn0001: wait 0 msif0248: model #ADMIRAL available004D: jump_if_false @CarSpawnif80FF: NOT actor $PLAYER_ACTOR 0 ()near_point_on_foot 663.2672 -1856.4081 5.4609 radius 2.0 2.0 2.0004D: jump_if_false @CarSpawn01C3: remove_references_to_car [email protected]: jump @CarBuy_2:CarBuy_4if0039: [email protected] == 1jf @CarBuy_201B6: set_weather 4jump @CarBuy_2:[email protected] == 1jf @CarBuy_208DA: remove_panel [email protected]@ == 0jump @CarBuy_2 I want to spawn a red marker where, if CJ enters in it, a menu appears and if you choose an entry (for now just one) a car will spawn and you'll pay some money for that. Edited September 6, 2012 by Zero94 Link to comment Share on other sites More sharing options...
ZAZ Posted September 6, 2012 Share Posted September 6, 2012 People should stop learning from low-level.then we should write a high level tutorialit isn't well documented in sanny help people often decompile existing scripts and have no experience in coding edit: I've read the CLEO Tutorial by ZAZ (not all the thread).your menue script have a lot of failuresyou should get more practice by writing small scripts menue script is a bit difficult for newbies, study the lesson: Interactive MENUE I want to spawn a red marker where, if CJ enters in it, a menu appears and if you choose an entry (for now just one) a car will spawn and you'll pay some money for that. The parameter 1 of the near_point opcode 00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point is displaying a red marker (sphere). If the parameter is zero 00FF: actor $PLAYER_ACTOR 0 (in-sphere)near_point does not displaying a red marker. To display a red marker in this way needs to set 0 ms as maximum in the wait code of this Loop {$CLEO .cs}:sphere034A: name_thread 'sphere':sphere_1wait 0if00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot 663.2672 -1856.4081 5.4609 radius 1.0 1.0 1.0jf @sphere_100BA: text_styled 'fem_ok' 1000 ms 4wait 1000jump @sphere_1 do you have experience in high level language? would look then in this kind {$CLEO .cs}:sphere034A: name_thread 'sphere'while truewait 0 if 00FF: actor $PLAYER_ACTOR 1 (in-sphere)near_point_on_foot 663.2672 -1856.4081 5.4609 radius 1.0 1.0 1.0 then 00BA: text_styled 'fem_ok' 1000 ms 4 wait 1000 endend CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Deji Posted September 6, 2012 Share Posted September 6, 2012 People should stop learning from low-level. then we should write a high level tutorialit isn't well documented in sanny help I was writing little something for SCR... Well, actually, I was writing a huge manual. But more on that later Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted September 6, 2012 Share Posted September 6, 2012 (edited) No Need to write high level tutorial Zaz but just people can to learning that from programming language . Anyways nice idea when you make this tutorial . But i am sure sanny builder codes is easy. Thanks Edited September 6, 2012 by Michael-Knight1 Link to comment Share on other sites More sharing options...
Bad.boy! Posted September 6, 2012 Share Posted September 6, 2012 No Need to write high level tutorial Zaz but just people can to learning that from programming language . English: Are you able to think? You're basically saying that everyone who wants to use high level code needs to learn another script/programming language. And high level is written in SB. You're language: you stupid. you say people need other programming to learn scm. and high level makes in sanny builder. Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted September 6, 2012 Share Posted September 6, 2012 (edited) No Need to write high level tutorial Zaz but just people can to learning that from programming language . English: Are you able to think? You're basically saying that everyone who wants to use high level code needs to learn another script/programming language. And high level is written in SB. You're language: you stupid. you say people need other programming to learn scm. and high level makes in sanny builder. sorry , just sorry . EDIT : i say that because i won't spam Edited September 6, 2012 by Michael-Knight1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now