SA-MP Forums Archive
help Loading and deleting objects - 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: help Loading and deleting objects (/showthread.php?tid=549587)



help Loading and deleting objects - _Application_ - 07.12.2014

I want to load objects from the file, it will be possible to destroy them


this is load objects from file,

PHP код:
stock LoadObjectsFromFile(const filename[])
{
    new
        
File:file fopen(filenameio_read);
    if (!
file) return 0;
    new
        
line[128],
          
count,
          
modelid,
          
Float:XFloat:YFloat:Z,
          
Float:rXFloat:rYFloat:rZ;
    while (
fread(fileline))
    {
        if (!
sscanf(line"iffffff"modelidXYZrXrYrZ))
          {
            
ActivityObject[line] = CreateObject(modelidXYZrXrYrZ);
            
count++;
          }
    }
    
fclose(file);
    return 
count;

It deletes the objects I have argued from the file,
PHP код:
    DestroyDynamicObject(ActivityObject[line]); 
Would love to have a revised code
sorry my bad english..


Re : help Loading and deleting objects - ManuelNeuer - 07.12.2014

Do the same thing


Re: help Loading and deleting objects - _Application_ - 07.12.2014

How?