i need little help :(
#1

How do i make this, when your family taken control the turf, all of members should be given a money. HOW??

Код:
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 of 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

Create a loop and give the players that are on the team money with the give player money function.
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Create a loop and give the players that are on the team money with the give player money function.
like

for new i bla bla bla
if[pay bla bla bla
giveplayermoney ?
Reply
#4

pawn Код:
for(new i = 0; i <MAX_PLAYERS; i++)
            {
            if(FamilyInfo[fam][FamilyName] == FamilyInfo[i][FamilyName])
            {
             //give the money and the score here
             }
             }
Reply
#5

Quote:
Originally Posted by Eth
Посмотреть сообщение
pawn Код:
for(new i = 0; i <MAX_PLAYERS; i++)
            {
            if(FamilyInfo[fam][FamilyName] == FamilyInfo[i][FamilyName])
            {
             //give the money and the score here
             }
             }
this will work if they won the capture?
Reply
#6

yes it will be like that:
pawn Код:
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
        {
            for(new i = 0; i <MAX_PLAYERS; i++)
            {
            if(FamilyInfo[fam][FamilyName] == FamilyInfo[i][FamilyName])
            {
             //give the money and the score here
             }
             }
            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 of 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;
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)