SA-MP Forums Archive
Scoreboard - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Scoreboard (/showthread.php?tid=259178)



Scoreboard - geerdinho8 - 03.06.2011

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;
}



Re: Scoreboard - geerdinho8 - 04.06.2011

BUMP!


Re: Scoreboard - geerdinho8 - 04.06.2011

Maybe ArmyKills++;
instead of
ArmyKills += 1; ?


Re: Scoreboard - xalith - 04.06.2011

yeah ArmyKills++ , if you know why did you post?


Re: Scoreboard - geerdinho8 - 06.06.2011

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

Someone can help?


Re: Scoreboard - Wesley221 - 06.06.2011

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


Re: Scoreboard - geerdinho8 - 06.06.2011

Nope doesnt work :S


Re: Scoreboard - Wesley221 - 06.06.2011

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


Re: Scoreboard - geerdinho8 - 06.06.2011

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..


Re: Scoreboard - geerdinho8 - 06.06.2011

Sumeone can help?