Es wird keine Datei erstellt
Die Stocks:
//___________________________________________VEH SYSTEM__________________________________________________________________
stock CreateVehicleEx(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, respawntime, ownername[MAX_PLAYER_NAME])
{
new carid = GetFreeVehicleSlot();
carData[carid][model] = modelid;
carData[carid][xspawn] = x;
carData[carid][yspawn] = y;
carData[carid][zspawn] = z;
carData[carid][anglespawn] = angle;
carData[carid][col1] = color1;
carData[carid][col2] = color2;
carData[carid][respawn] = respawntime;
carData[carid][owner] = ownername;
validcar[carid] = true;
CreateVehicle(modelid, x, y, z, angle, color1, color2, respawntime);
return carid;
}
stock SaveVehicle(vehicle, filename[36])
{
new iniid = ini_CreateIniFile(filename);
ini_SetInt(iniid, "Model", carData[vehicle][model]);
ini_SetFloat(iniid, "XSpawn", carData[vehicle][xspawn]);
ini_SetFloat(iniid, "YSpawn", carData[carid][yspawn]);
ini_SetFloat(iniid, "ZSpawn", carData[carid][zspawn]);
ini_SetInt(iniid, "anglespawn", carData[carid][anglespawn]);
ini_SetInt(iniid, "col1", carData[carid][col1]);
ini_SetInt(iniid, "col2", carData[carid][col2]);
ini_SetInt(iniid, "respwantime", carData[carid][respawn]
ini_SetInt(iniid, "besitzer", carData[carid][owner]
}
stock SaveAllVehicles()
{
new saveindex = 0;
new fname[36];
for(new i = 0; i < MAX_VEHICLES; i ++)
{
if(validcar[i])
{
format(fname, sizeof(fname), "/vehicles/%d.ini", saveindex);
SaveVehicle(i, fname);
saveindex ++;
}
}
stock LoadVehicle(filename[36])
{
new iniid = ini_OpenIni(filename);
CreateVehicleEx(ini_GetInt(iniid, "Model"), ini_GetFloat(iniid, "XSpawn"),ini_GetFloat(iniid, "YSpawn"),ini_GetFloat(iniid, "ZSpawn"),ini_GetInt(iniid, "anglespawn"),ini_GetInt(iniid, "col1"),ini_GetInt(iniid, "col2"),ini_GetInt(iniid, "respwantime"),ini_GetInt(iniid, "besitzer"));
ini_CloseIni(iniid);
}
stock LoadAllVehicles()
{
new fname[36];
new index = 0;
format(fname, sizeof(fname), "%d.ini", index);
while(fexist(fname))
{
LoadVehicle(fname);
index ++;
format(fname, sizeof(fname), "%d.ini", index);
}
}
Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!
Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link