SA-MP Forums Archive
Scripting Error - 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: Scripting Error (/showthread.php?tid=588614)



Scripting Error - VirtasVarsketis - 10.09.2015

Hello, I have started scripting recently and I have encountered a problem with a login system. Here are error messages:
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\rD\pawno\Login.pwn(41) : error 001: expected token: "-string end-", but found "-identifier-"
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\rD\pawno\Login.pwn(41) : warning 215: expression has no effect
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\rD\pawno\Login.pwn(41) : error 001: expected token: ";", but found ")"
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\rD\pawno\Login.pwn(41) : error 029: invalid expression, assumed zero
D:\Documents and Settings\Administrator\Desktop\Sa-Mp Server\rD\pawno\Login.pwn(41) : fatal error 107: too many error messages on one line
Here is 41 line:
format(string,sizeof(string),PATH,playername);
What should I do?


Re: Scripting Error - GGRoleplay - 10.09.2015

format(string, sizeof(string), "%s", playername);
try this


Re: Scripting Error - Sjn - 10.09.2015

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
format(string, sizeof(string), "%s", playername);
try this
He have PATH there and i think its something related to file thingy to get the directory. The problem might be caused from the definition line of the PATH.


Re: Scripting Error - VirtasVarsketis - 11.09.2015

Definition line of PATH? You mean this? #define PATH "/Administration/Users/%s.ini"*


Re: Scripting Error - Sjn - 11.09.2015

Quote:
Originally Posted by VirtasVarsketis
Посмотреть сообщение
Definition line of PATH? You mean this? #define PATH "/Administration/Users/%s.ini"*
Yes, remove that * symbol from there, that's what causing the error.


Re: Scripting Error - VirtasVarsketis - 12.09.2015

Didn't work.


Re: Scripting Error - IceBilizard - 12.09.2015

try this

pawn Код:
#define PATH "/Administration/Users/"


stock PlayerPath(playerid[])
{
    new path[60];
    format(path, sizeof(path), ""#PATH "%s.ini", playerid);
    return path;
}
stock playername(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}

format(string,sizeof(string),"%s", PlayerPath(playername(playerid)));