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
public LoadUser_data(playerid, name[], value[]);
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;
}
public LoadUser_data(playerid, name[], value[]);
H:\[S]uper\gamemodes\[S]uper.pwn(146) : error 017: undefined symbol "inputtext" H:\[S]uper\gamemodes\[S]uper.pwn(148 ) : error 028: invalid subscript (not an array or too many subscripts): "SuperHuman_Info" H:\[S]uper\gamemodes\[S]uper.pwn(148 ) : warning 215: expression has no effect H:\[S]uper\gamemodes\[S]uper.pwn(148 ) : error 001: expected token: ";", but found "]" H:\[S]uper\gamemodes\[S]uper.pwn(148 ) : error 029: invalid expression, assumed zero H:\[S]uper\gamemodes\[S]uper.pwn(148 ) : fatal error 107: too many error messages on one line |
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;
}
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin", SuperHuman_Info[playerid], pAdmin);
INI_WriteInt(File,StatName,StatValue);
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new hashpass[129], pname[MAX_PLAYER_NAME];
WP_Hash(hashpass,sizeof(hashpass),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, ""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_WriteString(file,"Password",hashpass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"NormalName",GetPlayerName(playerid, pname, sizeof(pname));
INI_WriteInt(File,"NormalLevel",0);
INI_WriteInt(File,"NormalSkin",26);
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 "Relog and try to login next time :D"); kick(playerid);
if(response)
{
if(!strcmp(hashpass, shInfo[playerid][pPass], false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, shInfo[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"White"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
return 1;
}
INI_WriteString(File,"NormalName",GetPlayerName(playerid, pname, sizeof(pname),MAX_PLAYER_NAME);
INI_WriteString(File,"NormalAbility","None",4);
//etc.
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new hashpass[129], pname[MAX_PLAYER_NAME];
WP_Hash(hashpass,sizeof(hashpass),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, ""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_WriteString(file,"Password",hashpass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteString(File,"NormalName",GetPlayerName(playerid, nName, sizeof(nName),MAX_PLAYER_NAME);
INI_WriteInt(File,"NormalLevel",0, 128);
INI_WriteInt(File,"NormalSkin",26, 128);
INI_WriteString(File,"NormalAbility","None", 128);
INI_WriteString(File,"NormalWeakness","None", 128);
INI_WriteString(File,"SuperName","None", 128);
INI_WriteInt(File,"SuperLevel",0);
INI_WriteInt(File,"SuperSkin",0);
INI_WriteString(File,"Ability_1","None", 128);
INI_WriteString(File,"Ability_2","None", 128);
INI_WriteString(File,"Ability_3","None", 128);
INI_WriteString(File,"Weakness_1","None", 128);
INI_WriteString(File,"Weakness_2","None", 128);
INI_WriteString(File,"Weakness_3","None", 128);
INI_Close(File);
}
}
case Dialog_Login:
{
if (!response) return "Relog and try to login next time :D"); kick(playerid);
if(response)
{
if(!strcmp(hashpass, shInfo[playerid][pPass], false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, shInfo[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"White"Type your password below to login.","Login","Quit");
}
return 1;
}
}
}
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);
new hashpass[129];
WP_Hash(hashpass, sizeof(hashpass), inputtext);
if(!inputtext[0]) return ShowPlayerDialog(playerid, Dialog_Register, DIALOG_STYLE_INPUT, ""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_WriteString(file,"Password",hashpass);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Admin",0);
INI_WriteString(File,"NormalName",GetPlayerName(playerid, nName, sizeof(nName),MAX_PLAYER_NAME);
INI_WriteInt(File,"NormalLevel",0, 128);
INI_WriteInt(File,"NormalSkin",26, 128);
INI_WriteString(File,"NormalAbility","None", 128);
INI_WriteString(File,"NormalWeakness","None", 128);
INI_WriteString(File,"SuperName","None", 128);
INI_WriteInt(File,"SuperLevel",0);
INI_WriteInt(File,"SuperSkin",0);
INI_WriteString(File,"Ability_1","None", 128);
INI_WriteString(File,"Ability_2","None", 128);
INI_WriteString(File,"Ability_3","None", 128);
INI_WriteString(File,"Weakness_1","None", 128);
INI_WriteString(File,"Weakness_2","None", 128);
INI_WriteString(File,"Weakness_3","None", 128);
INI_Close(File);
}
case Dialog_Login:
{
if(!response) return xxx(playerid, Red, "Relog and try to login next time :D"), kick(playerid);
new hashpass[129];
WP_Hash(hashpass, sizeof(hashpass), inputtext);
if(!strcmp(hashpass, shInfo[playerid][pPass], false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, shInfo[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"White"Type your password below to login.","Login","Quit");
}
default: return 0; // dialogid not found, search in other scripts
}
return 1; // dialogid was found
}