1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

KAG Adding an intro message to a server

Discussion in 'Server Help' started by an_obamanation, May 28, 2016.

Thread Status:
Not open for further replies.
  1. an_obamanation

    an_obamanation The boss Donator

    Messages:
    392
    Vans and I need some help with servers once again, this time in terms of setting up a little rules message. We want to set up a message that states the rules of our server as soon as someone joins (Similiar to FUN ctf) but we have no clue how to set that up. We would post it in the description of the server but the description space is too small. How could we go about setting up a little intro message or possibly increasing the size of the description space? All help appreciated!
     
  2. bunnie

    bunnie Haxor Tester

    Messages:
    1,319
    should go into Modding
     
  3. an_obamanation

    an_obamanation The boss Donator

    Messages:
    392
    It can only be done through modding? Vans said it could be done without mods. Damn. Well hope we can get some more help anyway. Thanks :D
     
  4. bunnie

    bunnie Haxor Tester

    Messages:
    1,319
    it probably could get done by things like Kscript2 or KTMC, but they don't work for now (but asumagic is making an alternative so i could get ranks on Iko). And it's modding too, it just doesn't make the server get marked blue.
     
    an_obamanation likes this.
  5. Eluded

    Eluded Haxor Official Server Admin

    Messages:
    132
    If you just want a message to appear in the chat box when a new player joins (so only they can see it), then that is quite easy.

    Make a new mod folder in your Mods directory called "WelcomeMsg" or something. Then add "WelcomeMsg" to your mods.cfg file on a new line.
    Inside the WelcomeMsg folder, add a new script "WelcomeMsg.as" containing the following:

    void onInit(CRules@ this) {
    client_AddToChat("Hello new player!", SColor(255,0,0,255);
    }

    This script uses the 'onInit' hook, which is called the first time a script is loaded.
    Change "Hello new player!" to whatever you want your welcome message to be. The SColor object is what the color of the message will be. You can change this too - it uses Alpha/Red/Green/Blue format.

    Assuming your server is a CTF server, then you want to add this script to the list of scripts associated with the CTF gamemode for it to be run. To do this, create "WelcomeMsg/Rules/CTF" and then copy "Base/Rules/CTF/gamemode.cfg" into it. Add the name of the new WelcomeMsg.as script to the scripts section. It will look like this:

    # config file for game rules
    # rules name: CTF
    # rules description:

    teams = team1.cfg; team2.cfg;

    gamemode_name = CTF
    gamemode_info = Capture the Flag

    scripts = KAG.as;
    CTF.as;
    CTF_Interface.as;
    CTF_Trading.as;
    UseFakeTechs.as;
    SpawnFish.as;
    TeamMenu.as;
    CTF_GiveSpawnItems.as;
    KillMessages.as;
    JoinCoreHooks.as;
    DefaultBalanceTeams.as;
    CoreHooks.as;
    CTF_PickSpawn.as;
    ChatCommands.as;
    TimeToEnd.as;
    RestartAfterShortPostGame.as;
    FanfareOnWin.as;
    PlayerCamera.as;
    DefaultScoreboard.as;
    Editor.as;
    RedBarrier.as;
    SpawnImmunity.as;
    BasicHelps.as;
    ShowTipOnDeath.as;
    VoteCore.as;
    DefaultVotes.as;
    KickAFK.as;
    ExtraNoBuild.as;
    WaterDecaysDoors.as;
    NoSwears.as;
    Holiday.as;
    WelcomeMsg.as; # I've just added this new script

    # 1 day = X minutes; / 0 no cycle
    daycycle_speed = 0

    # 0.0 midnight; 0.5 - midday; 1.0 midnight
    daycycle_start = 0.5

    # team allocation is smart in this gamemode
    autoassign_teams = no

    auto_bots = no

    playerrespawn_seconds = 5.0
    nearspawn_multiplier = 1.0
    switch_teams_onrestart = no

    death_points = 0
    kill_points = 10
    selfkill_points = -25

    attackdamage_modifier = 0.5
    friendlydamage_modifier = 0.0

    # map resources
    mapresource_thickstone = 4
    mapresource_stone = 2
    mapresource_tree = 6
    mapresource_arrow = 1
    mapresource_gold = 2
    # end map resources

    restartmap_onlastplayer_disconnect = yes
    mirrormap = yes

    coins_death_drop_percentage = 30
    coins_damage_enemy = 5
    coins_build_percentage = 10
    coins_bomb_cost = 20
    coins_arrows_cost = 1
    coins_heal_cost = 2
    coins_unit_cost = 50

    room_config =

    waiting_for_respawn_message = "Wait to spawn...";

    support_factor = 50
    support_added_vertical = 0
    support_cost_castle = 10
    support_cost_wood = 2

    map_fire_update_ticks = 7

    That should be all you need.

    Or are you thinking of a box that pops up on screen like Wizard Wars has?
    [​IMG]
     
    kaizokuroof likes this.
  6. an_obamanation

    an_obamanation The boss Donator

    Messages:
    392
    I was more thinking like wizard wars but honestly that other way works much better for us. Thanks a lot man, I'll get vans on it when he gets back online. Yaaaay rules, now I don't have to warn everybody about stuff. :>
     
  7. makmoud98

    makmoud98 You are already DEAD Forum Moderator Staff Alumni Tester

    Messages:
    586
    problem solved, locking thread
     
    an_obamanation likes this.
Thread Status:
Not open for further replies.