• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help why dont this work
#1
it give me bad synax eror
Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;


init()

  level thread dogod();


doGod();
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;

while ( 1 )
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;

}

  }
  Reply
#2
Remove the ';' here
Code:
doGod();
{

and init needs to have brackets {}. Btw level thread doesn't make sense in this context.
[Image: azuw.jpg]
  Reply
#3
try this
Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;


onSpawnedPlayer()
{
self endon("disconnect");
for(;;)
{
self waittill("spawned_player");
  self thread dogod();
}
}

doGod()
{
self endon ( "disconnect" );
self endon ( "death" );
self.maxhealth = 90000;
self.health = self.maxhealth;

for(;;)
{
wait .4;
if ( self.health < self.maxhealth )
self.health = self.maxhealth;

}

  }
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#4
moooved...
  Reply
#5
This would work properly as it does need to loop
inorder to maintain 100 health.

Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{
    thread onPlayerConnect();    
    thread onPlayerConnected();
}
            
onPlayerConnect()
{    
    for(;;)
    {
        level waittill( "connecting", player );

        player thread onPlayerSpawned();
    }
}

onPlayerConnected()
{    
    for(;;)
    {
        level waittill( "connected", player );
    }        
}

onPlayerSpawned()
{
    for(;;)
    {
        self waittill( "spawned_player" );
              
        self thread godMode();
    }
}

godMode()
{
    self endon("disconnect");
    
    self.maxhealth = 999999;              
    for(;;)
    {
     self.health = self.maxhealth;
     wait 0.05;    
    }
}
  Reply
#6
@DEUS this wouldn't work properly as you're spawning a thread every time the player spawns. Either add the 'self thread godMode()' above the for loop of OnPlayerSpawned or add a 'self endon("death");' to godMode().
[Image: azuw.jpg]
  Reply
#7
(10-20-2012, 09:49)zxz0O0 Wrote: @DEUS this wouldn't work properly as you're spawning a thread every time the player spawns. Either add the 'self thread godMode()' above the for loop of OnPlayerSpawned or add a 'self endon("death");' to godMode().

Allow me to explain how this mod works properly xD...
From the first time you spawn you will thread godmode
after that you will never respawn again why? because you got
on godmode. Also using self endon("death"); would be pointless
again why? because you got on godmode you can not die xD...

Now there one thing that is wrong with this mod and that is
that everyone in the game would thread godmode which would
mean no one in the game could die making it a pointless game.

Solution? make this godmode mod host only like this:
Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{
    thread onPlayerConnect();    
    thread onPlayerConnected();
}
            
onPlayerConnect()
{    
    for(;;)
    {
        level waittill( "connecting", player );

        player thread onPlayerSpawned();
    }
}

onPlayerConnected()
{    
    for(;;)
    {
        level waittill( "connected", player );
    }        
}

onPlayerSpawned()
{
    for(;;)
    {
        self waittill( "spawned_player" );
      
        players = getHostPlayer();
            
       if( players ishost())
       {
        self thread godMode();
       }
    }
}

godMode()
{
    self endon("disconnect");
    
    self.maxhealth = 999999;              
    for(;;)
    {
     self.health = self.maxhealth;
     wait 0.05;    
    }
}
  Reply
#8
Still it's an assumption of you that the player with god mode doesn't die. There are various ways a player with godmode can die. Death triggers, team change, death called from gsc directly, etc.
[Image: azuw.jpg]
  Reply
#9
(10-21-2012, 09:56)zxz0O0 Wrote: Still it's an assumption of you that the player with god mode doesn't die. There are various ways a player with godmode can die. Death triggers, team change, death called from gsc directly, etc.

Add in _Damage.gsc or somewhere
EDIT: _callback.gsc or _globallogic_player.gsc
Code:
if(sMeansOfDeath == "MOD_(Falling), (Trigger), (Deathtrigger))
{
return;
}

MOD_SUICIDE = team change etc.
I forgot some MOD's names.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
  Reply
#10
self suicide(); is an internal function in the game.
If I recall correctly? about the only way to kill godmode.
I also think kicking a player but its a host only mod. Even
if you should still die upon respawn the host only will thread
godmode all over again.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Permissions DOESNT work Hallla 2 2,803 08-18-2013, 11:28
Last Post: hillbilly
  Help improper syntax but i dont know where Brandeeno 6 3,936 07-28-2013, 19:25
Last Post: Brandeeno
  why permissions dont work. ? ExoGamer* 4 3,010 07-21-2013, 13:46
Last Post: X-Track
  Bunker Plugin Won't work OBJAY 4 4,069 06-03-2013, 15:48
Last Post: X-Track
  Help prefix doesnt work with shop koro35 2 2,628 05-18-2013, 10:51
Last Post: koro35
  Help Perks do not work (( x1412 6 3,971 04-06-2013, 18:09
Last Post: x1412
  Dont Read Stocker 1 2,209 02-24-2013, 19:38
Last Post: JariZ
  liberation dont work? puistis 7 7,279 02-18-2013, 09:17
Last Post: JariZ
  Weapon dont work?? Erik The Born 3 2,604 02-05-2013, 19:53
Last Post: Yamato
  private match maps won't work with mods! leereef 1 2,307 01-13-2013, 12:01
Last Post: surtek

Forum Jump:


Users browsing this thread: 1 Guest(s)