Results 1 to 10 of 26

Thread: Standalone Airstrike CoD2

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #15
    Corporal guiismiti's Avatar
    Join Date
    Dec 2013
    Location
    Brazil
    Posts
    244
    Thanks
    121
    Thanked 42 Times in 31 Posts
    Can anybody give me a hand?

    What I'm trying to do is - enable air strike for the player when he kills 5 enemies without dying.

    - Setup() from _airstrike.gsc is being called in Callback_StartGameType() from tdm.gsc as it is instructed in the first post
    - both corrections were made (from kung foo man and goddzila)
    - in Callback_PlayerKilled from tdm.gsc I'm calling this:
    Code:
        thread maps\mp\gametypes\_addairstrike::addAirstrike(attacker);
    And this is _addairstrike.gsc:
    PHP Code:
    addAirstrike(attacker)
    {
        if(
    attacker.pers["kill_spree"] > 999)
            
    attacker.pers["kill_spree"] = 0;

        
    killcount undefined;
        
    self.pers["kill_spree"] = 0;
        
    attacker.pers["kill_spree"]++;
        
    killcount attacker.pers["kill_spree"];

        if(
    killcount == 5)
        {
            
    attacker iprintlnBold("^3Use your binoculars to call air support.");
            
    attacker thread maps\mp\gametypes\_airstrike::DoAirstrike();
        }

    The result - I can see the "Use your binoculars" message, but when I do it nothing happens.

    By the way, the console is not reporting any errors.

    Lol, instead of pressing "F" I've been pressing the regular fire button (mouse 1) all the time.

    Anyway, the code I posted is working and should allow the player to use air strike after 5 frags in a row.
    Last edited by kung foo man; 2nd September 2014 at 03:47. Reason: Merged 3 posts
    set logfile 2

Posting Permissions

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