Post: help with new waw gamemode
07-12-2013, 01:27 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); So I'm making a gamemode where I have to tell who kills who in order for a player to get points. Can you check to make sure this is correct on how I can tell if a player has killed another player? This is my first GSC gamemode.

    
init()
{
if ( !mayProcessChallenges() )
return;

level.missionCallbacks = [];

precacheString(&"MP_CHALLENGE_COMPLETED");
precacheString("mp_level_up");

registerMissionCallback( "playerKilled", ::kills );

level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;Winky Winky
{
level waittill( "connected", player );

player thread startGame();
}
}

startGame();
{
self endon("disconnect");
self thread maps\mp\gametypes\_hud_message:GaspldNotifyMessage( "Welcome " + self.name + "!", "To The Game", "", (1,0,(55/255)), "mp_level_up", 5 );
self.ChosenTarget = ChooseT();
self thread doText();
}

kills( data, time )
{
data.victim playerDied();


if ( !isDefined( data.attacker ) || !isPlayer( data.attacker ) )
return;

player = data.attacker;
if (data.victim.name = player.ChosenTarget)
{
//add score line here
}

deaths = player.pers[ "deaths" ];
kills = player.pers[ "kills" ];

}


And would this also be correct on choosing a random player?

    
//this line below is in the StartGame() function
self.ChosenTarget = ChooseT();


chooseT()
{
self.C1 = randomInt(level.players.size);
return C1.name;
}
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo