Xxsource98 Posted August 17, 2017 Share Posted August 17, 2017 Script for godmode? in c++ Link to comment Share on other sites More sharing options...
ikt Posted August 17, 2017 Share Posted August 17, 2017 What the hell, you already asked it here. You should probably start with the basics of programming first before trying to make a trainer. The natives for enabling god mode are: PLAYER::SET_PLAYER_INVINCIBLE ENTITY::SET_ENTITY_INVINCIBLE The documentation should also provide some pointers for the alternative god modes. Link to comment Share on other sites More sharing options...
Xxsource98 Posted August 17, 2017 Author Share Posted August 17, 2017 Sorry man, but i dont know what is bad on this code : if (sample_godmode) { if (GET_PLAYER_INVINCIBLE(PLAYER_PED_ID())) SET_PLAYER_INVINCIBLE(PLAYER_PED_ID(), 1); else SET_PLAYER_INVINCIBLE(PLAYER_PED_ID(), 1); return; } Link to comment Share on other sites More sharing options...
sollaholla Posted August 18, 2017 Share Posted August 18, 2017 (edited) if (sample_godmode) { if (GET_PLAYER_INVINCIBLE(PLAYER_PED_ID())) SET_PLAYER_INVINCIBLE(PLAYER_PED_ID(), 1); else SET_PLAYER_INVINCIBLE(PLAYER_PED_ID(), 1); return; } Bruh, your code says (in english): "If the player is invincible, set him as invincible. If the player is not invincible, set him as invincible." See how that makes no sense? Also, you're asking us "but i dont know what is bad on this code". How are we supposed to know either? Edited August 18, 2017 by sollaholla Link to comment Share on other sites More sharing options...
ikt Posted August 18, 2017 Share Posted August 18, 2017 (edited) if (sample_godmode) { if (GET_PLAYER_INVINCIBLE(PLAYER_PED_ID())) SET_PLAYER_INVINCIBLE(PLAYER_PED_ID(), 1); else SET_PLAYER_INVINCIBLE(PLAYER_PED_ID(), 1); return; } Bruh, your code says (in english):"If the player is invincible, set him as invincible. If the player is not invincible, set him as invincible." See how that makes no sense? Also, you're asking us "but i dont know what is bad on this code". How are we supposed to know either? That code is supposed to be in a selectable/toggleable option in some menu framework. The first condition should probably turn off invincibility. If you go back to earlier posts from this person you see quite clearly that he's trying to use some "menu" base (as in trainer) but doesn't quite understand the basics of programming/scripting... Edited August 18, 2017 by ikt sollaholla 1 Link to comment Share on other sites More sharing options...
fwiskalicious Posted August 18, 2017 Share Posted August 18, 2017 (edited) This was written two years ago; For MAFIN's Menu Base (which is what you're using, I guess): bool GodBoolOn = 0;bool GodBoolOff = 0;AddLocal("God Mode", GET_PLAYER_INVINCIBLE(PLAYER_ID()), GodBoolOn, GodBoolOff);if (GodBoolOn){ SET_ENTITY_INVINCIBLE(PLAYER_PED_ID(), TRUE); return;}else if (GodBoolOff){ SET_ENTITY_INVINCIBLE(PLAYER_PED_ID(), FALSE); return;} Also, format your text properly when posting here. Edited August 18, 2017 by blah265 Xxsource98 1 Link to comment Share on other sites More sharing options...
Xxsource98 Posted August 18, 2017 Author Share Posted August 18, 2017 I do this by loop method now, but thanks And sorry for this spam guys XD im idiot, i know. 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