Scripting Error
#1

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?
Reply
#2

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

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

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

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.
Reply
#6

Didn't work.
Reply
#7

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


Forum Jump:


Users browsing this thread: 1 Guest(s)