//-------------------------[Winning Team]---------------------------------------------
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == teamid)//Replace "teamid" with the variable determinning the winning team
{
GivePlayerMoney(i,amount);//Replace "amount" with the amount of money you want to reward each team member with
}
return 1;
}
Originally Posted by Redgie
At the end of the gamemode (Whatever callback defines the end of a gamemode)
Add: pawn Код:
|
C:\DOCUME~1\mani\Desktop\Server\GAMEMO~1\Armed.pwn(402) : error 028: invalid subscript (not an array or too many subscripts): "GetPlayerTeam" C:\DOCUME~1\mani\Desktop\Server\GAMEMO~1\Armed.pwn(402) : warning 215: expression has no effect C:\DOCUME~1\mani\Desktop\Server\GAMEMO~1\Armed.pwn(402) : error 001: expected token: ";", but found "]" C:\DOCUME~1\mani\Desktop\Server\GAMEMO~1\Armed.pwn(402) : error 029: invalid expression, assumed zero C:\DOCUME~1\mani\Desktop\Server\GAMEMO~1\Armed.pwn(402) : fatal error 107: too many error messages on one line
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid,25000);
GameTextForAll("~r~Agents Win",5000,0);
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam[i] == teamid)//Replace "teamid" with the variable determinning the winning team THE ERRORS ARE ON THIS LINE!!!!
{
GivePlayerMoney(i,10000);//Replace "amount" with the amount of money you want to reward each team member with
}
}
return 1;
}
Originally Posted by Redgie
My bad sorry, GetPlayerTeam[i] should be GetPlayerTeam(i)
Updated my post |
new agents[MAX_PLAYERS];
DisablePlayerCheckpoint(playerid);
GivePlayerMoney(playerid,25000);
GameTextForAll("~r~Agents Win ~n~~r~$10000",5000,0);
agents[playerid] = 1;
Originally Posted by Tigerbeast11
Quote:
Here is the pastebin link... http://pastebin.com/m3ae232a3 P.S: How can i make it check which the winning team is? Would I use a variable like pawn Код:
And then when the that team wins... pawn Код:
Plz help me if Im wrong! |
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam[i] == teamid)//Replace "teamid" with the variable determinning the winning team
{
GivePlayerMoney(i,amount);//Replace "amount" with the amount of money you want to reward each team member with
}
return 1;
}
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && GetPlayerTeam(i) == teamid)//Notice the (i) instead of [i]
{
GivePlayerMoney(i,amount);//Replace "amount" with the amount of money you want to reward each team member with
}
return 1;
}