[REQUEST]/me command -
too803 - 07.02.2010
I know it is nooby but it is the only thing I cant seem to script for my chat script.A helpful little post would be nice
Re: [REQUEST]/me command -
mansonh - 07.02.2010
Normally
http://forum.sa-mp.com/index.php?topic=144062.0
However this is such a simple one.
pawn Код:
dcmd_me(playerid, params[])
{
new msg[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(msg,sizeof(msg),"** %s(%i): %s",pName,playerid,params);
SendClientMessageToAll(0xFFD720FF,msg);
return 1;
}
or if you don't use dcmd yet(why the hell not) strcmp version
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]){
new cmd[256];
new idx;
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/component",true) == 0)
{
new msg[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(msg,sizeof(msg),"** %s(%i): %s",pName,playerid,cmdtext);
SendClientMessageToAll(0xFFD720FF,msg);
return 1;
}
.....
}
Re: [REQUEST]/me command -
too803 - 07.02.2010
After #define and such i got these error with the bottom code
C:\Documents and Settings\Admin\Desktop\server\filterscripts\me.pwn (13) : error 033: array must be indexed (variable "cmd")
C:\Documents and Settings\Admin\Desktop\server\filterscripts\me.pwn (17) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Admin\Desktop\server\filterscripts\me.pwn (17) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\Admin\Desktop\server\filterscripts\me.pwn (17) : error 020: invalid symbol name ""
C:\Documents and Settings\Admin\Desktop\server\filterscripts\me.pwn (17) : fatal error 107: too many error messages on one line
Re: [REQUEST]/me command -
too803 - 07.02.2010
anybody?
Re: [REQUEST]/me command -
[HiC]TheKiller - 07.02.2010
Quote:
Originally Posted by [HiC
TheKiller ]
Simple Command Processor
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { new Command[100], Params[100]; if(strfind(cmdtext, " ") != -1) strmid(Command, cmdtext, 1, strfind(cmdtext, " ")); else if(strfind(cmdtext, " ") == -1) format(Command, 100, "%s", cmdtext); if(strfind(cmdtext, " ") != -1) format(Params, sizeof(Params), "%s", cmdtext[strfind(cmdtext, " ")]); #define IsParams(%1) strcmp(Params, %1) #define IsCommand(%1) strcmp(Command, %1) if(IsCommand("me")) { new Str[100]; GetPlayerName(playerid, Str, 24); format(Str, sizeof(Str), "%s: %s", Str, Params); SendClientMessageToAll(0xF5F200AA, Str); return 1; } return 0; }
|
Re: [REQUEST]/me command -
mansonh - 07.02.2010
Yah I don't normally use strcmp system, so not surprised if it gave errors, however i dragged that right out of a working script, not sure why yours went wrong.
I would either use thekillers system or dcmd.
Re: [REQUEST]/me command -
too803 - 07.02.2010
I copied and pasted that into my script and still got errors
Re: [REQUEST]/me command -
Miguel - 07.02.2010
Quote:
Originally Posted by too803
I copied and pasted.
|
You should not paste it randomly, you must know what are you doing (learn from it).
Re: [REQUEST]/me command -
mansonh - 07.02.2010
Post what you have (your onplayercommandtext) and wherever it shows errors. and of course the error messages.
Re: [REQUEST]/me command -
too803 - 07.02.2010
I pasted at the bottom,all my 5246 line has is a {