Results 1 to 4 of 4

Thread: need help pls - mapvote / iprintlnbold / assist kills

  1. #1
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts

    need help pls - mapvote / iprintlnbold / assist kills

    hello everybody, i have 3 things to say
    first of all: i searched since a lot of weeks to solve my errors, some errors are now solved but some where i need you

    my first problem is about _mapvote.gsc (i took the classic mapvote here).
    it does not load.
    i placed the 2 threads in the gametypes:
    -thread maps\mp\gametypes\_mapvote::init(); in main()
    -maps\mp\gametypes\_mapvote::initialize(); in endmap()

    second problem is about many iprintlnbold which appears many times and in script, i writed him only 1 time. (what is the origin of the problem)?

    and the third isn't a problem, i just want to know what is called the function or script for:
    when a player help the killer to kill the zombie
    thank you to read
    ORDI
    xfire: ordi37zk

  2. #2
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    About mapvote - check if you have to turn scr_mapvote 1 or something like that. I used mapvote once and I had to enable it.
    Also, where exactly are you placing it in endmap()?

    We need to know exactly where you wrote that iprintlnbold. You gave us no information on that.

    As for the third, you're basically gonna have to edit the callbackPlayerDamage and callbackPlayerKilled functions (or whatever it's called).
    I have never checked that kind of script. I would create a new vector for each player. This vector will contain how much damage each one of the other players dealt to this player. You just gotta reset it or part of it in some occasions - like in map changes, when a player disconnects, when the player disconnects and when the player gets killed.
    set logfile 2

  3. #3
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    about the iprintlnbold() - you either have it in a loop, or you are threading to the function more than once, and therefore have several instances of the function running: it will produce more than 1 iprintlnbold(). Check to make sure you only have 1 function running.

  4. #4
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,010
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    About the assist kills, wrote that script once for zombots:

    on player damage:
    PHP Code:
    zombie utils\assist::ASSIST_add(iDamageeAttacker); 
    on player kill:
    PHP Code:
        // zombie ASSIST_do_scores();
        
        
    player zombie;
        if (
    isDefined(player.assistKills))
        {

            
    helpingHands player.assistKills.size 1;

            for (
    i=0i<player.assistKills.sizei++)
            {
                
    // assist-killer leaved...
                
    if (!isDefined(player.assistKills[i].causer))
                    continue;

                
    partDamage player.assistKills[i].damage;
                
    full player.maxhealth;
                
    percent partDamage/(full/100);

                
    //moneyForKill = mod\config::CONFIG_moneyForKill();
                
    moneyForKill zombie.points;
                
    coins moneyForKill * (percent/100);

                
    percent int(percent);
                
    coins int(coins);

                
    //player.assistKills[i].causer mod\player::addMoney(coins); // looks ugly with 1.33333, but better round it in hud-management...
                
    player.assistKills[i].causer.score++;
                
    player.assistKills[i].causer utils\money::addMoney(coins);
                
                
    //player.assistKills[i].causer iprintlnbold("^1" + percent + " ^1P^7ercent ^1o^7f ^1" + player.maxhealth + " ^1H^7ealth ^7= ^1" + coins + "^7$");
                /*
                if (player.assistKills[i].causer == attacker)
                {
                    //if (player.assistKills[i].causer isKung())
                        player.assistKills[i].causer iprintlnbold("^1K^7ILL ^1(^7"+percent+" ^1P^7ercent^1)^7! ^1H^7elping ^1H^7ands: "+helpingHands + " ^1C^7oins: ^1+^7"+coins);
                } else {
                    //if (player.assistKills[i].causer isKung())
                        player.assistKills[i].causer iprintlnbold("^1A^7SSIST-^1K^7ILL ^1(^7"+percent+" ^1P^7ercent^1)^7! ^1H^7elping ^1H^7ands: "+helpingHands + " ^1C^7oins: ^1+^7"+coins);
                }
                */
            
    }
            
    // clear them...
            
    player.assistKills undefined;
        } 
    utils/assist.gsc
    PHP Code:
    ASSIST_add(iDamageeAttacker)
    {
        
    entity self;
        
        if (
    entity.health <= 0)
        {
            
    //iprintln("entity.health <= 0");
            
    return;
        }

        
    // example 1:
        // health of zombie = 200/400
        // damage = 100
        // causedDamage = 100

        // example 2:
        // health of zombie = 200/400
        // damage = 300
        // causedDamage = 200

        
    causedDamage iDamage;
        if (
    causedDamage entity.health)
            
    causedDamage entity.health;

        
    //kung iprintln("causedDamage="+causedDamage + " iDamage="+iDamage + " enemyHealth="+player.health);

        
    if (!isDefined(entity.assistKills))
            
    entity.assistKills = [];

        
    // caused the eAttacker already an assistKill?
        
    causedAssistKill = -1// -1 = no assist kill
        
    for (i=0i<entity.assistKills.sizei++)
        {
            if (!
    isDefined(entity.assistKills[i].causer)) // left server
                
    continue;
            if (
    entity.assistKills[i].causer != eAttacker)
                continue;
            
    causedAssistKill i;
            break;

        }

        if (
    causedAssistKill == -1)
        {
            
    assistKill spawnStruct();
            
    assistKill.causer eAttacker;
            
    assistKill.damage causedDamage;
            
    entity.assistKills[entity.assistKills.size] = assistKill;
            
    //iprintlnbold("New Assistkill! Damage: "+causedDamage);
        
    } else {
            
    entity.assistKills[i].damage += causedDamage;
            
    //iprintlnbold("Added Damage! Now: "+entity.assistKills[i].damage);
        
    }

    timescale 0.01

  5. The Following 3 Users Say Thank You to kung foo man For This Useful Post:

    Ni3ls (31st January 2015),ORDI (7th February 2015),voron00 (22nd March 2016)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •