Sianide Posted September 3, 2011 Share Posted September 3, 2011 Just started cleo. I'm trying to create a script that displays text on cop car entry. (Attempting to create a cop mod for sa) Here's what i've got. {VERSION 0.1} {CLEO .cs} Thread 'TEXT' :Text_Enter if then 056C: actor $PLAYER_ACTOR driving_police_car enable_draw_text 1 00BA: show_text_styled GXT 'BEEFY' time 1000 style 2 // Cops SA 0.1b end Any help would be appreciated Link to comment Share on other sites More sharing options...
Panlantix Posted September 3, 2011 Share Posted September 3, 2011 (edited) You aren't defining anything in your if statement for the game to check. :Text_Enterif 056C: actor $PLAYER_ACTOR driving_police_car then enable_draw_text 1 00BA: show_text_styled GXT 'BEEFY' time 1000 style 2 // Cops SA 0.1belseend You have to have an else after the then so that the game knows what to do if the condition isn't met. It is okay to leave it blank; the game will just go on with the script. Another more common way is to do it like this: :Text_Enterif 056C: actor $PLAYER_ACTOR driving_police_car jf @NotInPoliceCar00BA: show_text_styled GXT 'BEEFY' time 1000 style 2 // Cops SA 0.1b jf stands for jump_if_false. If you do that, you would have to define a new part called :NotInPoliceCar that tells the game what to do if the player isn't in a police car. I don't recommend this for such a small script like this. I personally don't like jfs anyway because it's just weird compared to the very logical IF THEN ELSE END. Edited September 3, 2011 by Panlantix Link to comment Share on other sites More sharing options...
Sianide Posted September 4, 2011 Author Share Posted September 4, 2011 (edited) Ya i've coded C++ before so im more used to the if and else statements thanks Edited September 4, 2011 by Sianide 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