SA-MP Forums Archive
Need help with car body - 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: Need help with car body (/showthread.php?tid=129050)



Need help with car body - XxerykxX - 20.02.2010

Hello guys.

I made a small script:

Code:
	if(strcmp(cmdtext, "/fix", true) == 0)
  {
  if(IsPlayerInAnyVehicle(playerid))
  {
  new Float:x, Float:y, Float:z;
  new vehid; new modelid; new Float:rot;
  vehid = GetPlayerVehicleID(playerid);
  modelid = GetVehicleModel(vehid);
  GetVehiclePos(vehid, x, y, z);
  GetVehicleZAngle(vehid, rot);
  DestroyVehicle(vehid);
  CreateVehicle(modelid, x, y, z, rot, -1, -1, 6666);
  SetVehiclePos(vehid, x, y, z);
  PutPlayerInVehicle(playerid, vehid, 0);
  }
  return 1;
  }
But when i type /fix for example im in elegy when i type in /fix the car jumps and it changes color + the player that sits beside you exit the car. I would like to have that command without jumping changing color and the player exiting the car. Or the command /vehgod that if your car has below 999hp it fixs with changing car body.

Thanks, Eryk


Re: Need help with car body - gotenks918 - 20.02.2010

Why not use the function RepairVehicle() ?
Code:
if(strcmp(cmdtext, "/fix", true) == 0)
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
	    RepairVehicle(vehicleid);
	}
	return 1;
}



Re: Need help with car body - XxerykxX - 20.02.2010

can you explain me or just give me script :/

getting

Code:
error 017: undefined symbol "RepairVehicle"
    warning 204: symbol is assigned a value that is never used: "vehicleid"



Re: Need help with car body - gotenks918 - 20.02.2010

Just edited post, i'm also new scripting not sure if it will work XD


Re: Need help with car body - gotenks918 - 20.02.2010

Are you using 0.3?


Re: Need help with car body - XxerykxX - 20.02.2010

edited the post i put on top of gamemode

#define RepairVehicle

just getting warning now : warning 215: expression has no effect


Re: Need help with car body - gotenks918 - 20.02.2010

You shouldn't need to define the function, it's built in to 0.3


Re: Need help with car body - XxerykxX - 20.02.2010

my pawno version is 1.0 LOL

Is it the newest??


Re: Need help with car body - gotenks918 - 20.02.2010

It's not the pawno version you need to worry about... Go on to the main sa-mp website and look for the 0.3a server files, download them and try and recompile with that.


Re: Need help with car body - XxerykxX - 20.02.2010

I do have now i get you so can you help me with it ??