/me command
#1

Код:
// /me command

CMD:me(playerid, params[])
{
	new action[200];
	if(sscanf(params,"s[200]", action))return SendClientMessage(playerid, 0x33CCCC,"USAGE: /me [action]");
	format(action, sizeof(action);"%s %s", GetName(playerid), action);
	SendClientMessageToAll(0x66CC33, action);
}
Код:
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(596) : error 001: expected token: ",", but found ";"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(596) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(596) : warning 215: expression has no effect
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(596) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(596) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Administrador\Ambiente de trabalho\samp03x_svr_R1-2_win32\pawno\strapz.pwn(596) : fatal error 107: too many error messages on one line

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


4 Errors.
Can somebody tell me what is wrong in this ?
Reply
#2

You have a semi-colon after 'sizeof(action)', instead of a comma.
pawn Код:
CMD:me(playerid, params[])
{
    new action[200];
    if(sscanf(params,"s[200]", action))return SendClientMessage(playerid, 0x33CCCC,"USAGE: /me [action]");
    format(action, sizeof(action),"%s %s", GetName(playerid), action);
    SendClientMessageToAll(0x66CC33, action);
    return 1; //add this so it does not say 'Unknown server command'.
}
Reply
#3

format(action, sizeof(action), "%s %s", GetName(playerid), action);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)