How to make this. - 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: How to make this. (
/showthread.php?tid=123795)
How to make this. -
~Dangun! - 27.01.2010
How can i make something like.. If Team 1 has more points than Team 2, Team 1 will win.
Example:
Team 1: 302
Team 2: 136
Team 1 wins because it has more points
Re: How to make this. -
philmckrakin - 27.01.2010
ok i hope this helps a bit if you have any questions just pm me or reply here
Код:
// abovemain with global vars
#define GAMETIME 10//this munber is in minuites NOT miliseconds
new Team1Kills;//these count +1 per kill
new Team2Kills;//these count +1 per kill
//inside OnGamemodeInit
SetTimer("EndGame",GAMETIME*1000,0);//this is a timer that you might already have to end the gamemode
//inside OnPlayerDeath
if(gTeam[killerid] == TEAM_1)
{
Team1Kills++;//counting kills for team 1
}
if(gTeam[killerid] == TEAM_2)
{
Team2Kills++;//counting kills for team 2
}
forward EndGame();
public EndGame()//end of the game messages to inform player it is over
{
if(Team1Kills > Team2Kills)
{
GameTextForAll("~g~~h~Team 1 Wins!",5000,5);
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(gTeam[i] == TEAM_1)
{
GivePlayerMoney(playerid,<whatever_you_want_here>);
}
}
}
else if(Team2Kills > Team1Kills)
{
GameTextForAll("~g~~h~Team 1 Wins!",5000,5);
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(gTeam[i] == TEAM_2)
{
GivePlayerMoney(playerid,<whatever_you_want_here>);
}
}
}
SetTimer("Goodbye"3000,0);
}
forward GoodBye();
public GoodBye()
{
GamemodeExit();//exit the gamemode
}
happy scripting /phil
Re: How to make this. -
~Dangun! - 27.01.2010
This might work ^^. Going to test it soon. will reply if it works.