Jump to content

Skysurf resource problem


KM_Rose

Recommended Posts

Posted

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.

Posted

read debugging page on wiki. are you getting any errors?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

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