Trying to do a macro
#1

Well i read this tutorial, and thought to start making macros,
But now i am getting error's while using them
pawn Код:
#define GetPName(%0)                                         do{new p_name[MAX_PLAYER_NAME]; GetPlayerName(%0,p_name,sizeof(p_name)); return p_name;}
pawn Код:
public OnPlayerConnect(playerid)
{
    format(file,sizeof(file),Userfile,GetPName(playerid));
    return 1;
}
And im getting errors.
Quote:

C:\Users\Admin\Desktop\Untitled.pwn(51) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\Untitled.pwn(51) : error 090: public functions may not return arrays (symbol "OnPlayerConnect")
C:\Users\Admin\Desktop\Untitled.pwn(51) : warning 217: loose indentation
C:\Users\Admin\Desktop\Untitled.pwn(51) : error 029: invalid expression, assumed zero
C:\Users\Admin\Desktop\Untitled.pwn(51) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.

Error line is
pawn Код:
format(file,sizeof(file),Userfile,GetPName(playerid));
Reply


Messages In This Thread
Trying to do a macro - by [KO]KillerThriller - 08.06.2011, 15:58
Re: Trying to do a macro - by Jeffry - 08.06.2011, 17:41

Forum Jump:


Users browsing this thread: 1 Guest(s)