C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\AdminPlugin.pwn(220) : error 037: invalid string (possibly non-terminated string) C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\AdminPlugin.pwn(220) : error 017: undefined symbol "s" C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\AdminPlugin.pwn(220) : error 029: invalid expression, assumed zero C:\Program Files\Rockstar Games\GTA San Andreas\SAMP\Server\gamemodes\AdminPlugin.pwn(220) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Bankmoney",PlayerInfo[playerid][pBankmoney]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
INI_Int("Org",PlayerInfo[playerid][pOrgID]);
INI_Int("Rank",PlayerInfo[playerid][pRank]);
return 1;
}
stock UserPath(playerid)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername)); //error here
new string[128]; //error here
format(string,sizeof(string),PATH,playername);
return string;
}
stock udb_hash(buf[])
{
new length=strlen(buf);
new s1 = 1;
new s2 = 0;
new n;
for (n=0; n<length; n++)
{
s1 = (s1 + buf[n]) %65521;
s2 = (s2 + s1) %65521;
}
return (s2 << 16) + s1;
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,-1,("[RMT:RP]:Dobrodosli na RMTeam RolePlay!"));
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
if(PlayerInfo[playerid][pBanned] == 1) return Ban(playerid);
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Molimo upisite password dolje.","Login","Izlaz");
}
}
else
{
ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Ovaj profil nije bio registrovan! Molimo upisite password dolje.","Register","Izlaz");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Bankmoney",PlayerInfo[playerid][pBankmoney]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteInt(File,"Org",PlayerInfo[playerid][pOrgID]);
INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
INI_Close(File);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register:","Password nedostupan! Molimo upisite drugi password.","Register","Izlaz");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Bankmoney",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"OrgID",-1);
INI_WriteInt(File,"Rank",0);
PlayerInfo[playerid][pOrgID] = -1;
INI_Close(File);
}
}
case DIALOG_LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid),"LoadUser_%s",.bExtra = true,.extra = playerid);
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
SendClientMessage(playerid,-1,"Uspijesno ste se logovali u svoj profil!");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login:","Password netacan! Molimo pokusajte ponovo.","Retry","Quit");
}
}
}
}
return 1;
}
"
|
nonterminated string means you have a missing
Код:
" also udb_hash is the worst hash you could use. either make your database(your server files in this case because its ini) unreachable outside of 127.0.0.1 and dont use a hash at all(i dont recommend this). or start using something like whirlpool if you cant make another hash also if you can post your codeblock of line 220 here i can have a look at it. |
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Bankmoney",PlayerInfo[playerid][pBankmoney]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
INI_Int("Org",PlayerInfo[playerid][pOrgID]);
INI_Int("Rank",PlayerInfo[playerid][pRank]);
return 1;
}
playerid,name[],value[]
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid)); //right here
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Bankmoney",PlayerInfo[playerid][pBankmoney]);
INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
INI_WriteInt(File,"Org",PlayerInfo[playerid][pOrgID]);
INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
INI_Close(File);
return 1;
}