Post: Basic modding help
02-24-2017, 03:08 AM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So I am wanting to create a basic mod that will work with any or most custom zombies map. For the life of me I can not get my functions to work. I cant really get anything to work. There doesnt seem to be any tutorials on the matter either. I would love to see someones code that they used for a mod, so I can dissect it and learn what I am doing wrong. Im not wanting to create a map. Just a mod. Please help.
Here is the code I am using right now, or at least trying. for the life of me i can not get the basic print function to work. When I spawn into the map nothing happens. Its like the map isnt calling this script.


#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#insert scripts\shared\shared.gsh;
#namespace clientids;
REGISTER_SYSTEM( "clientids", &__init__, undefined )

function __init__()
{
callback: : on_start_gametype( &init );
callback: : on_connect( &on_player_connect );
callback: : on_spawned( &on_player_spawned );*
}
function init()
{
level.clientid = 0 ;
}
function on_player_connect()
{
self.clientid = matchRecordNewPlayer( self );
if ( !isdefined( self.clientid ) || self.clientid == -1 )
{
self.clientid = level.clientid;
level.clientid++;
}

function on_player_spawned()
{
IPrintLnBold("WELCOME");
}
Last edited by rockclimber36 ; 02-24-2017 at 03:12 AM.
03-25-2017, 06:57 PM #2
AhcPower
Save Point
    
#using scripts\codescripts\struct;
#using scripts\shared\callbacks_shared;
#using scripts\shared\system_shared;
#using scripts\shared\array_shared;
#using scripts\shared\flag_shared;

#insert scripts\shared\shared.gsh;

#namespace clientids;

REGISTER_SYSTEM( "clientids", &__init__, undefined )

function __init__()
{
callback:Gaspn_start_gametype( &init );
callback:Gaspn_connect( &on_player_connect );
callback:Gaspn_spawned( &on_player_spawned );
}

function init()
{
level.clientid = 0;
}

function on_player_connect()
{
self.clientid = matchRecordNewPlayer( self );
if ( !isdefined( self.clientid ) || self.clientid == -1 )
{
self.clientid = level.clientid;
level.clientid++;
}

}

function on_player_spawned()
{
level flag::wait_till( "initial_blackscreen_passed" );
self thread HelloWorld();
//Start your code here.
}

function HelloWorld()
{
p("Hello NGU, THIS IS WORKING!");
}

function p(message)
{
iprintln(message);
}

this how i'd do it

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo