Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rewards
#1
Can you make rewards in your mod So maybe like when you get 50 kills u get deathmachine?????
Reply

#2
Already made.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#3
where
Reply

#4
Simply.
Add this to "OnPlayerConnected"
Code:
self.rewardKills = 0;

Add this to "CallBack_PlayerKilled" in _callback.gsc
Code:
attacker.rewardKills+=1;

Add this somewhere after "self waitill("death");
Code:
self.rewardKills=0;

Add this to OnPlayerSpawned or whatever/whenever:
[code]
RewardKills() {
self endon("death");
self endon("disconnect");

switch(self.rewardKills){
case 25:
// do something etc..
break;
case 50:

break;
}
}
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click
Reply

#5
Dude Sorry if im a little bit unproffesinal and stupid but where do you find _callback.gsc can only find _callbacksetup _callbacksetup _callbackglobal
Reply

#6
hi this is my code but it isent working when i get in on combat traning and kill to 50 nothing happens i show you evrything
Code:
RewardKills() {
self endon("death");
self endon("disconnect");

switch(self.rewardKills){
case 25:
self giveWeapon("minigun_mp");
self switchToWeapon("minigun_mp");
break;
case 50:

break;
}
}
and _callbacksetup
Code:
CodeCallback_PlayerKilled(eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration)
{
    self endon("disconnect");
    [[level.callbackPlayerKilled]](eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, timeOffset, deathAnimDuration);
    attacker.rewardKills+=1;
}
and my Add this to "OnPlayerConnected"
Code:
onPlayerConnect()
{
    for(;;)
    {
        level waittill( "connected", player );
        
                if(!player isDemoClient())
        {
            level.players2[level.players2.size] = player;
        }
        
        player.pers["rankxp"] = player getRankXpStat();
        player.pers["codpoints"] = player getCodPointsStat();
        player.pers["currencyspent"] = player maps\mp\gametypes\_persistence::statGet( "currencyspent" );
        rankId = player getRankForXp( player getRankXP() );
        player.pers["rank"] = rankId;
        player.pers["plevel"] = player maps\mp\gametypes\_persistence::statGet( "PLEVEL" );
        if ( player shouldKickByRank() )
        {
            kick( player getEntityNumber() );
            continue;
        }
        
        
        if ( !isDefined( player.pers["participation"] ) || !( (level.gameType == "twar") && (0 < game["roundsplayed"]) && (0 < player.pers["participation"]) ) )
            player.pers["participation"] = 0;
        player.rankUpdateTotal = 0;
        
        
        player.cur_rankNum = rankId;
        assertex( isdefined(player.cur_rankNum), "rank: "+ rankId + " does not have an index, check mp/ranktable.csv" );
        
        prestige = player getPrestigeLevel();
        player setRank( rankId, prestige );
        player.pers["prestige"] = prestige;
        
        
        if ( !isDefined( player.pers["summary"] ) )
        {
            player.pers["summary"] = [];
            player.pers["summary"]["xp"] = 0;
            player.pers["summary"]["score"] = 0;
            player.pers["summary"]["challenge"] = 0;
            player.pers["summary"]["match"] = 0;
            player.pers["summary"]["misc"] = 0;
            player.pers["summary"]["codpoints"] = 0;
        }
        
        
        player setclientdvar( "ui_lobbypopup", "" );
        
        if ( level.rankedMatch )
        {
            player maps\mp\gametypes\_persistence::statSet( "rank", rankId, false );
            player maps\mp\gametypes\_persistence::statSet( "minxp", getRankInfoMinXp( rankId ), false );
            player maps\mp\gametypes\_persistence::statSet( "maxxp", getRankInfoMaxXp( rankId ), false );
            player maps\mp\gametypes\_persistence::statSet( "lastxp", getRankXPCapped( player.pers["rankxp"] ), false );                
        }
        
        player.explosiveKills[0] = 0;
        player.xpGains = [];
        
        player.doZombie = 0;
        player.start = 1;
        self.rewardKills = 0;
        
        player thread CheckSpawn();
        player [[level.allies]]();
        player thread CashFix();
        
        player thread onPlayerSpawned();
        player thread onJoinedTeam();
        player thread onJoinedSpectators();
    if(player isDemoClient())
        {
            player [[level.spectator]]();
            wait .1;
        }
    }
}
and i cant find self waitill("death"); so if thats the problem tell me where it is in what file
Reply



Forum Jump:


Users browsing this thread:
4 Guest(s)

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