SA-MP Forums Archive
Trying to make /me and /do? - 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: Trying to make /me and /do? (/showthread.php?tid=145806)



Trying to make /me and /do? - lmfaoown - 04.05.2010

I'm making my own RP server, and I'm terrible at finding codes on different sources, so I need your help
How can I make a /me command?

What the /me does --> /me takes his shoes off
(NAMEHERE) takes his shoes off

[ (NAMEHERE) Text ] <-- Basic

What the /do does --> /do opens the car door
opens the car door *(NAMEHERE)*
[ Text *(NAMEHERE)* ]

I've seen all RP servers have these, can someone help?


Re: Trying to make /me and /do? - russo666 - 04.05.2010

Search. There are alot of topics like this. You will find something. And if you are scripting a RP gm you can do it easily.


Re: Trying to make /me and /do? - MWF2 - 04.05.2010

Heres a /me command


pawn Код:
if (strcmp("/me", cmdtext, true, 3) == 0)
  {
  if(strlen(cmdtext) <= 4) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /me texthere");
  return 1;
  }
  new output[200];
  GetPlayerName(playerid,pname,24);
  strmid(output,cmdtext,3,strlen(cmdtext));
  format(szstring, sizeof(szstring), "* %s(%d) - %s",pname,playerid,output);
  SendClientMessageToAll(COLOR_PINK,szstring);
  printf("%s",szstring);
  return 1;
  }



Re: Trying to make /me and /do? - lmfaoown - 04.05.2010

Quote:
Originally Posted by MWF2
Heres a /me command


pawn Код:
if (strcmp("/me", cmdtext, true, 3) == 0)
  {
  if(strlen(cmdtext) <= 4) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /me texthere");
  return 1;
  }
  new output[200];
  GetPlayerName(playerid,pname,24);
  strmid(output,cmdtext,3,strlen(cmdtext));
  format(szstring, sizeof(szstring), "* %s(%d) - %s",pname,playerid,output);
  SendClientMessageToAll(COLOR_PINK,szstring);
  printf("%s",szstring);
  return 1;
  }
Thanks a bunch, but sorry for being a noob but where should I add this? I'm fairly new to scripting in SA-MP. GameModeInIt?


Re: Trying to make /me and /do? - MWF2 - 04.05.2010

add it under

public OnPlayerCommandText(playerid,cmdtext[])


Re: Trying to make /me and /do? - lmfaoown - 04.05.2010

Quote:
Originally Posted by MWF2
add it under

public OnPlayerCommandText(playerid,cmdtext[])
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(17) : fatal error 100: cannot read from file: "dudb"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

Where can I get the dudb.inc file from? The server I downloaded (grandRP) never came with it


Re: Trying to make /me and /do? - lmfaoown - 04.05.2010

Do you know?


Re: Trying to make /me and /do? - lmfaoown - 04.05.2010

Quote:
Originally Posted by lmfaoown
Quote:
Originally Posted by MWF2
Heres a /me command


pawn Код:
if (strcmp("/me", cmdtext, true, 3) == 0)
  {
  if(strlen(cmdtext) <= 4) {
  SendClientMessage(playerid, COLOR_ERROR, "USAGE: /me texthere");
  return 1;
  }
  new output[200];
  GetPlayerName(playerid,pname,24);
  strmid(output,cmdtext,3,strlen(cmdtext));
  format(szstring, sizeof(szstring), "* %s(%d) - %s",pname,playerid,output);
  SendClientMessageToAll(COLOR_PINK,szstring);
  printf("%s",szstring);
  return 1;
  }
Thanks a bunch, but sorry for being a noob but where should I add this? I'm fairly new to scripting in SA-MP. GameModeInIt?
I add that, and I get couple errors

Код:
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(88) : error 017: undefined symbol "SetMapText"
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(167) : error 017: undefined symbol "udb_hash"
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(183) : warning 217: loose indentation
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(190) : error 017: undefined symbol "pname"
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(192) : error 017: undefined symbol "szstring"
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(192) : error 017: undefined symbol "szstring"
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(192) : error 029: invalid expression, assumed zero
C:\Users\Bijan.Bijan-PC.000\Desktop\IceCream Roleplay\gamemodes\IC-RP.pwn(192) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Errors.