Jump to content

[HELP] GUMBALL RALLY


ALE34

Recommended Posts

i need help with my GUMBALL race :D

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 :mrgreen:

  
-- 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 ) 
  
  

Link to comment
i need help with my GUMBALL race :D

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 :mrgreen:

  
-- 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 ???

Link to comment

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 ) 

Link to comment

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) 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...