Ghost_Rider3 Posted June 24, 2014 Share Posted June 24, 2014 Hi.Is there any ocpode that "see" is PLAYER_ACTOR killed any ped ,then for example draw a texture on screen. Link to comment Share on other sites More sharing options...
fastman92 Posted June 24, 2014 Share Posted June 24, 2014 Stat: 121 People you've wasted You have to read this stat in loop. Read new value, check if new value is higher than previous value. If yes, then do something, then assign a new value to variable. Untested code {$CLEO}0000: NOP:loopwait 00652: get_int_stat 121 store_to [email protected] // get new valueif001D: [email protected] > [email protected] // is new value greater than old valuegoto_if_false @loop0085: [email protected] = [email protected] // (int) ; update value of people killed in variable.// do something// draw some texturegoto @loop Ghost_Rider3 and Silent 2 Link to comment Share on other sites More sharing options...
Ghost_Rider3 Posted June 24, 2014 Author Share Posted June 24, 2014 (edited) @fastman92 Thanks,but your example don't work;i get when i want to compile unknown directive goto_if_false.I put in place of goto_if_false ,else_jump @loop;and i compiled it (now worked),but the game crash at loading screen.(i have a file named ped with texture named 1 in models/txd) This is the code: {$CLEO}0000: NOP0390: load_txd_dictionary "ped"038F: load_texture "1" as 1:loopwait 00652: get_int_stat 121 store_to [email protected] if001D: [email protected] > [email protected]else_jump @loop0085: [email protected] = [email protected]038D: draw_texture 1 position 570.0 85.0 size 133.0 23.0 RGBA 255 255 255 2550001: wait 600003F0: enable_text_draw 0 goto @loop The i made this code,and don't worked aswell: {$CLEO}0000: NOPthread 'loop'0390: load_txd_dictionary "ped"038F: load_texture "1" as 10652: get_int_stat 121 store_to [email protected] :loopwait 00652: get_int_stat 121 store_to [email protected] if001D: [email protected] > [email protected]else_jump @loop0085: [email protected] = [email protected]038D: draw_texture 1 position 570.0 85.0 size 133.0 23.0 RGBA 255 255 255 2550001: wait 600003F0: enable_text_draw 0 jump @loop Can you help me,please? Edited June 24, 2014 by Ghost_Rider3 Link to comment Share on other sites More sharing options...
Deji Posted June 24, 2014 Share Posted June 24, 2014 (edited) I preferred the first snippet (though the fact you initialised [email protected] before starting the loop in the 2nd deserves bonus credit), so I'll work from that. This is the code: {$CLEO}0000: NOP0390: load_txd_dictionary "ped"038F: load_texture "1" as 1 0652: get_int_stat 121 store_to [email protected] // good idea, the stat might not start from 0 - in which case the condition would pass immediately the first time:loopwait 00652: get_int_stat 121 store_to [email protected] if001D: [email protected] > [email protected]_jump @loop0085: [email protected] = [email protected] Logically valid so far. In fact, you could simply add this to the end and you'd have a working example of what you asked for: 0ACC: print_string "Look at me, look at me!" time 1000jump @loop In fact, it's the code you didn't ask for help for which is more concerning: 038D: draw_texture 1 position 570.0 85.0 size 133.0 23.0 RGBA 255 255 255 2550001: wait 600003F0: enable_text_draw 0 jump @loopYou should look up 03F0. Since you've not set the 03F0 flag, it could currently be anything, depending on other running scripts (including the main.scm in some cases). Really, you should use the 'enable once' mode and re-draw the texture every frame (applying the same flag each time) until you want it to disappear, because otherwise another script can change the setting and cause the draws to stack up infinitely until the game crashes or simply not show the texture at all. EDIT: And once again, GTAF loses half my post. Fixed. Edited June 24, 2014 by Deji Ghost_Rider3 1 Link to comment Share on other sites More sharing options...
Ghost_Rider3 Posted June 25, 2014 Author Share Posted June 25, 2014 Thanks fastman for helping me.I used your cod with 2nd end(with texture draw,not printstring) and the game crash at loadin screen(i have the txd file).I texted on 3 gta sa cleo version cleo 4.3.1 non modded,cleo 4.1.1 modded,cleo 4.1.1 non modded ....crash every time. 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