03.06.2011, 14:54
When i kill my mate from the other team, it doesnt appear on my scoreboard, someone can help?
pawn Код:
new ArmyKills;
new TerroristKills;
forward ScoreChecker(playerid);
forward ScoreUpdater(playerid);
public ScoreChecker(playerid)
{
if ( TerroristKills >= 35 ) {
if(gTeam[playerid] == TEAM_Terrorist)
{
GivePlayerMoney(playerid,1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
TerroristKills = 0 ;
ArmyKills = 0 ;
GameTextForAll ( " ~r~The Army has terminated the Terrorists" , 6000 , 5 ) ;
}
}
if ( ArmyKills >= 35 ) {
if(gTeam[playerid] == TEAM_Army)
{
GivePlayerMoney(playerid,1000);
SetPlayerScore(playerid, GetPlayerScore(playerid) + 3);
TerroristKills = 0 ;
ArmyKills = 0 ;
GameTextForAll ( " ~r~The Army has terminated the Terrorists" , 6000 , 5 ) ;
}
}
return 1;
}
public ScoreUpdater(playerid)
{
new string[ 100 ] ;
format ( string , sizeof ( string ) , " ~b~Army Kills~w~: %s " , ArmyKills ) ;
TextDrawSetString ( Textdraw0 , string ) ;
new string2 [ 100 ] ;
format ( string2 , sizeof ( string2 ) , " ~r~Terrorist Kills~w~: %s " , TerroristKills ) ;
TextDrawSetString ( Textdraw1 , string2 ) ;
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage ( killerid , playerid , reason ) ;
SetPlayerScore ( killerid , GetPlayerScore( killerid ) +1 ) ;
if ( killerid == TEAM_Army )
{
ArmyKills += 1 ;
}
if ( killerid == TEAM_Terrorist )
{
TerroristKills += 1 ;
}
return 1;
}