Question
#4

this should work actually... :

Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1


public OnPlayerCommandText(playerid, cmdtext[])
{
	dcmd(trace, 5, cmdtext);
	return 0;
}

dcmd_trace(playerid, params[])
{
 if(!strlen(params)){
  SendClientMessage(playerid, YOURCOLOR, "/trace [id]");
  return 1;
 }
 new pid = strval(params);
 if(!IsPlayerConnected(pid)){
  SendClientMessage(playerid, YOURCOLOR, "Player is not connected");
  return 1;
 }else{
  new string[256], name[MAX_PLAYER_NAME], Float:x, Float:y, Float:z;
  GetPlayerName(pid, name, sizeof(name));
  GetPlayerPos(pid, x, y, z);
  format(string, sizeof(string), "%s's position: %f, %f, %f", name, x, y, z);
  SendClientMessage(playerid, YOURCOLOR, string);
  }
 }
 return 1;
}
Reply


Messages In This Thread
Question - by Scriptissue - 08.10.2010, 21:18
Re: Question - by Sascha - 08.10.2010, 21:27
Re: Question - by Scriptissue - 09.10.2010, 07:19
Re: Question - by Sascha - 09.10.2010, 07:33
Re: Question - by Rachael - 09.10.2010, 07:57
Re: Question - by Sascha - 09.10.2010, 08:27
Re: Question - by Retardedwolf - 09.10.2010, 08:30
Re: Question - by Sascha - 09.10.2010, 08:34
Re: Question - by Scriptissue - 09.10.2010, 12:05
Re: Question - by Retardedwolf - 09.10.2010, 12:26

Forum Jump:


Users browsing this thread: 1 Guest(s)