I'm a beginner at defines.
#1

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"
Reply
#2

za fahct u need to do this:

delete the pName define and add this

pawn Код:
new pName[MAX_PLAYER_NAME];
Reply
#3

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

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

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;
}
Reply
#5

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
Reply
#6

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! :]
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)