Sziasztok!
Valamiért csak az 1-es ID-jû jármûvet geteli a többire azt írja h nem létezik.
[pawn]CMD:getcar(playerid, params[])
{
new str[32];
if(PlayerInfo[playerid] <= 2) return SendClientMessage(playerid, COLOR_WHITE, \"(( Ismeretlen parancs! ))\");
else if(sscanf(params, \"s[32]\", str)) return SendClientMessage(playerid, COLOR_WHITE, \"(( Használat: /getcar [rendszam] ))\");
for(new i = 0; i < MAX_VEHICLES; i++) {
if(strcmp(str, VehicleInfo[vRendszam], true) == 0) {
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, Float:x, Float:y, Float:z);
SetVehiclePos(i, Float:x, Float:y, Float:z);
} else return SendClientMessage(playerid, COLOR_WARNING, \"(( Nem található ilyen rendszámú jármû! ))\");
}
return 1;
}[/pawn]
Kocsi betöltés:
[pawn]stock Kocsibetolt(vehicleid)
{
new file[128];
format(file,sizeof(file),\"Jarmuvek/%d.ini\",vehicleid);
VehicleInfo[vehicleid][vID] = dini_Int(file, \"vID\");
VehicleInfo[vehicleid][vPosx] = dini_Float(file, \"vPosx\");
VehicleInfo[vehicleid][vPosy] = dini_Float(file, \"vPosy\");
VehicleInfo[vehicleid][vPosz] = dini_Float(file, \"vPosz\");
VehicleInfo[vehicleid][vColor1] = dini_Int(file, \"vColor1\");
VehicleInfo[vehicleid][vColor2] = dini_Int(file, \"vColor2\");
VehicleInfo[vehicleid][vHP] = dini_Int(file, \"vHP\");
VehicleInfo[vehicleid][vAzonosito] = dini_Int(file, \"vAzonosito\");
format(VehicleInfo[vehicleid][vTulaj],30,\"%s\", dini_Get(file, \"vTulaj\"));
format(VehicleInfo[vehicleid][vRendszam],30,\"%s\", dini_Get(file, \"vRendszam\"));
CreateVehicle(VehicleInfo[vehicleid][vID], VehicleInfo[vehicleid][vPosx], VehicleInfo[vehicleid][vPosy], VehicleInfo[vehicleid][vPosz], 0, VehicleInfo[vehicleid][vColor1], VehicleInfo[vehicleid][vColor2], -1);
SetVehicleNumberPlate(vehicleid, VehicleInfo[vehicleid][vRendszam]);
return 1;
}[/pawn]
[pawn]for(new i = 0; i < 2000; i++)
{
Kocsibetolt(i);
}[/pawn]