#include a-samp
#include foreach
#include sscanf2
#define TEAM_ZERO 0
#define TEAM_ONE 1
new Text:TextDraw[2],syncstring[512];
forward sync();
ModeInit()
{
SetTimer("sync",1000,true);
TeamTextDraw[0]=TextDrawCreate(coords,"_~n~");
TeamTextDraw[1]=TextDrawCreate(coords,"_~n~");
return 1;
}
public OnPlayerSpawn(....)
{
if(....)
{
SetPlayerTeam(playerid,TEAM_ZERO);
TextDrawShowForPlayer(playerid,TextDraw[0]);
}
else
{
SetPlayerTeam(playerid,TEAM_ONE);
TextDrawShowForPlayer(playerid,TextDraw[1]);
}
return 1;
}
public sync()
{
foreach(Player,i)
{
if(GetPlayerTeam(i)==0)
{
format(syncstring,sizeof(syncstring),"TEAM ZERO IDS~n~%d~n~",i);
TextDrawSetString(TextDraw[0],syncstring);
}
else if(GetPlayerTeam(i)==1)
{
format(syncstring,sizeof(syncstring),"TEAM ONE IDS~n~%d~n~",i);
TextDrawSetString(TextDraw[1],syncstring);
}
return 1;
}
public sync()
{
new ids[64][2];
foreach(Player,i)
{
switch(GetPlayerTeam(i))
{
case 0 .. 1:
{
format(ids[i], 64,"%d~n~%s", i, ids[i]);
}
}
}
format(syncstring,sizeof(syncstring),"TEAM ZERO IDS~n~%s~n~",ids[0]);
TextDrawSetString(TextDraw[0],syncstring);
format(syncstring,sizeof(syncstring),"TEAM ONE IDS~n~%s~n~",ids[1]);
TextDrawSetString(TextDraw[1],syncstring);
return 1;
}
public sync()
{
new ids[64][2];
foreach(Player,i)
{
switch(GetPlayerTeam(i))
{
case 0 .. 1:
{
format(ids[i], 64,"%d~n~%s", i, ids[i]);
}
}
}
format(syncstring,sizeof(syncstring),"TEAM ZERO IDS~n~%s~n~",ids[0]);
TextDrawSetString(TextDraw[0],syncstring);
format(syncstring,sizeof(syncstring),"TEAM ONE IDS~n~%s~n~",ids[1]);
TextDrawSetString(TextDraw[1],syncstring);
}
return 1;
}
public sync()
{
new ids[64][2];
switch(GetPlayerTeam(i))
{
case 0 :
format(ids[0], 64,"%d~n~%s", i, ids[0]);
}
case 1:
{
format(ids[1], 64,"%d~n~%s", i, ids[1]);
}
}
}
format(syncstring,sizeof(syncstring),"TEAM ZERO IDS~n~%s~n~",ids[0]);
TextDrawSetString(TextDraw[0],syncstring);
format(syncstring,sizeof(syncstring),"TEAM ONE IDS~n~%s~n~",ids[1]);
TextDrawSetString(TextDraw[1],syncstring);
}
return 1;
}
|
Okay I will try.. but how to make team 0 ids visible only for them?
|
if(GetPlayerTeam(playerid))==0)TextDrawHideForPlayer(playerid,TeamText[1]); if(GetPlayerTeam(playerid))==1)TextDrawHideForPlayer(playerid,TeamText[0]);
ShowPlayerDialog(playerid,DIALOG_TEAM_SWITCH,DIALOG_STLYE_LIST,"Please pick up your team","Team Zero\nTeam One","Select","");
|
Yes there are two "if"
Код:
if(GetPlayerTeam(playerid))==0)TextDrawHideForPlayer(playerid,TeamText[1]); if(GetPlayerTeam(playerid))==1)TextDrawHideForPlayer(playerid,TeamText[0]); When a player spawns, Код:
ShowPlayerDialog(playerid,DIALOG_TEAM_SWITCH,DIALOG_STLYE_LIST,"Please pick up your team","Team Zero\nTeam One","Select",""); |