Will be given +1 on all members when they win from something how? (+rep)
#1

Hello!!!

How do i give tokens to ALL FAMILY MERMBERS who won the capture?, +1 tokens,

for example your family 1 won the capture and all of members of family 1 will get +1 tokens,

Variables
Код:
PlayerInfo[playerid][pTokens]
Код:
forward CaptureTimerEx(point);
public CaptureTimerEx(point)
{
	new string[128];
	new fam;
	if(Points[point][TakeOverTimerStarted])
	{
		fam = Points[point][ClaimerTeam];
		if(Points[point][TakeOverTimer] > 0)
		{
			Points[point][TakeOverTimer]--;
			//format(string, sizeof(string), "%s has successfully attempted to take over of %s for %s, it will be theirs in %d minutes!",
			//Points[point][PlayerNameCapping], Points[point][Name], FamilyInfo[fam][FamilyName], Points[point][TakeOverTimer]);
			//UpdateDynamic3DTextLabelText(Points[point][CaptureProccess], COLOR_YELLOW, string);
		}
		else
		{
			Points[point][ClaimerTeam] = INVALID_PLAYER_ID;
			Points[point][TakeOverTimer] = 0;
			Points[point][TakeOverTimerStarted] = 0;
			Points[point][Announced] = 0;
			Points[point][Vulnerable] = NEW_VULNERABLE;
			//DestroyDynamic3DTextLabel(Points[point][CaptureProccess]);
			Points[point][CaptureProccessEx] = 0;
			strmid(Points[point][Owner], FamilyInfo[fam][FamilyName], 0, 32, 32);
			strmid(Points[point][CapperName], Points[point][PlayerNameCapping], 0, 32, 32);
   			format(string, sizeof(string), "%s has taken control the %s for %s.", Points[point][CapperName], Points[point][Name], Points[point][Owner]);
			SendClientMessageToAllEx(COLOR_YELLOW, string);
			UpdatePoints();
			KillTimer(Points[point][CaptureTimerEx2]);
			Points[point][CaptureTimerEx2] = -1;
		}
	}
}
Thanks in advance!!
Reply
#2

help
Reply
#3

help
Reply
#4

How do u get to which family the player belong to
Reply
#5

what do u mean? lol
Reply
#6

How do u get the players family
Reply
#7

Put this before
pawn Код:
Points[point][ClaimerTeam] = INVALID_PLAYER_ID;
It should be like this:


pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(PlayerInfo[i][pFMember] == Points[point][ClaimerTeam])
   {
       PlayerInfo[i][pTokens] = PlayerInfo[i][pTokens] + 1;
   }
}
Reply
#8

Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(PlayerInfo[i][pFMember] == fam)
   {
       PlayerInfo[i][pTokens] = PlayerInfo[i][pTokens] + 1;
   }
}
Looking at your code I think this would be more correct than what Stanford suggested above. Although both can in concept work.
Reply
#9

Quote:
Originally Posted by oliverrud
Посмотреть сообщение
Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
   if(PlayerInfo[i][pFMember] == fam)
   {
       PlayerInfo[i][pTokens] = PlayerInfo[i][pTokens] + 1;
   }
}
Looking at your code I think this would be more correct than what Stanford suggested above. Although both can in concept work.
hey,

I tried that but it gives me error at this line
Код:
if(PlayerInfo[i][pFMember] == fam)
It says "Undefined symbol pFMember" something like that then i try to change it into "pGang" then it doesnt give +1 token,

Thanks in advance!
Reply
#10

Quote:
Originally Posted by Trynda
Посмотреть сообщение
hey,

I tried that but it gives me error at this line
Код:
if(PlayerInfo[i][pFMember] == fam)
It says "Undefined symbol pFMember" something like that then i try to change it into "pGang" then it doesnt give +1 token,

Thanks in advance!
Define "pFMember" in your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)