getall - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: getall (
/showthread.php?tid=555629)
Help fast!! -
aCloudy - 08.01.2015
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.
Code:
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;
}
Re: getall -
aCloudy - 08.01.2015
Anyone help please ?!
Re: getall -
danish007 - 08.01.2015
Show your CountDown public Func...
Re: getall -
aCloudy - 08.01.2015
Quote:
Originally Posted by danish007
Show your CountDown public Func...
|
Code:
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;
}
Re: getall -
aCloudy - 08.01.2015
Help fast