can't fine the problem
#1

Guys
when i trying make command with this code
Код:
if(isnull(params)) return SendClientMessage(playerid, COLOR_YELLOW " ",);
it's always show me this ERROR
Код:
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(979) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(979) : warning 215: expression has no effect
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(979) : error 001: expected token: ";", but found ")"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(979) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(979) : fatal error 107: too many error messages on one line

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


4 Errors.
what i need do to make it working?
Reply
#2

Код:
CMD:me1(playerid, params[])
{
	new isnull;
	new string[128],pname[MAX_PLAYER_NAME]; //this is enough for the line "%s %s"/we will gonna define pname with GetPlayerName
	GetPlayerName(playerid, pname, MAX_PLAYER_NAME); //pname is defined here with GetPlayerName
	if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /me <text>"); //if player didn't type something this message will be showed example if you type: /me only the word will be showed
	format(string, sizeof(string), "[ME]: %s %s", pname, params); //will gonna format the word "[ME]: %s %s" with string/pname/params and gonna use on SendClientMessageToAll - %s - inserts a string.
	SendClientMessageToAll(-1, string); //this will be sent to the everyone with format string.
Reply
#3

You got an extra ',' after " ".
Reply
#4

Hmm? what u mean
sorry i'm not uder stand it newbie
Reply
#5

pawn Код:
if(isnull(params)) return SendClientMessage(playerid, COLOR_YELLOW, " ");
Reply
#6

still not working giving me same ERROR
Reply
#7

pawn Код:
CMD:me1( playerid, params[] )
{
    new isnull;
    new string[128], pname[MAX_PLAYER_NAME];                                                                /* this is enough for the line "%s %s"/we will gonna define pname with GetPlayerName */
    GetPlayerName( playerid, pname, MAX_PLAYER_NAME );                                                      /* pname is defined here with GetPlayerName */
    if ( isnull( params ) ) return(SendClientMessage( playerid, COLOR_RED, "SYNTAX: /me <text>" ) );        /* if player didn't type something this message will be showed example if you type: /me only the word will be showed */
    format( string, sizeof(string), "[ME]: %s %s", pname, params );                                         /* will gonna format the word "[ME]: %s %s" with string/pname/params and gonna use on SendClientMessageToAll - %s - inserts a string. */
    SendClientMessageToAll( -1, string );                                                                   /* this will be sent to the everyone with format string. */
    return(1);
}
Reply
#8

you defined 'isnull' ?

at the top of its script:

pawn Код:
#if !defined isnull
    #define isnull(%1) \
                ((!(%1[0])) || (((%1[0]) == '\1') && (!(%1[1]))))
#endif
pawn Код:
CMD:me1(playerid, params[])
{
    new string[128], pname[MAX_PLAYER_NAME]; //this is enough for the line "%s %s"/we will gonna define pname with GetPlayerName
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME); //pname is defined here with GetPlayerName
    if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "SYNTAX: /me <text>"); //if player didn't type something this message will be showed example if you type: /me only the word will be showed
    format(string, sizeof(string), "[ME]: %s %s", pname, params); //will gonna format the word "[ME]: %s %s" with string/pname/params and gonna use on SendClientMessageToAll - %s - inserts a string.
    SendClientMessageToAll(-1, string); //this will be sent to the everyone with format string.
    return true;
}
or use sscanf.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)