Scoreboard
#1

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;
}
Reply
#2

BUMP!
Reply
#3

Maybe ArmyKills++;
instead of
ArmyKills += 1; ?
Reply
#4

yeah ArmyKills++ , if you know why did you post?
Reply
#5

Well, i tried it, but it still doesn't work?

Someone can help?
Reply
#6

pawn Код:
if ( killerid == TEAM_Army )
    {
        ArmyKills ++;
        return 1;
    }
And the same for terrorist
Not sure if it works, atleast worth a try
Reply
#7

Nope doesnt work :S
Reply
#8

I guess you need to make a timer that changes the score every 3000 miliseconds or something
Reply
#9

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
I guess you need to make a timer that changes the score every 3000 miliseconds or something
Nope, doesnt work also..
Reply
#10

Sumeone can help?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)