SA-MP Forums Archive
Is this command possible? - 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: Is this command possible? (/showthread.php?tid=89217)



Is this command possible? - killdahobo99 - 31.07.2009

Is this command possible? If i go near a car and a player is in it, and i type /break [id of player] and it says

"you have screwed up the players engine" and it starts to smoke and set on fire.


How do i do it?


Re: Is this command possible? - MenaceX^ - 31.07.2009

Yeah, it is.


Re: Is this command possible? - killdahobo99 - 31.07.2009

Quote:
Originally Posted by MenaceX^
Yeah, it is.
How do i do it?


Re: Is this command possible? - Correlli - 31.07.2009

Get the closest vehicle and check distance, check if any player is in it, set vehicle's health under 240 and other things you want to do.


Re: Is this command possible? - MenaceX^ - 31.07.2009

Request it in Script Request Thread.


Re: Is this command possible? - killdahobo99 - 31.07.2009

Quote:
Originally Posted by Don Correlli
Get the closest vehicle and check distance, check if any player is in it, set vehicle's health under 240 and other things you want to do.
I understand how to do it now, but the problem is, how can i make it so it works for id's so it works on a certain id?


Re: Is this command possible? - Correlli - 31.07.2009

Quote:
Originally Posted by killdahobo99
Quote:
Originally Posted by Don Correlli
Get the closest vehicle and check distance, check if any player is in it, set vehicle's health under 240 and other things you want to do.
I understand how to do it now, but the problem is, how can i make it so it works for id's so it works on a certain id?
Search around or ask in script request topic.


Re: Is this command possible? - killdahobo99 - 31.07.2009

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by killdahobo99
Quote:
Originally Posted by Don Correlli
Get the closest vehicle and check distance, check if any player is in it, set vehicle's health under 240 and other things you want to do.
I understand how to do it now, but the problem is, how can i make it so it works for id's so it works on a certain id?
Search around or ask in script request topic.
I have searched around, and if you ask anything in the script request topic, it either doesnt get answered or it just gets bumped by many other questions by people.

This is a scripting discussion, i'm not asking for the full code, i'm asking how i could make it so it works according to id's.


Re: Is this command possible? - Correlli - 31.07.2009

Like i said: search for GetClosestVehicle function (can be found in uf.inc), use IsPlayerInVehicle function with loop for all players to see if someone is in that vehicle and set vehicle's health so it will go on fire.