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