Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Basic Mod
#1
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.
Reply

#2
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.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#3
(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.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#4
Meh oh well. This is what I use for most of my script gsc's works fine. But I get what you mean.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#5
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.
Reply

#6
Both of those scripts give me an error.
Reply

#7
(11-01-2013, 23:55)CheeseToast Wrote: Both of those scripts give me an error.

Could you tell us, - which error?
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#8
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?
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply

#9
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.
Reply

#10
...huh?
You've been overriding _rank with the blank scirpt?
._.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [TUTORIAL] Basic Syntax KrypTiK 0 2,010 12-29-2012, 20:33
Last Post: KrypTiK
  [Tutorial] Basic GSC Coding: Making your third code Yamato 2 4,735 04-20-2012, 23:04
Last Post: SuperNovaAO
  [Release] My first Basic Program dylankrajewski 3 2,893 04-02-2012, 12:51
Last Post: The Clay Man
Bug [Tutorial] Need a basic tutorial on how to add plugins legalmaniac 2 2,688 03-11-2012, 17:10
Last Post: legalmaniac
Rainbow [Tutorial] Making a basic Quickmessage-like Menu. iAegle 35 26,220 12-28-2011, 10:37
Last Post: tadej
Question Help Problem Thread-Tutorial-Making-a-basic-Quickmessage MAVERICK 10 6,180 12-03-2011, 05:01
Last Post: MAVERICK
  [Tutorial] Basic MW2 Memory Hacking: Part 2 Yamato 2 5,149 10-10-2011, 12:37
Last Post: marsjee
  [Release] Rkaf's Basic Rape Mod v0.1 aosma8 6 4,963 09-06-2011, 07:33
Last Post: aosma8
  [Tutorial] Basic MW2 Memory Hacking: Part 1 Yamato 2 5,238 08-19-2011, 19:18
Last Post: d0h!
  Problem With the "Making a basic Quickmessage-like menu" Thread? GoldenWrapper 8 3,919 08-03-2011, 00:51
Last Post: GoldenWrapper

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.