/getall command help
#1

Hello.
I scripted this command "/getall" to bring all the players to me, But when i use it, It only counts, It doesn't bring them to me, Can someone fix it and post it fixed here ?


Код:
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);
 GetAllHere(playerid);
  CountDownVar = time + 1;
    CountDownTimer = SetTimer("CountDown", 1000, true);
 format(string,sizeof(string),"%s(%d) has used /getall", PlayerName(playerid),playerid);
 SendALogMessage(string);
 return 1;
}
Reply
#2

pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(Player, i)
{
    if(i != playerid)
        SetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
}
This should do the work. Add it to your function "GetAllHere" or directly in the command.
Reply
#3

Quote:
Originally Posted by dominik523
Посмотреть сообщение
pawn Код:
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(Player, i)
{
    if(i != playerid)
        SetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
}
This should do the work. Add it to your function "GetAllHere" or directly in the command.
Man, Add GetPlayerPos(playerid, pos....) and if(i != playerid) to my /getall command and post it here.
I make a lot mistakes in adding it. (sorry, newbie)
Reply
#4

FAST PLEASE!
Can someone add [spoiler]new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
foreach(Player, i)
{
if(i != playerid)
SetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
}[/spoiler] to this ? [spoiler]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);
GetAllHere(playerid);
CountDownVar = time + 1;
CountDownTimer = SetTimer("CountDown", 1000, true);
format(string,sizeof(string),"%s(%d) has used /getall", PlayerName(playerid),playerid);
SendALogMessage(string);
return 1;
}[/spoiler] ??
Reply
#5

This is without any timers.
pawn Код:
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];
 new Float:Pos[3];
 GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
 foreach(Player, i)
 {
    if(i != playerid)
        SetPlayerPos(i, Pos[0] + 1, Pos[1] + 1, Pos[2]); // you could add some value to your position and make it higher every time through the loop
 }
   
 format(string,sizeof(string),"%s(%d) has used /getall", PlayerName(playerid),playerid);
 SendALogMessage(string);
 return 1;
}
Reply
#6

Thanks, Lock please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)