PlsGoobez Posted June 23, 2016 Share Posted June 23, 2016 #include "script.h"#include <string>#include <iostream>void textboxAddLine(std::string text, float x, float y, float scale){ UI::_SET_TEXT_ENTRY("STRING"); UI::SET_TEXT_FONT(1); UI::SET_TEXT_SCALE(scale, scale); UI::SET_TEXT_COLOUR(255, 255, 255, 255); UI::SET_TEXT_WRAP(0.0, 1.0); UI::SET_TEXT_CENTRE(false); UI::SET_TEXT_DROPSHADOW(2, 2, 0, 0, 0); UI::SET_TEXT_EDGE(1, 0, 0, 0, 205); UI::_ADD_TEXT_COMPONENT_STRING((char *)text.c_str()); UI::_DRAW_TEXT(x, y);}void update(){ if (IsKeyJustUp(VK_F7)) { textboxAddLine("Welcome to Los Santos Online!", .5, .5, .5); }}void main(){ while (true) { update(); WAIT(0); }}void ScriptMain(){ main();} I hit F7 and it does nothing. The plugin loads correctly and everything, something is up with my code. Can someone tell what's wrong? Link to comment Share on other sites More sharing options...
unknown modder Posted June 23, 2016 Share Posted June 23, 2016 _DRAW_TEXT is a per frame drawing function, so to make it appear you need to draw it every frame. instead of calling the textboxAddLine function when the key is released, make it so releasing the key toggles a bool. then in the main loop you can draw the text when the bool is TRUE PlsGoobez 1 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