SA-MP Forums Archive
I'm a beginner at defines. - 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: I'm a beginner at defines. (/showthread.php?tid=256823)



I'm a beginner at defines. - Seven_of_Nine - 22.05.2011

pawn Код:
#define SendFormattedMessage(%0,%1,%2,%3); new mess[30]; format(mess,sizeof(mess),%2,%3); SendClientMessage(%0,%1,mess);
#define pName(%0); new name[30]; GetPlayerName(%0,name,sizeof(name)); return name;
I used like:
pawn Код:
SendFormattedMessage(playerid,white,"Your name is %s.",pName(playerid));
Error(s):
pawn Код:
C:\Users*humm*gamemodes\troll1.pwn(491) : error 017: undefined symbol "pName"



Re: I'm a beginner at defines. - Cjgogo - 22.05.2011

za fahct u need to do this:

delete the pName define and add this

pawn Код:
new pName[MAX_PLAYER_NAME];



Re: I'm a beginner at defines. - Seven_of_Nine - 22.05.2011

Shut the hell up. That isn't the solution for SendFormattedMessage.

EDIT: Sorry, I was angry. Anyway, thanks for your help! :]


Re: I'm a beginner at defines. - Seven_of_Nine - 22.05.2011

Fixed it myself :P
pawn Код:
#define SendFormattedMessage(%0,%1,%2,%3) \
new text[128]; \
format(text,sizeof(text),%2,%3); \
SendClientMessage(%0,%1,text)

stock pName(playerid) {
    new name[30];
    GetPlayerName(playerid,name,sizeof(name));
    return name;
}



Re: I'm a beginner at defines. - Jay. - 22.05.2011

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
Shut the hell up. That isn't the solution for SendFormattedMessage.
There was no need to be rude.... was there?
He tried to help you at least, rofl


Re: I'm a beginner at defines. - davve95 - 22.05.2011

Quote:
Originally Posted by Funtime
Посмотреть сообщение
There was no need to be rude.... was there?
He tried to help you at least, rofl
Yes... But then he say : EDIT: Sorry, I was angry. Anyway, thanks for your help! :]


Re: I'm a beginner at defines. - Seven_of_Nine - 22.05.2011

Quote:
Originally Posted by davve95
Посмотреть сообщение
Yes... But then he say : EDIT: Sorry, I was angry. Anyway, thanks for your help! :]
That was after he told me. :P