tosfera Posted November 24, 2013 Share Posted November 24, 2013 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
Dealman Posted November 24, 2013 Share Posted November 24, 2013 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. Link to comment
tosfera Posted November 24, 2013 Author Share Posted November 24, 2013 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 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now