ItsMods

Full Version: Basic Mod
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want a mod with nothing in it. I want the init() onPlayerConnect() onPlayerSpawned() and that's it. I tried doing that myself but I got an error.
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{    
    level thread onPlayerConnect();
    level.allowupdate = true;
}

onPlayerConnect()
{
    self endon("disconnect");
    for(;;)
    {
        level waittill( "connected", player);
        player thread onPlayerSpawned();
    }
}

onPlayerSpawned()
{
    self endon("disconnect");
    for(;;)
    {
        self waittill("spawned_player");
    }
}
That should do it.
(10-31-2013, 02:42)DidUknowiPwn Wrote: [ -> ]
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;

init()
{    
    level thread onPlayerConnect();
    level.allowupdate = true;
}

onPlayerConnect()
{
    self endon("disconnect");
    for(;;)
    {
        level waittill( "connected", player);
        player thread onPlayerSpawned();
    }
}

onPlayerSpawned()
{
    self endon("disconnect");
    for(;;)
    {
        self waittill("spawned_player");
    }
}
That should do it.

That's a bit wrong.
Code:
init()
{    
    level thread onPlayerConnect();
}

onPlayerConnect()
{
    level endon("game_ended");
    for(;;)
    {
        level waittill( "connected", player);
        player thread onPlayerSpawned();
    }
}

onPlayerSpawned()
{
    self endon("disconnect");
    for(;;)
    {
        self waittill("spawned_player");
    }
}

It's better to use 'level' struct, 'self' can redirect it wrong.
Meh oh well. This is what I use for most of my script gsc's works fine. But I get what you mean.
Self is the owner of the thread, which in that case was "level". Can't redirect wrong there, luckily, so both examples work perfectly well.
Both of those scripts give me an error.
(11-01-2013, 23:55)CheeseToast Wrote: [ -> ]Both of those scripts give me an error.

Could you tell us, - which error?
lol if it's giving you an error then you're doing some wrong, are you using that base and running it? Or did you edit some stuff and then run it?
It's unknown function. I found out why I got the error it's because I need all the rank scripts that are in every mod.
...huh?
You've been overriding _rank with the blank scirpt?
._.
Pages: 1 2