30.06.2016, 21:34
Hi everyone, I have a few errors with this script that I don't know how I caused them so please this is only part of my script in which I have the errors from, if the solution is because I'm missing some more codes please show me what I'm missing, heres my errors
Notice the errors starts in line 69 to 87, line 68 is
Код:
H:\[S]uper\gamemodes\[S]uper.pwn(69) : error 055: start of function body without function header H:\[S]uper\gamemodes\[S]uper.pwn(70) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(72) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(74) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(76) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(78) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(79) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(80) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(81) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(82) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(83) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(84) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(85) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(86) : error 010: invalid function or declaration H:\[S]uper\gamemodes\[S]uper.pwn(87) : error 010: invalid function or declaration
PHP код:
public LoadUser_data(playerid, name[], value[]);
PHP код:
forward LoadUser_data(playerid, name[],value[]);
public LoadUser_data(playerid, name[], value[]);
{
INI_Int("Password", shInfo[playerid][pPass]);
INT_Int("Cash", shInfo[playerid][pCash]);
INI_Int("Admin", shInfo[playerid][pAdmin]);
INT_Int("NormalName", shInfo[playerid][nName]);
INI_Int("NormalLevel", shInfo[playerid][nLevel]);
INT_Int("NormalSkin", shInfo[playerid][nSkin]);
INI_Int("NormalAbility", shInfo[playerid][nAbility]);
INT_Int("NormalWeakness", shInfo[playerid][nWeakness]);
INT_Int("SuperName", shInfo[playerid][sName]);
INT_Int("SuperLevel", shInfo[playerid][sLevel]);
INT_Int("SuperSkin", shInfo[playerid][sSkin]);
INT_Int("Ability_1", shInfo[playerid][sAbility1]);
INT_Int("Ability_2", shInfo[playerid][sAbility2]);
INT_Int("Ability_3", shInfo[playerid][sAbility3]);
INT_Int("Weakness_1", shInfo[playerid][sWeakness1]);
INT_Int("Weakness_2", shInfo[playerid][sWeakness2]);
INT_Int("Weakness_3", shInfo[playerid][sWeakness3]);
return 1;
}
stock UserPath(playerid)
{
new string[128], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), PATH, pname);
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 OnPlayerDisconnect(playerid, reason)
{
// Cloner[playerid] = 0;
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Superhuman_Roleplay");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin", SuperHuman_Info[playerid], pAdmin);
INI_WriteInt(File,"NormalName",GetPayerName(playerid));
INI_WriteInt(File,"NormalLevel", SuperHuman_Info[playerid], nLevel);
INI_WriteInt(File,"NormalSkin", GetPlayerSkin(playerid));
INI_WriteInt(File,"NormalAbility", SuperHuman_Info[playerid], nAbility);
INI_WriteInt(File,"NormalWeakness", SuperHuman_Info[playerid], nWeakness);
INI_WriteInt(File,"SuperName", SuperHuman_Info[playerid], sName);
INI_WriteInt(File,"SuperLevel", SuperHuman_Info[playerid], sLevel);
INI_WriteInt(File,"SuperSkin", SuperHuman_Info[playerid], sSkin);
INI_WriteInt(File,"Ability_1", SuperHuman_Info[playerid], sAbility1);
INI_WriteInt(File,"Ability_2", SuperHuman_Info[playerid], sAbility2);
INI_WriteInt(File,"Ability_3", SuperHuman_Info[playerid], sAbility3);
INI_WriteInt(File,"Weakness_1", SuperHuman_Info[playerid], sWeakness1);
INI_WriteInt(File,"Weakness_2", SuperHuman_Info[playerid], sWeakness2);
INI_WriteInt(File,"Weakness_3", SuperHuman_Info[playerid], sWeakness3);
INI_Close(File);
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialog)
{
case Dialog_Register:
{
if(!response) return xxx(playerid, Red, "Relog and try to register next time :D"); kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""Red"You have entered an invalid password.\n"White"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Superhuman_Roleplay");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin","No");
INI_WriteInt(File,"NormalName",UsePlayerName);
INI_WriteInt(File,"NormalLevel",0);
INI_WriteInt(File,"NormalSkin",0);
INI_WriteInt(File,"NormalAbility","None");
INI_WriteInt(File,"NormalWeakness","None");
INI_WriteInt(File,"SuperName","None");
INI_WriteInt(File,"SuperLevel",0);
INI_WriteInt(File,"SuperSkin","None");
INI_WriteInt(File,"Ability_1","None");
INI_WriteInt(File,"Ability_2","None");
INI_WriteInt(File,"Ability_3","None");
INI_WriteInt(File,"Weakness_1","None");
INI_WriteInt(File,"Weakness_2","None");
INI_WriteInt(File,"Weakness_3","None");
INI_Close(File);
}
case Dialog_Login:
{
if (!response) return kick(playerid);
if(response)
{
if(udb_hash(inputtext) == SuperHuman_Info[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, SuperHuman_Info[playerid][pCash]);
ShowPlayerDialog(playerid, Dialog_Success_2, DIALOG_STYLE_MSGBOX,""White"Success!",""Green"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, Dialog_Login, DIALOG_STYLE_INPUT,""White"Login",""Red"You have entered an incorrect password.\n"COL_WHITE"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}