Need help with car body
#1

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

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

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"
Reply
#4

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

Are you using 0.3?
Reply
#6

edited the post i put on top of gamemode

#define RepairVehicle

just getting warning now : warning 215: expression has no effect
Reply
#7

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

my pawno version is 1.0 LOL

Is it the newest??
Reply
#9

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.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)