Help | Checking Winner timer doesn't work.
#1

Код:
public OnActiveStartedWinnerChecking()
{
	if(activestart && activeplayers == 1)
	{
	    SendFormatMessageToAll(color_orange, message, "~ SAWN ~");
		for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && player[i][joinACT])
		{
		    SendFormatMessageToAll(color_white, message, "!%s has won", getname[i]);
		    SpawnPlayer(i);
		    GivePlayerMoney(i, activeamout);
		}
	    SendFormatMessageToAll(color_orange, message, "~ SAWN ~");
	    OnActiveStatusStop();
	}
}
Why it isn't work?
Sometimes it's make crash, and sometime it write, "! has won" (doesn't write name)

PLEASE HELP! i think there's problem with the
Код:
for(..)
Reply
#2

Please!
Reply
#3

Not sure but you can try..
pawn Код:
public OnActiveStartedWinnerChecking()
{
    if(activestart && activeplayers == 1)
    {
        SendFormatMessageToAll(color_orange, message, "~ SAWN ~");
        for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && player[i][joinACT])
        {
            if(IsPlayerConnected(i))
            {
                if(!IsPlayerNPC(i))
                {
                SendFormatMessageToAll(color_white, message, "!%s has won", getname[i]);
                SpawnPlayer(i);
                GivePlayerMoney(i, activeamout);
                }
            }
        }
        SendFormatMessageToAll(color_orange, message, "~ SAWN ~");
        OnActiveStatusStop();
    }
}
Reply
#4

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
Not sure but you can try..
pawn Код:
public OnActiveStartedWinnerChecking()
{
    if(activestart && activeplayers == 1)
    {
        SendFormatMessageToAll(color_orange, message, "~ SAWN ~");
        for(new i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && player[i][joinACT])
        {
            if(IsPlayerConnected(i))
            {
                if(!IsPlayerNPC(i))
                {
                SendFormatMessageToAll(color_white, message, "!%s has won", getname[i]);
                SpawnPlayer(i);
                GivePlayerMoney(i, activeamout);
                }
            }
        }
        SendFormatMessageToAll(color_orange, message, "~ SAWN ~");
        OnActiveStatusStop();
    }
}
Thanks, But it isn't work.
Reply
#5

Sorry about the re-post, i cannot to edit..
I fixed the crashes.
But it isn't writing name of winner:
Код:
public OnActiveStartedWinnerChecking()
{
	if(activestart && activeplayers == 1)
	{
		new i = -1;
    	for(new x; x < MAX_PLAYERS && i == -1; x++) if(IsPlayerConnected(x) && player[x][joinACT]) i = x;
	    SendFormatMessageToAll(color_orange, message, "~ дсъййод Sawn-фтймеъ д ~");
	    SendFormatMessageToAll(color_white, message, "!жлд бфтймеъ %s дщзчп", getname[i]);
	    SendFormatMessageToAll(color_orange, message, "~ дсъййод Sawn-фтймеъ д ~");
	    SpawnPlayer(i);
	    GivePlayerMoney(i, activeamout);
	    OnActiveStatusStop();
	}
}
Reply
#6

pawn Код:
public OnActiveStartedWinnerChecking()
{
    if(activestart && activeplayers == 1)
    {
        new i = -1;
        for(new x; x < MAX_PLAYERS && i == -1; x++) if(IsPlayerConnected(x) && player[x][joinACT]) i = x;
        SendFormatMessageToAll(color_orange, message, "~ a"n~u'ййоa" Sawn-фo`йi`a*u' a" ~");
        SendFormatMessageToAll(color_white, message, "%s has won!", getname[i]); // change it to what ever you want but keep '%s'
        SendFormatMessageToAll(color_orange, message, "~ a"n~u'ййоa" Sawn-фo`йi`a*u' a" ~");
        SpawnPlayer(i);
        GivePlayerMoney(i, activeamout);
        OnActiveStatusStop();
    }
}
Reply
#7

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
pawn Код:
public OnActiveStartedWinnerChecking()
{
    if(activestart && activeplayers == 1)
    {
        new i = -1;
        for(new x; x < MAX_PLAYERS && i == -1; x++) if(IsPlayerConnected(x) && player[x][joinACT]) i = x;
        SendFormatMessageToAll(color_orange, message, "~ a"n~u'ййоa" Sawn-фo`йi`a*u' a" ~");
        SendFormatMessageToAll(color_white, message, "%s has won!", getname[i]); // change it to what ever you want but keep '%s'
        SendFormatMessageToAll(color_orange, message, "~ a"n~u'ййоa" Sawn-фo`йi`a*u' a" ~");
        SpawnPlayer(i);
        GivePlayerMoney(i, activeamout);
        OnActiveStatusStop();
    }
}
Thanks, but already fixed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)