PDA

View Full Version : getall


aCloudy
08/01/2015, 01:47 PM
Guys.
This command bring all players, But something wrong with the countdown.
If you fix it, Add to freeze the players when i use /getall and unfreeze them when the countdown finishes.


dcmd_getall(playerid, params[])
{
if(AdminLevel[playerid] < 4)return SendClientMessage(playerid,-1,"{AFAFAF}[Error]:{FFFFFF} You do not have the right admin level to use this command.");

new string[128], time;
if(sscanf(params,"d",time))
{
SendClientMessage(playerid, -1, ""COL_USAGE"[SYNTAX]{FFFFFF} /getall [TIME]");
return 1;
}
KillTimer(CountDownTimer);
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(Player, i)
{
if(i != playerid)
if(IsSpawned[i] == 1)
if(at[i] == 1)
SetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
SetPlayerArmour(i, 0);
SetPlayerHealth(i, 100);
SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
SetPlayerInterior(i, GetPlayerInterior(playerid));
}
CountDownVar = time + 1;
CountDownTimer = SetTimer("CountDown", 1000, true);
format(string,sizeof(string),"%s(%d) has circled all.", PlayerName(playerid),playerid);
SendALogMessage(string);
return 1;
}

aCloudy
08/01/2015, 01:58 PM
Anyone help please ?!

danish007
08/01/2015, 02:05 PM
Show your CountDown public Func...

aCloudy
08/01/2015, 02:24 PM
Show your CountDown public Func...

forward CountDown();
public CountDown()
{
CountDownVar--;
new str[128];

format(str, sizeof(str), "~y~%d", CountDownVar);
GameTextForAll(str, 1500, 3);
SoundForAll(1056);

if(CountDownVar == 0)
{
KillTimer(CountDownTimer);
SoundForAll(1057);
GameTextForAll("~g~~h~~h~GO!", 2000, 3);
CountDownVar = 0;
for (new i = 0; i<MAX_PLAYERS; i++)
{
if(IsAod[i] == 1) continue;
if(IsPlayerConnected(i))
{
TogglePlayerControllable(i, true);
}
}
}

return 1;
}

aCloudy
08/01/2015, 02:39 PM
Help fast