(Help) error 012: invalid function call, not a valid address
#1

Код:
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");
Reply
#2

pawn Код:
format(file, sizeof(file)),"Strike_Camionero/%s.ini", pName(playerid);
Try this
Reply
#3

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

pawn Код:
format(file, sizeof(file), "Strike_Camionero/%s.ini", pName(playerid);
And this?
Reply
#5

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


Forum Jump:


Users browsing this thread: 2 Guest(s)