Jump to content

Skysurf resource problem


KM_Rose

Recommended Posts

Hi all.

I need help, i have check this resource and i want that the surfboard spawn when i type a command.

In the server.lua i found this:

addEvent( "onSurf_shopStart", true ) 
function spawnboard(playersource) 
    local x,y,z = getElementPosition( playersource ) 
    ridecar = createVehicle ( 441, x, y+3, z) 
    surfboard = createObject ( 2410, x, y+3, z, 0, 0, 0 ) 
    setElementData ( ridecar, "purpose", "surfboard" ) 
    attachElements ( surfboard, ridecar, 0, 0, 0, 0, 0, 270) 
    setElementAlpha(ridecar, 0) 
    setElementParent ( surfboard, ridecar) 
    triggerClientEvent ( "surfboardcreated", getRootElement(), surfboard ) 
end 
[b][color=#FF0000]--addCommandHandler ( "surf", spawnboard )[/color][/b] DISABLED BECAUSE ITS LAME TO USE COMMAND HANDLERS 
addEventHandler( "onSurf_shopStart", getRootElement(), spawnboard) 

so i did this:

addEvent( "onSurf_shopStart", true ) 
function spawnboard(playersource) 
    local x,y,z = getElementPosition( playersource ) 
    ridecar = createVehicle ( 441, x, y+3, z) 
    surfboard = createObject ( 2410, x, y+3, z, 0, 0, 0 ) 
    setElementData ( ridecar, "purpose", "surfboard" ) 
    attachElements ( surfboard, ridecar, 0, 0, 0, 0, 0, 270) 
    setElementAlpha(ridecar, 0) 
    setElementParent ( surfboard, ridecar) 
    triggerClientEvent ( "surfboardcreated", getRootElement(), surfboard ) 
end 
[b][color=#FF0000]addCommandHandler ( "surf", spawnboard )[/color][/b] DISABLED BECAUSE ITS LAME TO USE COMMAND HANDLERS 
addEventHandler( "onSurf_shopStart", getRootElement(), spawnboard) 

But the surf board doesn't spawn. If i go to the surfshop and i select buy a surfboard, the surfboard doesn't spawn.

Somebody know what is the problem??

RESOURCE:

https://community.multitheftauto.com/index.php?p= ... ils&id=355

Sorry for my bad english.

Link to comment
addEvent( "onSurf_shopStart", true ) 
function spawnboard(playersource) 
    local x,y,z = getElementPosition( playersource ) 
    ridecar = createVehicle ( 441, x, y+3, z) 
    surfboard = createObject ( 2410, x, y+3, z, 0, 0, 0 ) 
    setElementData ( ridecar, "purpose", "surfboard" ) 
    attachElements ( surfboard, ridecar, 0, 0, 0, 0, 0, 270) 
    setElementAlpha(ridecar, 0) 
    setElementParent ( surfboard, ridecar) 
    triggerClientEvent ( "surfboardcreated", getRootElement(), surfboard ) 
end 
addCommandHandler ( "surf", spawnboard ) [color=#FF0000]--[/color]DISABLED BECAUSE ITS LAME TO USE COMMAND HANDLERS 
addEventHandler( "onSurf_shopStart", getRootElement(), spawnboard) 

Don't forget to delete the "DISABLED..." or add "--" to it.

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