SA-MP Forums Archive
Need help with stock - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help with stock (/showthread.php?tid=218991)



Need help with stock - Audiophr3ak - 31.01.2011

stock LoadVehicles()
{
for(new i; i<100; i++)
{
new vfile[8]; format(vfile, sizeof(vfile), "Vehicles/%d.ini", i);
if(dini_Exists(vfile)){CreateVehicle(dini_Int(vfil e,"Model"),dini_Float(vfile,"X"),dini_Float(vfile, "Y"),dini_Float(vfile,"Z"),dini_Float(vfile,"A"),d ini_Int(vfile,"C1"),dini_Int(vfile,"C2"),600);}
}
return 1;
}

public OnFilterScriptInit()
{
LoadVehicles();
return 1;
}

//Where is the problem, my cars won't spawn, it works only when im using custom CMD to load vehicles. but callbacks wont work with my function...


Re: Need help with stock - Steven Paul - 31.01.2011

do you wrote under OnGameModeInit this LoadVehicles()


Re: Need help with stock - Audiophr3ak - 31.01.2011

i think it should work with OnFilterScriptinit() cuz its a FS. its the same thing. but it won't work....


Re: Need help with stock - [03]Garsino - 31.01.2011

pawn Код:
new vfile[17];
format(vfile, sizeof(vfile), "Vehicles/%d.ini", i);
The string size was too small, it cut out some characters

Also, I suggest you to use something else than dini as it's very slow. Try Y_INI or any of the newly released INI systems - they're a lot faster!


Re: Need help with stock - Audiophr3ak - 31.01.2011

OMG the problem was with that stupid string lol thanx alot )
i think to put MYSQL in my script later.