Quantcast

Jump to content

» «
Photo

godmode

6 replies to this topic
Xxsource98
  • Xxsource98

    Player Hater

  • Members
  • Joined: 16 Jun 2017
  • Poland

#1

Posted 17 August 2017 - 09:05 PM

Script for godmode?


in c++


ikt
  • ikt

    _

  • Members
  • Joined: 02 Oct 2006
  • None

#2

Posted 17 August 2017 - 09:44 PM

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.

Xxsource98
  • Xxsource98

    Player Hater

  • Members
  • Joined: 16 Jun 2017
  • Poland

#3

Posted 17 August 2017 - 10:44 PM

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;
}

sollaholla
  • sollaholla

    C# Dev.

  • Members
  • Joined: 19 May 2016
  • United-States

#4

Posted 18 August 2017 - 02:41 AM Edited by sollaholla, 18 August 2017 - 02:42 AM.

 

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?


ikt
  • ikt

    _

  • Members
  • Joined: 02 Oct 2006
  • None

#5

Posted 18 August 2017 - 09:29 AM Edited by ikt, 18 August 2017 - 09:30 AM.

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...
  • sollaholla likes this

blah265
  • blah265

    Player Hater

  • Members
  • Joined: 19 Jul 2015
  • Canada

#6

Posted 18 August 2017 - 02:42 PM Edited by blah265, 18 August 2017 - 02:45 PM.

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.

  • Xxsource98 likes this

Xxsource98
  • Xxsource98

    Player Hater

  • Members
  • Joined: 16 Jun 2017
  • Poland

#7

Posted 18 August 2017 - 07:28 PM

I do this by loop method now, but thanks ;) And sorry for this spam guys XD im idiot, i know.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users