novo Posted December 27, 2011 Posted December 27, 2011 Hi all. I have a dude with handler onPlayerReachCheckpoint. I made a function for random cars on each checkpoint. I saw on wiki, that to do something on some checkpoint the syntax is: int checkpoint And i want know how it should be, i use this one: checkpoint 1 Can somebody correct my dudes, please ? Bye.
-SOAD- Posted December 27, 2011 Posted December 27, 2011 Hey dude. int checkpoint returns you, which checkpoint were reached.. Bye dude.
GanJaRuleZ Posted December 27, 2011 Posted December 27, 2011 Heh , wtf do you mean ? If you can explain , do it...
novo Posted December 27, 2011 Author Posted December 27, 2011 Heh , wtf do you mean ?If you can explain , do it... Heh, why the Fuck are you talking badly ? If you can't talk better, don't try to help... I came here to got help, no to get answers where people talks to me badly. @-SOAD-: I want know wich is the syntax to do something on checkpoint 1,2,3... I mean, a checkpoint number, a function on each checkpoint. This is the function wich i use: addEventHandler("onPlayerReachCheckpoint", function checkpoint1 () local randomboats = math.random(454, 472) -- Random Boats if ( isPedInVehicle ( source ) ) then checkpoint 1 setElementModel ( getPedOccupiedVehicle (source), randomboats ) end end ) checkpoint 1, i mean that, to do the function when player reachs the checkpoint nº1. Bye.
-SOAD- Posted December 27, 2011 Posted December 27, 2011 addEventHandler("onPlayerReachCheckpoint", function checkpoint1 (checkpoint) local randomboats = math.random(454, 472) -- Random Boats if ( isPedInVehicle ( source ) ) then if checkpoint == 1 then setElementModel ( getPedOccupiedVehicle (source), randomboats ) end end end )
GanJaRuleZ Posted December 27, 2011 Posted December 27, 2011 1. You didn't create the checkpoint 2. You can simply make a marker o.0 local boatMarker = createMarker( x, y, z, 'cylinder', 2.0, 255, 0, 0, 150) function MarkerHit( hitElement, matchingDimension ) local randomboats = math.random(454, 472) if ( isPedInVehicle ( source ) ) then setElementModel ( getPedOccupiedVehicle (source), randomboats ) end end ) addEventHandler( "onMarkerHit", boatMarker, MarkerHit )
BinSlayer1 Posted December 27, 2011 Posted December 27, 2011 addEvent('onPlayerReachCheckpoint', true) --this is most important... since the event is CUSTOM and not built-in MTA.. --Check this: [url=https://wiki.multitheftauto.com/wiki/RU/Resource:Race]https://wiki.multitheftauto.com/wiki/RU/Resource:Race[/url] addEventHandler("onPlayerReachCheckpoint", root --you forgot this bit function(checkpoint) --i am not sure, but i dont think you can name the function if you use it like that. Afaik the function must already exist when calling it by name local randomboats = math.random(454, 472) if ( isPedInVehicle ( source ) ) then if checkpoint == 1 then setElementModel ( getPedOccupiedVehicle (source), randomboats ) end end end ) PS: What's with all the 'dude-dude-dude' thing.. 1
novo Posted December 27, 2011 Author Posted December 27, 2011 Since, i'll use BinSlayer1 code. Anyways, Thank you all !! <3
BinSlayer1 Posted December 27, 2011 Posted December 27, 2011 What happend to the dude-part? Well then. No problem, DUDE! PS: I just had to say that
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now