SA-MP Forums Archive
Problems with paintjob - 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: Problems with paintjob (/showthread.php?tid=70835)



Problems with paintjob - phoenix0120 - 28.03.2009

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!


Re: Problems with paintjob - ICECOLDKILLAK8 - 28.03.2009

0 = No Paintjob


Re: Problems with paintjob - phoenix0120 - 28.03.2009

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



Re: Problems with paintjob - GarD - 21.05.2011

-1 = no paint job