help me out here
#1

Im trying to get a auto team selection going and i need a way to do it iv tryied the following but it dosent work..

Код:
public OnPlayerSpawn(playerid)
{
new string[128];
new string2[128];
GetPlayerName(playerid,string);
string2 = GetPlayerID(string);
if(string2 = 1)
{
//blue
}
else if(string2 = 2)
{
//red
}

return 1;
}
iv tryed that but it hase some problens
Reply
#2

if you intend to use 2 teams only, then this may help:
Код:
public OnPlayerSpawn(playerid)
{
	if(playerid%2==0)
	{
//blue (team 0, each even playid ID will be assigned to that team)
	}
	else
	{
//red (team 1, odd IDs)
	}
	return 1;
}
if you want to make more than just 2 teams (here f.ex 3), then give hat one a try:
Код:
const MaxTeams=3;//at top of script
Код:
public OnPlayerSpawn(playerid)
{
	if(playerid%MaxTeams==0)//ID 0, 3, 6, 9, etc
	{
//Team0
	}
	else if(playerid%MaxTeams==1)//ID 1, 4, 7, 10, etc
	{
//Team1
	}
	else if(playerid%MaxTeams==2)//ID 2, 5, 8, 11, etc
	{
//Team2
	}
//here you can add more teams, if needed
	return 1;
}
Reply
#3

https://sampwiki.blast.hk/wiki/PAWN_tuto...eam_deathmatch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)