Team score
#1

How am I able to script team score in my script, and show it in the bottom of screen for everyone? Example there is teams Grove and Ballas. One grove player kills one Ballas, and that kill counts to overall team score. Like everytime any friendly kills enemy, it adds the score to team score.

How about score limit? Like when team has got ex. 50 score, it stops the gamemode and makes it restart from the team scores 0.

Hope you got the point.
Reply
#2

@ [HLF]Southclaw :

try this:

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
else
{
if(SetPlayerScore(killerid < 50)
{
// if it not works, please destroy this
return 1;
}
}
return 1;
}
Reply
#3

i think it is has to be this just a liitle change

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
else
{
if(SetPlayerScore(killerid) + 50)
{
// if it not works, please destroy this
return 1;
}
}
return 1;
}
i just changed this > to a plus idk if im right but i never see that symbol used for that
Reply
#4

ohh, okay thanks
Reply
#5

Quote:
Originally Posted by kman
i think it is has to be this just a liitle change

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
else
{
if(SetPlayerScore(killerid + 50)
{
// if it not works, please destroy this
return 1;
}
}
return 1;
}
i just changed this > to a plus
like wtf SetPlayerSCore aint for if's

erazor please if u don't kno about if it works or atleast if u don't know about what they are talkin about don't post which might not work.nobody is perfect but better learn before helping

At top of script:
pawn Код:
new team1score;
new team2score;
OnPlayerDeath:
pawn Код:
OnPlayerDeath(playerid,killerid,reason)
{
  SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    if(GetPlayerTeam(i) = G_TEAMBALLAS) //Change G_TEAMBALLAS to ur teamvariable u need
    { //Checks if the player is in ballas team(team 1)
        team1score++; //Sets team1score
    }
    if(GetPlayerTeam(i) = G_TEAMGROVE) //Change G_TEAMBALLAS to ur teamvariable u need
    { //Checks if the player is in grove team(team 2)
        team2score++; //Sets team2score
    }
    if(team1score == 50 || team2score == 50) //Checks if team1score OR team2score is equal to 50
    {
        SendRconCommand("gmx"); //Restarts Server
    }
    return 1;
}
to show the score u should use TExtdraws
https://sampwiki.blast.hk/wiki/TextDrawCreate

read everything about textdraws(the links in this site too)

and try it on ur own first^^
Reply
#6

Quote:
Originally Posted by ┤ŞąiBЄЯҒПŋ├
Quote:
Originally Posted by kman
i think it is has to be this just a liitle change

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
else
{
if(SetPlayerScore(killerid + 50)
{
// if it not works, please destroy this
return 1;
}
}
return 1;
}
i just changed this > to a plus
like wtf SetPlayerSCore aint for if's

erazor please if u don't kno about if it works or atleast if u don't know about what they are talkin about don't post which might not work.nobody is perfect but better learn before helping

At top of script:
pawn Код:
new team1score;
new team2score;
OnPlayerDeath:
pawn Код:
OnPlayerDeath(playerid,killerid,reason)
{
  SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
    if(GetPlayerTeam(i) = G_TEAMBALLAS) //Change G_TEAMBALLAS to ur teamvariable u need
    { //Checks if the player is in ballas team(team 1)
        team1score++; //Sets team1score
    }
    if(GetPlayerTeam(i) = G_TEAMGROVE) //Change G_TEAMBALLAS to ur teamvariable u need
    { //Checks if the player is in grove team(team 2)
        team2score++; //Sets team2score
    }
    if(team1score == 50 || team2score == 50) //Checks if team1score OR team2score is equal to 50
    {
        SendRconCommand("gmx"); //Restarts Server
    }
    return 1;
}
to show the score u should use TExtdraws
https://sampwiki.blast.hk/wiki/TextDrawCreate

read everything about textdraws(the links in this site too)

and try it on ur own first^^
since you know what your doing can you help me with my topic at http://forum.sa-mp.com/index.php?topic=128225.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)