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.