Freezing players when cw finishes
#1

Код:
			if(PlayerInfo[playerid][pCW] == 1)
			{
		    	TogglePlayerControllable(playerid, 0);
			SetTimer("Control", 6000,1);
		    	TogglePlayerControllable(playerid, 1);
			}
			if(PlayerInfo[playerid][pCW] == 2)
			{
		    	TogglePlayerControllable(playerid, 0);
			SetTimer("Control", 6000,1);
		    	TogglePlayerControllable(playerid, 1);
I have this stuff on when a team kills the other team 15 times, i got some test and reset stuff, What i try to do here is freeze the fighters for 6 seconds when this kills reach to 15, what do i need to change in this codepiece?
Reply
#2

Hi [V]Fuse, xD, that wont work since you have to activate the Player controllable back again only when the timer has passed right?
This shoud be like this
pawn Код:
if(PlayerInfo[playerid][pCW] == 1)
            {
                TogglePlayerControllable(playerid, 0);
            SetTimer("Control", 6000,1);
            }
            if(PlayerInfo[playerid][pCW] == 2)
            {
                TogglePlayerControllable(playerid, 0);
            SetTimer("Control", 6000,1);
public Control()
{
if(PlayerInfo[playerid][pCW] == 2 ||  PlayerInfo[playerid][pCW] == 1 )
{
TogglePlayerControllable(playerid,1);
}
And your Timer should be only once not repetitive (instead of that "1" put a "0"
Reply
#3

Nobody freezes when the round is over, i don't get what i do wrong, i did put that stuff in.
Reply
#4

Do i need a return somewhere in there?
Reply
#5

pawn Код:
for(new i; i < MAX_PLAYERS; i++)
{
    if(PlayerInfo[i][pCW] == 1)
    {
        TogglePlayerControllable(i, 0);
        SetTimer("Control", 6000, false);
    }
}
 
for(new i; i < MAX_PLAYERS; i++)
{
    if(PlayerInfo[i][pCW] == 2)
    {
        TogglePlayerControllable(i, 0);
        SetTimer("Control", 6000, false);
    }
}

public Control()
{
    for(new i; i < MAX_PLAYERS; i++)
    TogglePlayerControllable(i, 1); // 1 to allow them to move, 0 to disallow it
}
pawn Код:
if(PlayerInfo[playerid][pCW] == 2 ||  PlayerInfo[playerid][pCW] == 1 )
Why are you using this? It is completely useless as you can make a loop that unfreezes all players
Reply
#6

Thanks it works now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)