Problems with paintjob
#1

Hello guys I'm new here . But I have problem with this:

Код:
// OnGameModeInit()
new fmt[65]
for(new i;i<6;i++)
{
    format(fmt,64,"phx_mod\\TuningCars\\AdminAuta\\admincar_%d.ini",i)
    CreateCarFromFile(fmt,2324.779+i,2369.783,10.820)
}
//----------------

CreateCarFromFile(filename[],Float:cx,Float:cy,Float:cz,mode = 1,Float:zAng = 0.0,rDelay = 2400)
{
	new File:CarHandle
	new buffer[128]
	new tmp[128]
	new carid
	new carbuff
	new index
	
	CarHandle = fopen(filename,io_read)
	if(!CarHandle) { print("[PHXMOD] Neplatny soubor auta!");return 1; }
	fread(CarHandle,tmp)
	fclose(CarHandle)

	buffer = strtok(tmp,index)
    // Vehicle ID
	carid = strval(buffer)
    // Mode for realtime creating or just OnInit
	switch(mode)
 	{
 	  case 1:carbuff = AddStaticVehicle(carid,cx,cy,cz,zAng,14,14)
 	  case 2:carbuff = CreateVehicle(carid,cx,cy,cz,zAng,14,14,rDelay)
 	}
 	
    // Change paintjob of car
	buffer = strtok(tmp,index)
	switch(buffer[0])
 	{
 	  case 'a':ChangeVehiclePaintjob(carbuff,0)
 	  case 'b':ChangeVehiclePaintjob(carbuff,1)
 	  case 'c':ChangeVehiclePaintjob(carbuff,2)
 	}

	buffer = strtok(tmp,index)
    // Loads all components
	for(new i;i<32;i++)
	{
	  if(strcmp(buffer,";",true) == 0) { return 1; }
	  AddVehicleComponent(carbuff,strval(buffer))
	  buffer = strtok(tmp,index)
 	}
	return 1
}
Everything is ok I think, but when I used Paintjob to 0 the cars still without paintjob.
Thanks for any help!
Reply


Messages In This Thread
Problems with paintjob - by phoenix0120 - 28.03.2009, 01:29
Re: Problems with paintjob - by ICECOLDKILLAK8 - 28.03.2009, 01:47
Re: Problems with paintjob - by phoenix0120 - 28.03.2009, 01:52
Re: Problems with paintjob - by GarD - 21.05.2011, 13:43

Forum Jump:


Users browsing this thread: 1 Guest(s)