Jump to content

tosfera

Members
  • Posts

    1,193
  • Joined

  • Last visited

Everything posted by tosfera

  1. Maybe try this; copVehicles = { [523] = true, [598] = true, [596] = true, [597] = true, [599] = true } addEventHandler ( "onVehicleStartEnter", root, function ( thePlayer, seat, jacked ) if ( getElementType ( thePlayer ) == "player" ) then local team = getPlayerTeam ( thePlayer ); if ( team ) then if ( ( copVehicles [ getElementModel ( source ) ] ) and not ( team == getTeamFromName ( "Police" ) ) ) then cancelEvent(); outputChatBox ( "You can't use this vehicle", thePlayer, 255, 0, 0, true ); end end end end ); Just woke up, can be garbage.
  2. Hello Forumuser, That's true, because you're checking if the newHealth is bigger than 0 so lets say... it is 15. Then you're cancel the event, and set its health. Try switching the setElementHealth and cancelEvent().
  3. I'm not sure if an vehicle gets an ID automaticly, but you can always set your own ID if you're creating an advanced vehicle system, like saving them for players etc. If so, just set and get it's element data which you set. setElementData ( vehicleVar, "vehicleid", ); getElementData ( vehicleVar, "vehicleid" );
  4. setPedControlState (guard, "forwards", true), where did you define 'guard'...
  5. ^ see, Solid and mint3d quite gave you a vouch and other people are starting to reply.
  6. The main thing is, using client side scripting allows you to do things only for 1 player without affecting the server. So, you could let the player do a 100 tasks on client side and the other players wont have any trouble with it.
  7. In his script, he's replacing the 1 till 20 with other bones, you can try to work around that and use GetPedBonePosition to get the position of bone 3,4 or 5. Whatever suits you the best. See if that works.
  8. 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
  9. 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
  10. Well you can always add that invite command, add a table to it and whenever the guest types the /join check if the is in the table. Then set its team.
  11. Thanks x
  12. Hey, Is it possible to attach an element to a ped's bone? Thanks.
  13. Class is an elementData ( as far as I know ), you should set the players data. setElementData
  14. As a starter, you should use the default db functions. Why? Cause they are protected against mysql injections and that kind of stuff, if you want to take a step higher and want to take the risk to get injections; use the mysql module. I'd go for the mysql module cause of the less limitations in the queries. But it's alot less safe.
  15. Cause of your if-statement here; if team and DeathmatchTeam then should be; if ( team ) then if ( team == DeathmatchTeam ) then but not sure whats wrong with the dimension, getting any error like; bad argument @?
  16. 1. getTeamName ( getPlayerTeam ( source ) ) == "" 2. setElementDimension
  17. It's not an idea, it has to be done like that. Try this; server; addCommandHandler ( "shp", function ( thePlayer ) triggerClientEvent ( "getHealth", thePlayer ); end ); addEvent ( "saveHealth", true ); addEventHandler ( "saveHealth", root, function ( thePlayer, health ) outputChatBox ( "You have ".. health .." hp.", thePlayer ); end ); client; addEvent ( "getHealth", true ); addEventHandler ( "getHealth", root, function () local health = getElementHealth ( getLocalPlayer() ); triggerServerEvent ( "saveHealth", getLocalPlayer(), getLocalPlayer(), health ); end ); but why do you want to do a trigger to the clientside just to get the hp of the localPlayer, can be done way easier with just one single thing; addCommandHandler ( "shp", function ( thePlayer ) local health = getElementHealth ( thePlayer ); outputChatBox ( "You got ".. health .." hp.", thePlayer ); end );
  18. You're forgetting one thing, you are adding the events. But you aren't telling the system what these events are doing, you should add an addEventHandler to it. Like so; function savehp ( playerHealth ) outputChatBox ( tostring ( playerHealth ) ); end addEvent ( "savehp", true ); addEventHandler ( "savehp", getRootElement(), savehp );
  19. Welke pagina's moeten er vertaald worden? Als ik mij verveel zal ik er wel een oog op werpen voor je.
  20. Success met zoeken! Er zijn mensen die betaald willen worden, maar probeer dit dan ook in de engelse sectie te plaatsen. Zelf heb ik het al aardig druk anders had ik je wel geholpen.
  21. Vergeet niet, je moet alle files ook in je meta file zetten. Veel mensen vergeten dit.
  22. Hoe je het heel makkelijk kan doen is zo; addEventHandler ( "onClientPlayerRadioSwitch", getLocalPlayer(), function ( radio ) if not ( radio == 0 ) then if ( getVehicleType ( getPedOccupiedVehicle ( source ) ) == "plane" ) then playSound ( "http://d.liveatc.net/kjfk_twr" ); end end end ); Het veranderen van de radiozender kan effect hebben hierop, je kan daar wel een beveiliging op zetten.
  23. tosfera

    Collisions

    Ya but that takes time, and it are quite a few objects. There is a work around for it though, you just have to select every object that has been streamed in an put them in a table. Just not sure how you could trigger it after it. It's the way that the editor is using ( E => high_sensitivity_mode ).
  24. I wont give you an entire script. You are learning so all I can say is goodluck.
  25. math.random returns an random int between 0 to 1. You've to give 2 parameters to it to get another int, since you are giving a int, 2x string and 1x int again. It will never work. Split the 2 functions; local rand = math.random ( 0, 2 ); addPedClothes ( player, "player_torso", "torso", rand );
×
×
  • Create New...