ALE34 Posted June 23, 2013 Posted June 23, 2013 i need help with my GUMBALL race this is gonna be kind of a minigame im noob at scripting so it was really hard to go this far sorry for bad enslish -- start: 2768, 2455, 14 -- 1. checkpoint : 406, 2507, 17 -- 2. checkpoint : -2330, -1614, 484 -- 3. checkpoint : -1890, -2423, 33 -- 4. checkpoint : -1170, -2640, 12 -- 5. checkpoint : -24, -2510, 37 -- 6. checkpoint : -789, 2424, 157 -- 7. checkpoint : -2257, 2296, 5 -- goal : -7478, -329, 24 local gumballTable = { [1] = "406,2507,17", [2] = "-2330,-1614,484", [3] = "-1890,-2423,33", [4] = "-1170,-2640,12", [5] = "-24,-2510,37", [6] = "-789,2424,157", [7] = "-2257,2296,5" [8] = "-7478,-329,24" } function startrace ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if vehicle then x, y, z = [1] setElementPostion ( getLocalPlayer, 2768, 2455, 14 ) local piste = createMarker ( x, y, z, "checkpoint", 10.0, 255, 0, 0, 255 if ( piste ) then x, y, z = [1] createBlip ( x, y, z, 0, 255 , 0, 0 ) end end end function miss ( src, cmd ) local auto = getPedOccupiedVehicle ( src ) if auto then outputChatBox ("Kisa Alkakoon!", src, 255, 0, 0) else outputChatBox ("Tarvitset Auton!", src, 255, 0, 0) end end addCommandHandler ( "gumball", miss ) addCommandHandler ( "gumball", startrace )
xXMADEXx Posted June 23, 2013 Posted June 23, 2013 You cant just say you need help. What part(s) do you need help with?
iMr.3a[Z]eF Posted June 23, 2013 Posted June 23, 2013 i need help with my GUMBALL race this is gonna be kind of a minigame im noob at scripting so it was really hard to go this far sorry for bad enslish -- start: 2768, 2455, 14 -- 1. checkpoint : 406, 2507, 17 -- 2. checkpoint : -2330, -1614, 484 -- 3. checkpoint : -1890, -2423, 33 -- 4. checkpoint : -1170, -2640, 12 -- 5. checkpoint : -24, -2510, 37 -- 6. checkpoint : -789, 2424, 157 -- 7. checkpoint : -2257, 2296, 5 -- goal : -7478, -329, 24 local gumballTable = { [1] = "406,2507,17", [2] = "-2330,-1614,484", [3] = "-1890,-2423,33", [4] = "-1170,-2640,12", [5] = "-24,-2510,37", [6] = "-789,2424,157", [7] = "-2257,2296,5" [8] = "-7478,-329,24" } function startrace ( thePlayer ) local vehicle = getPedOccupiedVehicle ( thePlayer ) if vehicle then x, y, z = [1] setElementPostion ( getLocalPlayer, 2768, 2455, 14 ) local piste = createMarker ( x, y, z, "checkpoint", 10.0, 255, 0, 0, 255 if ( piste ) then x, y, z = [1] createBlip ( x, y, z, 0, 255 , 0, 0 ) end end end function miss ( src, cmd ) local auto = getPedOccupiedVehicle ( src ) if auto then outputChatBox ("Kisa Alkakoon!", src, 255, 0, 0) else outputChatBox ("Tarvitset Auton!", src, 255, 0, 0) end end addCommandHandler ( "gumball", miss ) addCommandHandler ( "gumball", startrace ) debugscript 3 ???
iPrestege Posted June 23, 2013 Posted June 23, 2013 setElementPostion ( getLocalPlayer, 2768, 2455, 14 ) To : setElementPosition ( element, 2768, 2455, 14 ) getLocalPlayer it's a client side player only.
PaiN^ Posted June 24, 2013 Posted June 24, 2013 I'v fixed some errors, Try : -- start: 2768, 2455, 14 -- 1. checkpoint : 406, 2507, 17 -- 2. checkpoint : -2330, -1614, 484 -- 3. checkpoint : -1890, -2423, 33 -- 4. checkpoint : -1170, -2640, 12 -- 5. checkpoint : -24, -2510, 37 -- 6. checkpoint : -789, 2424, 157 -- 7. checkpoint : -2257, 2296, 5 -- goal : -7478, -329, 24 local gumballTable = { { 406, 2507, 17 }, { -2330, -1614, 484 }, { -1890, -2423, 33 }, { -1170, -2640, 12 }, { -24, -2510, 37 }, { -789, 2424, 157 }, { -2257, 2296, 5 }, { -7478, -329, 24 } } function startrace( thePlayer ) local vehicle = getPedOccupiedVehicle( thePlayer ) if vehicle then local x, y, z = unpack( gumballTable[1] ) setElementPosition( thePlayer, 2768, 2455, 14 ) local piste = createMarker( x, y, z, "checkpoint", 10.0, 255, 0, 0, 255 ) if piste then createBlipAttachedTo( piste ) end end end function miss( src, cmd ) local auto = getPedOccupiedVehicle( src ) if auto then outputChatBox( "Kisa Alkakoon!", src, 255, 0, 0 ) else outputChatBox( "Tarvitset Auton!", src, 255, 0, 0 ) end end addCommandHandler( "gumball", miss ) addCommandHandler( "gumball", startrace )
Mossy Posted June 24, 2013 Posted June 24, 2013 For the second time, not telling us what the problem is is not gonna help us fix your problem. Refer to: viewtopic.php?f=91&t=47897
ALE34 Posted June 24, 2013 Author Posted June 24, 2013 i need help for triggering the next checkpoint creation when you hit the 1st checkpoint it creates 2nd
denny199 Posted June 24, 2013 Posted June 24, 2013 Create it client side, with table's and variables like: You still need to edit it for yourself. local checkpoint = 1 local table = { [1] = { 0,4,6 }, [2] = { 0,67, 5} --etc } function createNextMarker(hitElement) if hitElement == getLocalPlayer() then checkpoint = checkpoint + 1 --unpack the table here with the checkpoint table --and attach everything what you want on it. end end addEventHandler ( "onClientMarkerHit", resourceRoot, createNextMarker ) addEventHandler ( "onClientResourceStart", resourceRoot, function () -- make here your first marker with unpack(table[1]) and createMarker end)
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