Hallo leute,
ich habe fünf stock's gebastelt die es ermöglicht das ihr beim Öffnen von Datein keine Variablen in einzelnen Callbacks ect erstellen müsst.
Das stock coding fürs auslesen sollte kein problem darstellen.
1. getINI Stock:
stock getINI( playerid )
{
new acc[30];
format(acc,27,"%s.datei",getPlayerName(playerid));
return acc;
}
2. getPlayerName Stock:
stock getPlayerName(playerid)
{
new name[24];
GetPlayerName(playerid,name,24);
return name;
}
3. WriteString Stock:
stock WriteString(playerid, Key[], Var[])
{
if(fexist(getINI(playerid)))
{
if(INI_Open(getINI(playerid)))
{
INI_WriteString(Key,Var);
INI_Save();
INI_Close();
}
}
else { /* ? */ }
}
4. WriteInt Stock:
stock WriteInt(playerid,Key[],Integer)
{
if(fexist(getINI(playerid)))
{
if(INI_Open(getINI(playerid)))
{
INI_WriteInt(Key,Integer);
INI_Save();
INI_Close();
}
}
else { /* ? */ }
}
5. WriteFloat Stock:
stock WriteFloat(playerid, Key[], Float)
{
if(fexist(getINI(playerid)))
{
INI_Open(getINI(playerid));
INI_WriteFloat(Key,Float);
INI_Save();
INI_Close();
}
else { /* ? */ }
}
Mfg AdnaN