SA-MP Forums Archive
Y_Ini load help - 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: Y_Ini load help (/showthread.php?tid=565213)



Y_Ini load help - HolyScripter - 26.02.2015

Hello guys iam trying to make my own clan system on my gamemode i has done creating the saving system
when i Re-Log sa-mp thats still work creating my Clan Tag [GOGS]HolyScripter
but then i restart sa-mp server and i login back my clan tag not appear and the clan not loaded
this the code

Quote:
pawn Код:
forward LoadClan_data(clanid,name[],value[]);
public LoadClan_data(clanid,name[],value[])
{
    INI_Int("ID",ClanInfo[clanid][cId]);
    INI_Int("Color",ClanInfo[clanid][cColor]);
    INI_Int("Member",ClanInfo[clanid][cMember]);
    INI_String("Clan Name",ClanInfo[clanid][cName],128);
    INI_String("Clan Tag",ClanInfo[clanid][cTag],128);
    INI_String("Leader",ClanInfo[clanid][cLeader],128);
    return 1;
}

stock ClanPath(clanid)
{
    new string[128];
    format(string,sizeof(string),"DM/Clan/%s.ini",ClanInfo[clanid][cName]);
    return string;
}

This script is on player login :

new clanid = PlayerInfo[playerid][pClanMember];
INI_ParseFile(ClanPath(clanid), "LoadClan_%s", .bExtra = true, .extra = clanid);
cant someone help me ?


Re: Y_Ini load help - Rally - 26.02.2015

Do you save the .ini files on OnGameModeExit()?


Re: Y_Ini load help - HolyScripter - 26.02.2015

Quote:

[data]
Color = 33
Member = 0
ID = 1
Leader =
Clan Tag = DK
Clan Name = DragonKnight

ofc , when i create clan . invite player to clan and kick clan it always saving , ongamemodeexit too ..


Re: Y_Ini load help - HolyScripter - 26.02.2015

Quote:
Originally Posted by ******
Посмотреть сообщение
You can't have spaces in keys, y_ini interprets that as key: "Clan", value: "Tag = DK".
Just that the problem ? , thats my code is correct , right ?


Re: Y_Ini load help - HolyScripter - 26.02.2015

Quote:
Originally Posted by ******
Посмотреть сообщение
It otherwise looks OK.
but when i try it the clan still not loaded , when i create my clan and i relog it still ok , but when i restart the server and i login again , my clan tag not showed up , and clan not loaded


Re: Y_Ini load help - Kenway - 26.02.2015

Show me your save code..there may be a problem with tag


Re: Y_Ini load help - HolyScripter - 26.02.2015

pawn Код:
forward SaveClan(clanid);
public SaveClan(clanid)
{
    new INI:File = INI_Open(ClanPath(clanid));
    INI_SetTag(File,"data");
    INI_WriteString(File,"ClanName",ClanInfo[clanid][cName]);
    INI_WriteString(File,"ClanTag",ClanInfo[clanid][cTag]);
    INI_WriteString(File,"Leader",ClanInfo[clanid][cLeader]);
    INI_WriteInt(File,"ID",ClanInfo[clanid][cId]);
    INI_WriteInt(File,"Member",ClanInfo[clanid][cMember]);
    INI_WriteInt(File,"Color",ClanInfo[clanid][cColor]);
    INI_Close(File);
}
When we create a clan the clan automaticaly save the clan


Re: Y_Ini load help - Kenway - 26.02.2015

Код:
forward LoadClan_data(clanid,name[],value[]);
public LoadClan_data(clanid,name[],value[])
{
    INI_Int("ID",ClanInfo[clanid][cId]);
    INI_Int("Color",ClanInfo[clanid][cColor]);
    INI_Int("Member",ClanInfo[clanid][cMember]);
    INI_String("Clan Name",ClanInfo[clanid][cName],128); // You cant make space there.. ClanName
    INI_String("Clan Tag",ClanInfo[clanid][cTag],128); // You cant make space there.. need be like ClanTag 
    INI_String("Leader",ClanInfo[clanid][cLeader],128);
    return 1;
}



Re: Y_Ini load help - HolyScripter - 26.02.2015

Quote:
Originally Posted by Kenway
Посмотреть сообщение
Код:
forward LoadClan_data(clanid,name[],value[]);
public LoadClan_data(clanid,name[],value[])
{
    INI_Int("ID",ClanInfo[clanid][cId]);
    INI_Int("Color",ClanInfo[clanid][cColor]);
    INI_Int("Member",ClanInfo[clanid][cMember]);
    INI_String("Clan Name",ClanInfo[clanid][cName],128); // You cant make space there.. ClanName
    INI_String("Clan Tag",ClanInfo[clanid][cTag],128); // You cant make space there.. need be like ClanTag 
    INI_String("Leader",ClanInfo[clanid][cLeader],128);
    return 1;
}
iam not using space btw i was fix it before


Re: Y_Ini load help - HolyScripter - 26.02.2015

help ~