Help with stock PlayerRPname
#1

Код:
***.pwn(486) : error 012: invalid function call, not a valid address
***.pwn(486) : warning 215: expression has no effect
***.pwn(486) : error 001: expected token: ";", but found ")"
***.pwn(486) : error 029: invalid expression, assumed zero
***.pwn(486) : fatal error 107: too many error messages on one line

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


4 Errors.
The lines
Код:
stock PlayerRPName(playerid)
{
    new name[MAX_PLAYER_NAME];
    strmid(name, str_replace('_', ' ', PlayerName(playerid)), 0, MAX_PLAYER_NAME); //486
    return name;
}
The str_replace stock
Код:
stock str_replace(sSearch, sReplace, const sSubject[], &iCount = 0)
{
	new sReturn[128];
	format(sReturn, sizeof(sReturn), sSubject);
	for(new i = 0; i < sizeof(sReturn); i++)
	{
	    if(sReturn[i] == sSearch)
	    {
			sReturn[i] = sReplace;
		}
	}
	return sReturn;
}
Reply
#2

this
Код:
stock PlayerRPName(playerid)
{
    new name[MAX_PLAYER_NAME];
    strmid(name, str_replace('_', ' ', PlayerName(playerid)), 0, MAX_PLAYER_NAME); //486
    return name;
}
replace with this
Код:
stock PlayerRPName(playerid)
{
    new name[MAX_PLAYER_NAME];
    strmid(name, str_replace('_', '_', PlayerName(playerid)), 0, MAX_PLAYER_NAME); //486
    return name;
}
Reply
#3

Still the same errors at the same line
Reply
#4

PlayerName is not a function but a 2D array:
Код:
strmid(name, str_replace('_', ' ', PlayerName[playerid]), 0, MAX_PLAYER_NAME);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)