Jump to content

onResourceStart


tosfera

Recommended Posts

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

Link to comment

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

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