SA-MP Forums Archive
Some scripts needs help - 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: Some scripts needs help (/showthread.php?tid=135256)



Some scripts needs help - XxerykxX - 19.03.2010

So i have some scripts that i need to have done ( if you will help me )
1. Flip Command

It flips the car over works perfectly but i would like to add that it fixs car to 1000hp ( brand new car )
Код:
if(!strcmp(cmdtext, "/flip", true))
	{
		new var10 = 0, Float:var11 = 0.0, Float:var12 = 0.0, Float:var13 = 0.0;
		GetPlayerPos(playerid, var11, var12, var13);
		var10 = GetPlayerVehicleID(playerid);
		SetVehiclePos(var10, var11, var12, var13);
		SetVehicleZAngle(var10, 0.0);
		return 1;
	}



Re: Some scripts needs help - ruckfules99 - 19.03.2010

Код:
SetVehicleHealth(vehicleid, 1000);
Add that to the code


Re: Some scripts needs help - ACERS - 19.03.2010

Actually with his variables:
Код:
SetVehicleHealth(var10,1000.0);



Re: Some scripts needs help - XxerykxX - 19.03.2010

hmm
Код:
error 017: undefined symbol "vehicleid"
@EDIT
Works now

2.
Savepos
I want that to SAVE the angle ( like which the front car is i hope you know what i mean ) and it is for the player it use so the other player when will type /loadpos wont get the same position and other player saved
Код:
if(strcmp(cmd, "/savepos", true) == 0) {
  GetPlayerPos(playerid,LocX, LocY, LocZ);
  GetPlayerFacingAngle(playerid,Ang);
  SendClientMessage(playerid,COLOR_GREEN,"Twoja pozycja do teleportacji została zapisana");
  return 1;
  }



Re: Some scripts needs help - Deat_Itself - 19.03.2010

new Float:angle;

Код:
GetPlayerFacingAngle(angle);


SetPlayerFacingAngle(playerid, angle);
and the brand new vehicle you can do it by SetVehicleHealth and RepairVehicle


Re: Some scripts needs help - Mike Garber - 19.03.2010

Quote:
Originally Posted by _Saif_
new Float:angle;

Код:
GetPlayerFacingAngle(angle);


SetPlayerFacingAngle(playerid, angle);
and the brand new vehicle you can do it by SetVehicleHealth and RepairVehicle
Why both?
RepairVehicle is enough, It fixes everything.


Re: Some scripts needs help - XxerykxX - 19.03.2010

ignore that script for while need this

3. Vehgod
It is like the script that repair the car fully when the car health is below 1000 ( max ) and it fixs body parts ( bumpers etc. ) There is my /fix command that fixes whole car + car parts
Код:
if(strcmp(cmdtext, "/fix", true) == 0)
{
	if(IsPlayerInAnyVehicle(playerid))
	{
	    new vehicleid = GetPlayerVehicleID(playerid);
	    RepairVehicle(vehicleid);
	}
	return 1;
}



Re: Some scripts needs help - Deat_Itself - 19.03.2010

Quote:

Why both?
RepairVehicle is enough, It fixes everything.

SetVehicleHealth only fixes the vehicle health it doesnt fixes its components and according to him he said he needs brand new , so that s why i suggest to use RepairVehicle as well.

Read his post again!


Re: Some scripts needs help - Mike Garber - 19.03.2010

Quote:
Originally Posted by _Saif_
Quote:

Why both?
RepairVehicle is enough, It fixes everything.

SetVehicleHealth only fixes the vehicle health it doesnt fixes its components and according to him he said he needs brand new , so that s why i suggest to use RepairVehicle as well.

Read his post again!
I read the post several times. You suggest him to use both SetVehicleHealth and RepairVehicle, when RepairVehicle is doing all Of It together in one function.
If It Isn't what you meant, that Is what you wrote.
So If he does like you said, It would set the vehicles health twice, wich wouldn't be neccessary.



Re: Some scripts needs help - adsy - 19.03.2010

i use this for setting vehicle health:

Код:
       if(health < 849){
         SetVehicleHealth(repveh, health+150);
       }
       else{
         RepairVehicle(repveh);
       }
I only use it for part repairs as i use it on a timer for a specific job, it means the vehicle is still destructible.

just chipping in