dcmd_goto
#5

Quote:
Originally Posted by dice7
try strval instead of sscanf
That's not a replacement.
-------------------------------------
Код:
if(!(dini_Int(str, "AdminLevel") >= 1))
This doesn't do anything.
-------------------------------------
pawn Код:
dcmd_goto(playerid,params[])
{
  if(IsPlayerAdmin(playerid)) //your valid check
  {
    if(sscanf(params,"u",params[0])) SendClientMessage(playerid, COLOR_RED, "USAGE: /goto [playerid]");
    else if(params[0] == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "Invalid Player ID.");
    else
    {
      new Float:pos[3],pname[MAX_PLAYER_NAME],string[128]; GetPlayerPos(params[0],pos[0],pos[1],pos[2]); SetPlayerPos(playerid,pos[0]+2,pos[1]+2,pos[2]);
      GetPlayerName(playerid,pname,sizeof(pname); format(string,sizeof(string),"%s has teleported to you",pname); SendClientMessage(params[0],COLOR_RED,string);
      GetPlayerName(params[0],pname,sizeof(pname); format(string,sizeof(string),"You have teleported to %s",pname); SendClientMessage(playerid,COLOR_RED,string);
    }
  }
  else SendClientMessage(playerid, COLOR_RED, "Admins Only!");
  return 1;
}
And btw, start using zcmd.
Reply


Messages In This Thread
dcmd_goto - by GaGlets(R) - 28.02.2010, 18:39
Re: dcmd_goto - by Fabio11 - 28.02.2010, 19:15
Re: dcmd_goto - by GaGlets(R) - 28.02.2010, 19:32
Re: dcmd_goto - by dice7 - 28.02.2010, 19:35
Re: dcmd_goto - by Sergei - 28.02.2010, 19:45

Forum Jump:


Users browsing this thread: 1 Guest(s)