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
#2

0 = No Paintjob
Reply
#3

hmm wierd.. but when I used my command /paintjob 0 that work
Reply
#4

-1 = no paint job
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)