Give score to all players in team?
#1

Heey guys,
I made a zone capture with a timer and in the timer you get 5 score if you take the zone.
But how can i give 1 score to all players in a team.
I use gTeam[playerid].
Reply
#2

pawn Код:
stock GiveTeamScore(gTeamVariable, scoreamount)
{
    for(new i; i < MAX_PLAYERS; i++) if(gTeam[i] == gTeamVariable) SetPlayerScore(i, GetPlayerScore(i) + scoreamount);
    return 1;
}
There ya go.
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
pawn Код:
stock GiveTeamScore(gTeamVariable, scoreamount)
{
    for(new x; x < MAX_PLAYERS; x++) if(gTeam[i] == gTeamVariable) SetPlayerScore(i, GetPlayerScore(i) + scoreamount);
    return 1;
}
There ya go.
Thanks dude but i get 2 errors:
Код:
C:\Users\Brandon\Desktop\GTA San Andreas\filterscripts\ladmin4v2.pwn(7029) : error 017: undefined symbol "i"
C:\Users\Brandon\Desktop\GTA San Andreas\filterscripts\ladmin4v2.pwn(7029) : error 017: undefined symbol "i"
Reply
#4

Quote:
Originally Posted by admigo
Посмотреть сообщение
Thanks dude but i get 2 errors:
Код:
C:\Users\Brandon\Desktop\GTA San Andreas\filterscripts\ladmin4v2.pwn(7029) : error 017: undefined symbol "i"
C:\Users\Brandon\Desktop\GTA San Andreas\filterscripts\ladmin4v2.pwn(7029) : error 017: undefined symbol "i"
OOps, fixed, it's late here.
Reply
#5

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
OOps, fixed, it's late here.
How can i fix this then?
Reply
#6

he edited his last post,,, read that..
Reply
#7

Ooh lol didnt saw that. Thanks dude!
I want team chat to.
How can i do that?
Reply
#8

Quote:
Originally Posted by admigo
Посмотреть сообщение
Ooh lol didnt saw that. Thanks dude!
I want team chat to.
How can i do that?
pawn Код:
SendTeamMessage(teamid, color, const message[])
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && gTeam[i] == teamid)
        {
            SendClientMessage(i, color, message);
        }
    }
}
Reply
#9

pawn Код:
public OnPlayerCommandText(playerid, text[])
{
    if(text[0] == '#') //Change # to another character if you want
    {
        new string[180], pname[24];
        GetPlayerName(playerid, pname, 24);
        format(string, sizeof(string), "%s: %s", pname, text[1]);
        for(new i; i < MAX_PLAYERS; i++) if(gTeam[playerid] == gTeam[i]) SendClientMessage(i, -1, string);
    }    
    return 1;
}
Give that a go.
Reply
#10

Omg Thanks dude!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)