(Help) error 012: invalid function call, not a valid address - 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) error 012: invalid function call, not a valid address (
/showthread.php?tid=507277)
(Help) error 012: invalid function call, not a valid address -
NTVbeleza - 16.04.2014
Код:
C:\Users\Vals\Desktop\spaceranger.pwn(4488) : error 012: invalid function call, not a valid address
C:\Users\Vals\Desktop\spaceranger.pwn(4488) : warning 215: expression has no effect
C:\Users\vals\Desktop\spaceranger.pwn(4488) : error 001: expected token: ";", but found ")"
C:\Users\vals\Desktop\spaceranger.pwn(4488) : error 029: invalid expression, assumed zero
C:\Users\vals\Desktop\spaceranger.pwn(4488) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Lines
Код:
4487 new file[80];
4488 format(file, sizeof(file),"Strike_Camionero/%s.ini", pName(playerid)); (------------error line
4489 if(dini_Exists(file))
4488 {
PlayerInfo[playerid][pCamionero] = dini_Int(file,"Camionero");
Re: (Help) error 012: invalid function call, not a valid address -
lulo356 - 16.04.2014
pawn Код:
format(file, sizeof(file)),"Strike_Camionero/%s.ini", pName(playerid);
Try this
Re: (Help) error 012: invalid function call, not a valid address -
NTVbeleza - 17.04.2014
Quote:
Originally Posted by lulo356
pawn Код:
format(file, sizeof(file)),"Strike_Camionero/%s.ini", pName(playerid);
Try this
|
I tried that and it gives me the same errors
Re: (Help) error 012: invalid function call, not a valid address -
lulo356 - 17.04.2014
pawn Код:
format(file, sizeof(file), "Strike_Camionero/%s.ini", pName(playerid);
And this?
Re: (Help) error 012: invalid function call, not a valid address -
Dignity - 17.04.2014
Quote:
Originally Posted by lulo356
pawn Код:
format(file, sizeof(file), "Strike_Camionero/%s.ini", pName(playerid);
And this?
|
You need the two brackets at the end. One bracket is for the closing of (playerid) and the other one is the bracket that was opened by format(.
EDIT: I tried compiling your code and it worked. Can you give me the full code? (The code that happens before and after the code you showed).
I compiled it using this and it worked:
pawn Код:
#include <a_samp>
#include <dini>
enum pInfo
{
pCamionero,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
public OnPlayerSpawn(playerid)
{
new file[80];
format(file, sizeof(file),"Strike_Camionero/%s.ini", pName(playerid));
if(dini_Exists(file))
{
PlayerInfo[playerid][pCamionero] = dini_Int(file,"Camionero");
}
return 1;
}
stock pName(playerid)
{
new name[128];
GetPlayerName(playerid, name, sizeof(name));
return name;
}