Error With Dini - 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: Error With Dini (
/showthread.php?tid=432695)
Error With Dini -
RandomDude - 23.04.2013
pawn Код:
new file[256]; format(file,sizeof(file),"Roleplay/Users/%s.ini",pName(playerid));
The errors
Quote:
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\RolePlayByME.pwn(165) : error 012: invalid function call, not a valid address
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\RolePlayByME.pwn(165) : warning 215: expression has no effect
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\RolePlayByME.pwn(165) : error 001: expected token: ";", but found ")"
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\RolePlayByME.pwn(165) : error 029: invalid expression, assumed zero
C:\Users\Grand\Desktop\Ultimate Gaming Ground\gamemodes\RolePlayByME.pwn(165) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
|
AW: Error With Dini -
HurtLocker - 23.04.2013
What's that pName(playerid)? stock function?
Re: Error With Dini -
RandomDude - 23.04.2013
pawn Код:
stock pName(playerid)
{
new string[24];
GetPlayerName(playerid,string,24);
return string;
}
Yup aha but I'm using this
pawn Код:
new pName[MAX_PLAYER_NAME+1];
Re: Error With Dini -
Vince - 23.04.2013
You can't have a variable and a function with the same name, evidently.
Re: Error With Dini -
RandomDude - 23.04.2013
Quote:
Originally Posted by Vince
You can't have a variable and a function with the same name, evidently.
|
What do you mean that PName?
I'm not using the stock. I'm using the new pName[MAX_PLAYER_NAME+1];
AW: Error With Dini -
HurtLocker - 23.04.2013
So pName is not a variable, you don't need that "new pName[maxplayers]" line. And this is your stock:
pawn Код:
stock pName(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),"Roleplay/Users/%s.ini",playername);
return string;
}
Re: AW: Error With Dini -
RandomDude - 23.04.2013
Quote:
Originally Posted by HurtLocker
So pName is not a variable, you don't need that "new pName[maxplayers]" line. And this is your stock:
pawn Код:
stock pName(playerid) { new string[128],playername[MAX_PLAYER_NAME]; GetPlayerName(playerid,playername,sizeof(playername)); format(string,sizeof(string),"Roleplay/Users/%s.ini",playername); return string; }
|
Ahh Thank You could you explain to me why that worked?
I had this stock function like
/* so it don't work

Anyways why does it work like this?
Btw im using this version
pawn Код:
stock pName(playerid)
{
new string[24];
GetPlayerName(playerid,string,24);
return string;
}
AW: Error With Dini -
HurtLocker - 23.04.2013
Oh, I use this stock cause with y_ini you need to open the file. But with dini you dont open/close files. So I suppose you don;t need my stock. All you need is to get the player's .ini file, so stick to your stock. Just remove that line as I said before.
Re: AW: Error With Dini -
RandomDude - 23.04.2013
Quote:
Originally Posted by HurtLocker
Oh, I use this stock cause with y_ini you need to open the file. But with dini you dont open/close files. So I suppose you don;t need my stock. All you need is to get the player's .ini file, so stick to your stock. Just remove that line as I said before.
|
Okay thanks.