Team spawns
#1

I made a timer. What the timer does is it freezes everyone for a while and resets everything. But the only problem is that I have 2 teams, RED and BLUE. I need them to respawn in their specific area. But mostly they end up at the same position. How can I 'choose' only RED team to be in his spawnpoint and BLUE team in their spawn?
Reply
#2

Without any code to build upon or look at, it's difficult to aid you much! The process itself is very simple however, simply check their team id prior to spawning them and set their spawn data appropriately.
Reply
#3

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Without any code to build upon or look at, it's difficult to aid you much! The process itself is very simple however, simply check their team id prior to spawning them and set their spawn data appropriately.
Код:
public turaskeiciasi(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
	TogglePlayerControllable(i,1);
	ResetPlayerWeapons(i);
	ResetPlayerMoney(i);
	GivePlayerMoney(i,100);
	SetPlayerArmour(i,0);
	SetPlayerHealth(i,100);
	GivePlayerWeapon(i,22,300);
	PlayerPlaySound(i,1098,0,0,0);
	SetPlayerInterior(i,3);
	SetPlayerPos(i,2495.8982,-1707.8923,1014.7422);
	SetPlayerColor(i,COLOR_BLUE);
   	SetPlayerInterior(i,6);
	SetPlayerPos(i,2343.0278,-1064.3197,1049.0234);
	SetPlayerColor(i,0xFF000090);
    SetTimer("turasbaigsis", 55000, false);
	redscore = 0;
	bluescore = 0;
    if(turas == 1)
    {
    turas = 2;
    }
    if(turas == 2)
    {
	turas = 1;
    }
    }
    }
	return 1;
}
Here's my code. I removed some useless things because they obviously don't work. I believe the problem is that the id is for every player on the server, and I need help making an id for BLUE and RED teams. Can you show me how to do it?
Reply
#4

Bumpin'.
Reply
#5

Код:
if(IsPlayerConnected(i))
    {
	TogglePlayerControllable(i,1);
	ResetPlayerWeapons(i);
	ResetPlayerMoney(i);
	GivePlayerMoney(i,100);
	SetPlayerArmour(i,0);
	SetPlayerHealth(i,100);
	GivePlayerWeapon(i,22,300);
	PlayerPlaySound(i,1098,0,0,0);
	SetPlayerInterior(i,3);
	SetPlayerPos(i,2495.8982,-1707.8923,1014.7422);
	SetPlayerColor(i,COLOR_BLUE);
   	SetPlayerInterior(i,6);
	SetPlayerPos(i,2343.0278,-1064.3197,1049.0234);
	SetPlayerColor(i,0xFF000090);
    SetTimer("turasbaigsis", 55000, false);
	redscore = 0;
	bluescore = 0;
    if(turas == 1)
    {
    turas = 2;
    }
    if(turas == 2)
    {
	turas = 1;
    }
    }
    }
	return 1;
}
This is wrong man. You need to specify your players first in a team! Now both team will spawn at one place!
Reply
#6

Quote:
Originally Posted by Vinninho
Посмотреть сообщение
Код:
if(IsPlayerConnected(i))
    {
	TogglePlayerControllable(i,1);
	ResetPlayerWeapons(i);
	ResetPlayerMoney(i);
	GivePlayerMoney(i,100);
	SetPlayerArmour(i,0);
	SetPlayerHealth(i,100);
	GivePlayerWeapon(i,22,300);
	PlayerPlaySound(i,1098,0,0,0);
	SetPlayerInterior(i,3);
	SetPlayerPos(i,2495.8982,-1707.8923,1014.7422);
	SetPlayerColor(i,COLOR_BLUE);
   	SetPlayerInterior(i,6);
	SetPlayerPos(i,2343.0278,-1064.3197,1049.0234);
	SetPlayerColor(i,0xFF000090);
    SetTimer("turasbaigsis", 55000, false);
	redscore = 0;
	bluescore = 0;
    if(turas == 1)
    {
    turas = 2;
    }
    if(turas == 2)
    {
	turas = 1;
    }
    }
    }
	return 1;
}
This is wrong man. You need to specify your players first in a team! Now both team will spawn at one place!
Yeah, and I don't know how to do it.
Reply
#7

Well, this is what happens when someone connects to your server.

I would suggest you to make a dialog, so people can choose their team. Once they chose their team, you can set their spawn place. (And it wont get bugged). That's how I did it man.
Reply
#8

Quote:
Originally Posted by Vinninho
Посмотреть сообщение
Well, this is what happens when someone connects to your server.

I would suggest you to make a dialog, so people can choose their team. Once they chose their team, you can set their spawn place. (And it wont get bugged). That's how I did it man.
You can already choose a team. I already made them, now I just want to know how to set different positions for BLUE team and RED team after the time runs out (I already made the timer and everything is ok except the position change). But is there a command that respawns a player?
Reply
#9

Quote:
Originally Posted by siemka321
Посмотреть сообщение
You can already choose a team. I already made them, now I just want to know how to set different positions for BLUE team and RED team after the time runs out (I already made the timer and everything is ok except the position change). But is there a command that respawns a player?
OH nevermind! I managed to fix this. Thanks man, you just gave me a little hint. I looked up for a respawn function and found it, I noticed that in the OnPlayerSpawn it is set that if you are on blue team you spawn there and if you are RED then you spawn there. Everyting works now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)