new fname[MAX_PLAYER_NAME],string[48],namestring[120];
GetPlayerName(playerid, fname, sizeof(fname));
if(strcmp(cmdtext, "/addfirma", true) == 0)
{
new Float:gx,Float:gy,Float:gz;
GetPlayerPos(playerid,gx,gy,gz);
punkte[schon_erstellt][x] = (gx);
punkte[schon_erstellt][y] = (gy);
punkte[schon_erstellt][z] = (gz);
punkte[schon_erstellt][ist_da] = (1);
punkte[schon_erstellt][owner] = fname;
format(namestring, sizeof(namestring), "%s",fname);
format(string, sizeof(string), "Firma \n Besitzer:%s",fname);
Create3DTextLabel(string,0x008080FF,gx,gy,gz+0.3,40.0,0);
CreatePickup(1275, 23, gx, gy, gz, -1);
schon_erstellt++;
}
if(strcmp(cmdtext, "/savefirmen", true) == 0)
{
new formatx[30];
if(INI_Open("firmeen.cfg"))
{
for(new i = 0;i<max_points;i++)
{
if(punkte[i][ist_da]) // if(punkte[i][ist_da] == 1)
{
format(formatx,sizeof formatx,"p_x_%d",i);
INI_WriteFloat(formatx,punkte[i][x]);
format(formatx,sizeof formatx,"p_y_%d",i);
INI_WriteFloat(formatx,punkte[i][y]);
format(formatx,sizeof formatx,"p_z_%d",i);
INI_WriteFloat(formatx,punkte[i][z]);
format(formatx,sizeof formatx,"is_there_%d",i);
INI_WriteInt(formatx,punkte[i][ist_da]);
format(formatx,sizeof formatx,"Besitzer_von_%d",i);
INI_WriteInt(formatx, namestring);
}
}
INI_Save();
INI_Close();
}
}
das der code und ich möchte das bei /Savefirmen die sachen in eine datei gespeichert werden und den namen mit übergeben wie geht es richtig?
LG Dennis