Jump to content

onResourceStart


tosfera

Recommended Posts

Posted

Hi,

So basicly, as far as I know. The onResourceStart is getting triggered when a player joins the server and when the resource starts / restarts. In my resourceStart I'm creating some colshapes but they don't seen to work, when I spawned Ive to restart my script in order to make the col's work...

So, a small example of my code;

function loadAllHouses () 
    local query = mysql:iselect ( "mysql", "SELECT * FROM `houses`" ); 
        for i, e in ipairs ( query ) do 
            local markerIn = createColSphere ( e["HouseMarkerInX"], e["HouseMarkerInY"], e["HouseMarkerInZ"], 1); 
        end 
    end 
end 
addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), loadAllHouses ); 

I'm not sure if I'm doing something wrong or not, I cba to create them for every single player on the client side when they spawn. ^_^"

- Thanks

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

Posted

Because you're using onResourceStart and not onClientResourceStart.

onClientResourceStart will be triggered for each individual player when the resource is downloaded and started on their computer.

onResourceStart will only be triggered once the resource is started/restarted.

If I help you in a thread and you need further assistance, please don't PM me - use the thread you created instead. This way everyone on the forum can take advantage of it.

Posted

Mhm I know, but if I'm using onClientResourceStart then I have to create the colsphere's every time when a player joins / logs in on the client side, just for them ofc. But Isn't there a way to do it server side? I don't rly care which side it is, just searching all the possible ways to kick lua on its ass haha :D

logo-small.png?v=3 tiny-sapdfr.png

 

If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]

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