Vehicle Not Spawning !!
#8

Use this include.. it might help you..
Code:
stock LoadDynamicObjectsFrom(filename[])
{
        new count = GetTickCount();
        new string[512],objectid,Float:pos[6],index,var_from_line[64],loaded;
        new File:example = fopen(filename, io_read);
        if(!example)return printf("Error opening: %s",filename);
        while(fread(example, string) > 0)
        {
                if(IsObjectCode(string))
                {
                        if(ClearLine(string))
                        {
                                index = 0;
                                index = token_by_delim(string,var_from_line,',',index); objectid = strval(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[0] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[1] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[2] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[3] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[4] = floatstr(var_from_line);
                                index = token_by_delim(string,var_from_line,',',index+1); pos[5] = floatstr(var_from_line);
                                CreateDynamicObject(objectid,pos[0],pos[1],pos[2],pos[3],pos[4],pos[5]);
                                loaded++;
                        }
                }
        }
        fclose(example);
        return printf("Loaded %d objects. In %d mc.",loaded,(GetTickCount()-count));
}
stock ClearLine(line[])
{
        strdel(line, 0, 20);
        return 1;
}
forward bool:IsObjectCode(line[]);
stock bool:IsObjectCode(line[])
{
        if(strfind(line, "CreateDynamicObject", false) != -1)return true;
        return false;
}
stock token_by_delim(const string[], return_str[], delim, start_index)
{
    new x=0;
    while(string[start_index] != EOS && string[start_index] != delim) {
        return_str[x] = string[start_index];
        x++;
        start_index++;
    }
    return_str[x] = EOS;
    if(string[start_index] == EOS) start_index = (-1);
    return start_index;
}
For more information http://forum.sa-mp.com/showthread.ph...highlight=load

If i helped you, than please +REP me.
Reply


Messages In This Thread
Vehicle Not Spawning !! (FIXED) - by Crazydriver - 23.10.2014, 16:51
Re: Vehicle Not Spawning !! - by dominik523 - 23.10.2014, 17:25
Re: Vehicle Not Spawning !! - by Crazydriver - 23.10.2014, 19:50
Re: Vehicle Not Spawning !! - by Crazydriver - 23.10.2014, 20:53
Re: Vehicle Not Spawning !! - by Patrik356b - 23.10.2014, 21:50
Re: Vehicle Not Spawning !! - by Crazydriver - 23.10.2014, 21:51
Re: Vehicle Not Spawning !! - by z0r - 23.10.2014, 22:54
Re: Vehicle Not Spawning !! - by highstreetsrp - 24.10.2014, 05:02

Forum Jump:


Users browsing this thread: 2 Guest(s)