//This is just part of code. new Text:SPAWN_Text[MAX_PLAYERS]; public SPAWN_MainInit() { for (new i=0;i<MAX_PLAYERS;i++) { SPAWN_Text[i]=TextDrawCreate(240.0,580.0,"Respawn in 15 sec."); TextDrawAlignment(SPAWN_Text[i],2); TextDrawFont(SPAWN_Text[i],2); TextDrawColor(SPAWN_Text[i],COLOR_LIGHTRED); TextDrawHideForAll(SPAWN_Text[i]); } } public SPAWN_Timer() { for(new i=0;i<MAX_PLAYERS;i++) { if ((SPAWN_Stat[i]==1)&&(IsPlayerConnected(i))) { TextDrawHideForPlayer(i,SPAWN_Text[i]); SPAWN_TimeLeft[i]=SPAWN_TimeLeft[i]-1; if (SPAWN_TimeLeft[i]<=0) {SPAWN_Respawn(i);return;} new a[64]; format(a,sizeof(a),"Respawn in %d sec.",SPAWN_TimeLeft[i]); TextDrawSetString(SPAWN_Text[i],a); TextDrawShowForPlayer(i,SPAWN_Text[i]); } } }
What is SPAWN_Stat and where does it get set? |
new SPAWN_Stat[MAX_PLAYERS]; new SPAWN_TimeLeft[MAX_PLAYERS]; new Text:SPAWN_Text[MAX_PLAYERS]; public SPAWN_WaitSpawn(playerid) { if (gTeam[playerid]==TEAM_SWAT) { SetPlayerPos(playerid,-1131,1058,1347); SetPlayerInterior(playerid,10); } else { SetPlayerPos(playerid,-973,1062,1348); SetPlayerInterior(playerid,10); } SetPlayerWorldBounds(playerid,-1137,-967,1101,1019); SPAWN_TimeLeft[playerid]=15; SPAWN_Stat[playerid]=1; } public SPAWN_NormSpawn(playerid) { MIS_Spawn(playerid); SPAWN_Stat[playerid]=2; } public SPAWN_Call(playerid)//Used at OnPlayerSpawn { if (SPAWN_Stat[playerid]==0) { SPAWN_WaitSpawn(playerid); SPAWN_TimeLeft[playerid]=15; SPAWN_Stat[playerid]=1; } } public SPAWN_Timer() { for(new i=0;i<MAX_PLAYERS;i++) { if ((SPAWN_Stat[i]==1)&&(IsPlayerConnected(i))) { TextDrawHideForPlayer(i,SPAWN_Text[i]); SPAWN_TimeLeft[i]=SPAWN_TimeLeft[i]-1; if (SPAWN_TimeLeft[i]<=0) {SPAWN_Respawn(i,0);return;} new a[64]; format(a,sizeof(a),"Respawn in %d sec.",SPAWN_TimeLeft[i]); TextDrawSetString(SPAWN_Text[i],a); TextDrawShowForPlayer(i,SPAWN_Text[i]); } } } public SPAWN_Death(playerid) { SPAWN_Stat[playerid]=0; } public SPAWN_Init(playerid) { SPAWN_Stat[playerid]=0; } public SPAWN_MainInit() { for (new i=0;i<MAX_PLAYERS;i++) { SPAWN_Text[i]=TextDrawCreate(240.0,580.0,"Respawn in 15 sec."); //TextDrawAlignment(SPAWN_Text[i],2); //TextDrawFont(SPAWN_Text[i],2); //TextDrawColor(SPAWN_Text[i],COLOR_LIGHTRED); TextDrawHideForAll(SPAWN_Text[i]); } } public SPAWN_Respawn(playerid,type)//0-Normal, 1-InWaitRoom { if (!IsPlayerConnected(playerid)) {return;} if (type==0) {SPAWN_NormSpawn(playerid);}else{SPAWN_WaitSpawn(playerid);} }
I'm kinda newbie to PAWNO and i have following problem:
Код:
//This is just part of code. new Text:SPAWN_Text[MAX_PLAYERS]; public SPAWN_MainInit() { for (new i=0;i<MAX_PLAYERS;i++) { SPAWN_Text[i]=TextDrawCreate(240.0,580.0,"Respawn in 15 sec."); TextDrawAlignment(SPAWN_Text[i],2); TextDrawFont(SPAWN_Text[i],2); TextDrawColor(SPAWN_Text[i],COLOR_LIGHTRED); TextDrawHideForAll(SPAWN_Text[i]); } } public SPAWN_Timer() { for(new i=0;i<MAX_PLAYERS;i++) { if ((SPAWN_Stat[i]==1)&&(IsPlayerConnected(i))) { TextDrawHideForPlayer(i,SPAWN_Text[i]); SPAWN_TimeLeft[i]=SPAWN_TimeLeft[i]-1; if (SPAWN_TimeLeft[i]<=0) {SPAWN_Respawn(i);return;} new a[64]; format(a,sizeof(a),"Respawn in %d sec.",SPAWN_TimeLeft[i]); TextDrawSetString(SPAWN_Text[i],a); TextDrawShowForPlayer(i,SPAWN_Text[i]); } } } |
public SPAWN_MainInit() { for (new i=0;i<MAX_PLAYERS;i++) { TextDrawHideForAll(SPAWN_Text[i]); } }
public OnGameModeInit() { for (new i=0;i<MAX_PLAYERS;i++) { SPAWN_Text[i]=TextDrawCreate(240.0,580.0,"Respawn in 15 sec."); TextDrawAlignment(SPAWN_Text[i],2); TextDrawFont(SPAWN_Text[i],2); TextDrawColor(SPAWN_Text[i],COLOR_LIGHTRED); } }