Need Help Guys. Really Need Help
#1

I have created a /count text for all players. My question is when it's counting from 5 to 1 i want it to play a sound. Here is what i have
Код:
#include <a_samp>
forward One();
forward Two();
forward Three();
forward Four();
forward Five();
forward GoGoGo();
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/count", cmdtext, true, 10) == 0)
	{
	  SetTimer("Five", 1000, 0);
	  SetTimer("Four", 2000, 0);
	  SetTimer("Three", 3000, 0);
	  SetTimer("Two", 4000, 0);
	  SetTimer("One", 5000, 0);
	  SetTimer("GoGoGo", 6000, 0);
		return 1;
	}
	return 0;
}

public One()
{
	GameTextForAll("~r~1",2000,3);
	return 1;
}

public Two()
{
	GameTextForAll("~p~2",2000,3);
	return 1;
}

public Three()
{
	GameTextForAll("~y~3",2000,3);
	return 1;
}

public Four()
{
	GameTextForAll("~b~4",2000,3);
	return 1;
}

public Five()
{
 	GameTextForAll("~w~5",2000,3);
 	return 1;
}

public GoGoGo()
{
	GameTextForAll("~g~GO GO GO!",3000,3);
	return 1;
}
Код:
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
So i want it to play a sound on every number. I got this number's id SOUND_RACE_321 1056
but i don't know where to put it (the sounds must play for ALL players)
Reply
#2

Loop through all the players and then put PlayerPlaySound(playerid,soundid) wherever you want it to play. If you want it to play on GoGoGo put it there.
Reply
#3

But how can i "Loop" through all players
Reply
#4



Код:
public One()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    PlayerPlaySound(i,1056)
	GameTextForAll("~r~1",2000,3);
	return 1;
}

public Two()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    PlayerPlaySound(i,1056)
	GameTextForAll("~p~2",2000,3);
	return 1;
}

public Three()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    PlayerPlaySound(i,1056)
	GameTextForAll("~y~3",2000,3);
	return 1;
}

public Four()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    PlayerPlaySound(i,1056)
	GameTextForAll("~b~4",2000,3);
	return 1;
}

public Five()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    PlayerPlaySound(i,1056)
 	GameTextForAll("~w~5",2000,3);
 	return 1;
}

public GoGoGo()
{
    for(new i=0; i<MAX_PLAYERS; i++) 
    PlayerPlaySound(i,1056)
	GameTextForAll("~g~GO GO GO!",3000,3);
	return 1;
}
Note: i did not test
Reply
#5

that didn't work all i get is like 22 warnings
Код:
D:\Simple Count Down\Simple Count Down\CountDown.pwn(38) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(38) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(38) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(46) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(46) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(46) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(47) : warning 217: loose indentation
D:\Simple Count Down\Simple Count Down\CountDown.pwn(54) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(54) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(54) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(55) : warning 217: loose indentation
D:\Simple Count Down\Simple Count Down\CountDown.pwn(62) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(62) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(62) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(70) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(70) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(70) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(71) : warning 217: loose indentation
D:\Simple Count Down\Simple Count Down\CountDown.pwn(78) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(78) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(78) : warning 202: number of arguments does not match definition
D:\Simple Count Down\Simple Count Down\CountDown.pwn(80) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


22 Warnings.
yea i added this ; on player play sound because i had too many errors and now i have 22 warnings
Reply
#6

Sorry make all the
Код:
PlayerPlaySound(i,1056)
to
Код:
PlayerPlaySound(i,1056,0.0,0.0,0.0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)