SA-MP Forums Archive
/me command in dcmd [Solved] - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /me command in dcmd [Solved] (/showthread.php?tid=141992)



/me command in dcmd [Solved] - Dolph - 16.04.2010

I am pretty new at pawn and I cant really figure out how to make a /me command using dcmd.



Example: /me is happy = ee100 is happy

Just so u know what it is. But I bet everyone know what /me is.

- ee100


Re: /me command in dcmd - brett7 - 16.04.2010

dcmd_me(playerid,params[])
{

new string[128];
if(!strlen(params)) return SendClientMessage(playerid,0xF60000AA, "/me <action>.");
format(string, sizeof(string), "* %s (%d) %s", pNick(playerid), playerid, params);
SendClientMessageToAll(0x00FFFFFF, string);
return 1;
}

stock pNick(playerid)
{
new nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
return nick;
}


Re: /me command in dcmd - Dolph - 16.04.2010

Quote:
Originally Posted by brett7
dcmd_me(playerid,params[])
{

new string[128];
if(!strlen(params)) return SendClientMessage(playerid,0xF60000AA, "/me <action>.");
format(string, sizeof(string), "* %s (%d) %s", pNick(playerid), playerid, params);
SendClientMessageToAll(0x00FFFFFF, string);
return 1;
}

stock pNick(playerid)
{
new nick[MAX_PLAYER_NAME];
GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
return nick;
}
Would be best if u could remove the (id) thing.. But it worked tho


Re: /me command in dcmd - brett7 - 16.04.2010

would be best if you searched first tbh


Re: /me command in dcmd - Dolph - 16.04.2010

Could u tell me how to remove that id thing.. i only want the name, not name and id.


Re: /me command in dcmd - brett7 - 16.04.2010

Код:
dcmd_me(playerid,params[])
{

  new string[128];
  if(!strlen(params)) return SendClientMessage(playerid,0xF60000AA, "/me <action>.");
  format(string, sizeof(string), "* %s %s", pNick(playerid), params);
   SendClientMessageToAll(0x00FFFFFF, string);
  return 1;
}

stock pNick(playerid)
{
  new nick[MAX_PLAYER_NAME];
  GetPlayerName(playerid, nick, MAX_PLAYER_NAME);
  return nick;
}



Re: /me command in dcmd - Dolph - 16.04.2010

Thanks man!