compile error
#1

Код:
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2172) : error 017: undefined symbol "pname"
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2172) : error 017: undefined symbol "pname"
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2172) : error 029: invalid expression, assumed zero
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2172) : fatal error 107: too many error messages on one line

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


4 Errors.
line:
Код:
2172:   GetPlayerName(playerid,pname,sizeof(pname));
	format(string,sizeof(string),"%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
	SendClientMessageToAll(COLOR_DEADCONNECT,string);
	format(string,sizeof(string),"6%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
	IRC_Say(gGroupID,IRC_CHANNEL,string);
	SetPlayerColor(playerid,COLOR_DEADCONNECT);
Reply
#2

Have you defined 'pname' at all anywhere in your defines?

Does it actually have a function? Otherwise it's not really needed.
Reply
#3

Ah,

pawn Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(MAX_PLAYER_NAME));
Reply
#4

Quote:
Originally Posted by Bingo
Посмотреть сообщение
Ah,

pawn Код:
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(MAX_PLAYER_NAME));
sizeof(pname)* or just MAX_PLAYER_NAME, you can't use sizeof for define.
Reply
#5

new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(MAX_PLAYER_NAME));

Use it
Reply
#6

pawn Код:
new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string,sizeof(string),"%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
    SendClientMessageToAll(COLOR_DEADCONNECT,string);
    format(string,sizeof(string),"6%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
    IRC_Say(gGroupID,IRC_CHANNEL,string);
    SetPlayerColor(playerid,COLOR_DEADCONNECT);
now i'm getting
pawn Код:
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2174) : error 017: undefined symbol "string"
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2174) : error 017: undefined symbol "string"
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2174) : error 029: invalid expression, assumed zero
C:\Users\user\Documents\cnr\gamemodes\cnr.pwn(2174) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
pawn Код:
format(string,sizeof(string),"%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
Reply
#7

so add

new string[128];
Reply
#8

pawn Код:
new pname[MAX_PLAYER_NAME], string[128+MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    format(string,sizeof(string),"%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
    SendClientMessageToAll(COLOR_DEADCONNECT,string);
    format(string,sizeof(string),"6%s(%d) Has joined %s v%s.",pname,playerid,svname,sversion);
    IRC_Say(gGroupID,IRC_CHANNEL,string);
    SetPlayerColor(playerid,COLOR_DEADCONNECT);
Reply
#9

Dude, it's a Copy / Paste code, try to be more standalone,
when you have an Undefined Symbol error, try to Define the symbol,
and you can figur it out with your own,

for exemple, Undefined Symbol "string" : new string[128];

or pname :
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));

or
Undefined Symbol "PoliceCar"
new PoliceCar;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)