В начало//
new cd_seconds;
new fos=0;
new timer1;
//В OnPlayerComandText
if(strcmp(cmdtext,"/start",true) == 0)
{
if(IsPlayerAdmin(playerid))
{
cd_seconds=3;
fos=1;
timer1 = SetTimer("CountDown",1000,3);
for(new i = 0; i < MAX_PLAYERS; i++)
{
TogglePlayerControllable(i,0);
}
SendClientMessage(playerid,COLOR_RED, "Freez on spawn on");
}
else
{
SendClientMessage(playerid,COLOR_RED, "You must be an admin for use this command");
}
return 1;
}
//------------------------------------------------------------------------------
if(strcmp(cmdtext,"/end",true) == 0)
{
if(IsPlayerAdmin(playerid))
{
fos=0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
TogglePlayerControllable(i,1);
SpawnPlayer(i);
}
SendClientMessage(playerid,COLOR_RED, "Freez on spawn off");
}
else
{
SendClientMessage(playerid,COLOR_RED, "You must be an admin for use this command");
}
return 1;
}
return 1;
}
//==============================================================================
public CountDown()
{
new msv[256];
if(cd_seconds==3)
{
format(msv,sizeof(msv),"%d",cd_seconds);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SpawnPlayer(i);
SetPlayerHealth(i,100);
GameTextForAll("~r~3",1000,6);
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
TogglePlayerControllable(i,0);
}
}
else if (cd_seconds==2)
{
format(msv,sizeof(msv),"%d",cd_seconds);
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForAll("~y~2",1000,6);
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
}
else if (cd_seconds==1)
{
format(msv,sizeof(msv),"%d",cd_seconds);
for(new i = 0; i < MAX_PLAYERS; i++)
{
GameTextForAll("~g~1",1000,6);
PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
}
}
else if (cd_seconds==0)
{
GameTextForAll("GO",1000,6);
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerConnected(i))
{
TogglePlayerControllable(i,1);
PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
}
}
}
cd_seconds--;
if (cd_seconds==-1){KillTimer(timer1);}
}
//В конце
if (fos==1)
{
TogglePlayerControllable(playerid,0);
}
return 1;
}