Jump to content
  • 0

Reparare masina


Guest Alxxie

Question

Ca sa dau viata msini scriu SetVehicleHealth.

Dar cu SetVehicleHealth imi da doar viata.Masina ramane tot stricata(aspectul de masina lovita).

Intrebarea este:Ce scriu daca vreau ca masina sa arate la loc ca-noua(sa nu fie lovita)????

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

if(strcmp(cmdtext, "/repair", true) == 0)

{

   if(GetPlayerState(playerid) == 2)

   {

       new vehicleid = GetPlayerVehicleID(playerid);

new Float:X, Float:Y, Float:Z, Float:Angle;

GetPlayerName(playerid,player,200);

GetVehiclePos(vehicleid, X, Y, Z);

GetVehicleZAngle(vehicleid, Angle);

SetVehiclePos(vehicleid, 2067.7327,-1831.5408,13.2523);

SetCameraBehindPlayer(playerid);

SetVehicleZAngle(vehicleid, 185.7243);

GameTextForPlayer(playerid, "~g~~h~~h~Repairing...", 3500, 5);

SetTimerEx("ReplaceVehicle", 3000, 0, "iffff", vehicleid, X, Y, Z, Angle);

format(string,256,"%s is repairing his vehicle. ( /repair )",player);

SendClientMessageToAll(YELLOW, string);

   }

   else return SendClientMessage(playerid, RED, "You're not in a vehicle.");

   return 1;

}

logo.png

ATENTIE!!! Nu imi trimiteti mesaje private care au legatura cu scriptingul. NU mai scriptez.

Link to comment
Share on other sites

OnFilterScript(GameMode)Init( )

{

  SetTimer( "RepairMyRide", 1, 10000 );

  return true;

}

forward RepaidMyRide( vehicleid );

public RepairMyRide( vehicleid )

{

  new

          MyRide = GetPlayerVehicleID( playerid );

  SetVehicleHealth( MyRide, 1000 );

}

Link to comment
Share on other sites

Warning: This is a new function working since SA-MP 0.3. It won't work in previous versions.

RepairVehicle(GetPlayerVehicleID(playerid));


Dar pana atunci:

if(strcmp(cmdtext, "/repair", true) == 0)
{
if(GetPlayerState(playerid) == 2)
{
new
	veid,
	model,
	Float:3[4];
veid=GetPlayerVehicleID(playerid);
model=GetVehicleModel(veid);
GetVehiclePos(veid,3[0],3[1],3[2]);
GetVehicleZAngle(veid,3[4]);
DestroyVehicle(veid);
Createvehicle(model,3[0],3[1],3[2],3[3],-1,-1,40);
}
return 1;
}


Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.