SA-MP Forums Archive
Need Help Guys. Really Need Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need Help Guys. Really Need Help (/showthread.php?tid=126361)



Need Help Guys. Really Need Help - yoan103 - 08.02.2010

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)


Re: Need Help Guys. - Faraday - 08.02.2010

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.


Re: Need Help Guys. - yoan103 - 08.02.2010

But how can i "Loop" through all players


Re: Need Help Guys. Really Need Help - Kanji_Suzuki - 08.02.2010



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


Re: Need Help Guys. Really Need Help - yoan103 - 08.02.2010

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


Re: Need Help Guys. Really Need Help - Kanji_Suzuki - 08.02.2010

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