08.05.2012, 19:43
I have a code, what is for changing spawn after a certain time and it just doesn't work.
Here:
If you noticed the "printf" in there, it doesn't show on the console.
Here is what changed the map..
Can someone help?
Thanks.
Here:
pawn Код:
public Restart(playerid)
{
switch (CurrentMap)
{
case 0:
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1:
{
printf("Working");
new Spawn = random(sizeof(MapTwoSpawnsTeam1));
SetPlayerPos(i,MapTwoSpawnsTeam1[Spawn][0],MapTwoSpawnsTeam1[Spawn][1],MapTwoSpawnsTeam1[Spawn][2]);
SetPlayerFacingAngle(i,MapTwoSpawnsTeam1[Spawn][4]);
}
case 2:
{
new Spawn = random(sizeof(MapTwoSpawnsTeam2));
SetPlayerPos(i,MapTwoSpawnsTeam2[Spawn][0],MapTwoSpawnsTeam2[Spawn][1],MapTwoSpawnsTeam2[Spawn][2]);
SetPlayerFacingAngle(i,MapTwoSpawnsTeam2[Spawn][4]);
}
}
}
}
CurrentMap = 1; //this is map2
//Note: CurrentMap = 0; is map1
SendRconCommand("mapname Highrise");
}
case 1: //this means map2 changes to map3
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
switch (gTeam[i])
{
case 1: //case 1 is team 1
{
new Spawn = random(sizeof(MapThreeSpawnsTeam1));
SetPlayerPos(i,MapThreeSpawnsTeam1[Spawn][0],MapThreeSpawnsTeam1[Spawn][1],MapThreeSpawnsTeam1[Spawn][2]);
SetPlayerFacingAngle(i,MapThreeSpawnsTeam1[Spawn][4]);
}
case 2: //now change the positions of team2
{
new Spawn = random(sizeof(MapThreeSpawnsTeam2));
SetPlayerPos(i,MapThreeSpawnsTeam2[Spawn][0],MapThreeSpawnsTeam2[Spawn][1],MapThreeSpawnsTeam2[Spawn][2]);
SetPlayerFacingAngle(i,MapThreeSpawnsTeam2[Spawn][4]);
}
}
}
}
CurrentMap = 2;
SendRconCommand("mapname Highroof");
}
}
return 1;
}
Here is what changed the map..
pawn Код:
public CountDownTimer()
{
CountDownFromAmount--;
new string[128];
format(string, 128, "%d", CountDownFromAmount);
GameTextForAll(string, 990, 5);
printf(string);
if (CountDownFromAmount == 0)
{
GameTextForAll("End of round!!", 3000, 5);
for(new i = 0; i < MAX_PLAYERS; i++)
{
CountDownFromAmount = 603;
Restart(i);
}
}
return 1;
}
Thanks.