10.04.2012, 23:41
when creating an object, it overwrites the previous one
pawn Код:
if(dialogid == OBIEKT2)
{
if(response)
{
new object = 0;
if(IsNumeric(inputtext) || strval(inputtext) > 0 || strval(inputtext) < 19470)
{
object ++;
new File:hFile;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
new obj2[MAX_OBJECTS_2];
SelectedO[playerid] = object;
Selected1[playerid] = strval(inputtext);
obj2[object] = CreateObject(strval(inputtext), X+1, Y+1, Z+1, 0.0,0.0,0.0);
EditObject(playerid, obj2[object]);
hFile = fopen("/Ustawienia/obiekty.ini", io_write);
new line[128];
format(line, sizeof(line), "%d,%f,%f,%f,%f,%f,%f,%d\r\n",strval(inputtext), X+1,Y+1,Z+1, 0,0,0,object);
fwrite(hFile, line);
return 1;
}
}
}