Help with stock PlayerRPname - 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)
+--- Thread: Help with stock PlayerRPname (
/showthread.php?tid=615033)
Help with stock PlayerRPname -
StrikerZ - 16.08.2016
Код:
***.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;
}
Re: Help with stock PlayerRPname -
Dejan12345 - 16.08.2016
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;
}
Re: Help with stock PlayerRPname -
StrikerZ - 16.08.2016
Still the same errors at the same line
Re: Help with stock PlayerRPname -
Konstantinos - 16.08.2016
PlayerName is not a function but a 2D array:
Код:
strmid(name, str_replace('_', ' ', PlayerName[playerid]), 0, MAX_PLAYER_NAME);