SA-MP Forums Archive
Bit Of Help! - 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: Bit Of Help! (/showthread.php?tid=186845)



Bit Of Help! - ColdXX - 30.10.2010

I made a script.I have 2 teams . A and B
I made a script to show each Team score as a textdraw!
The problem is that when a team A killed a member from team B the score for team A does not change,but when Team B kills team A the score changes!

here is the code

pawn Код:
//top of script
new Monstersscore;
new Humansscore;
new Text:scores;
pawn Код:
//onplayerdeath
if(killerid == TEAM_MONSTERS)
    {
    Monstersscore ++;
    }

    if(killerid == TEAM_HUMANS)
    {
    Humansscore ++;
    }
pawn Код:
forward ScoreUpdate(playerid);
public ScoreUpdate(playerid)
{
    new string[100];
    TextDrawHideForAll(Text:scores);
    format(string,sizeof(string),"~r~Monsters: %d \n~g~Humans: %d",Monstersscore,Humansscore);
    scores = TextDrawCreate(350.000000,10.000000,string);
    TextDrawTextSize(scores,600.000000,0.500000);
    TextDrawSetOutline(scores,1);
    TextDrawSetShadow(scores,1);
    TextDrawSetString(scores,string);
    TextDrawShowForAll(Text:scores);
}

forward ScoreCheck(playerid);
public ScoreCheck(playerid)
{
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
    if (Monstersscore >= 20) {
    Monstersscore = 0;
    Humansscore = 0;
    GameTextForAll("~r~Monsters ~g~have won",6000,5);
    SetPlayerHealth(i, 0);
    }

    if (Humansscore >= 20) {
    Monstersscore = 0;
    Humansscore = 0;
    GameTextForAll("~w~Humans ~g~have won",6000,5);
    SetPlayerHealth(i, 0);
    }
    }
}



Re: Bit Of Help! - Kitten - 30.10.2010

try

pawn Код:
if(killerid == TEAM_MONSTERS)
    {
    Monstersscore ++;
    }

    else if(killerid == TEAM_HUMANS)
    {
    Humansscore ++;
    }



Re: Bit Of Help! - ColdXX - 30.10.2010

Nope!
But ty