Jokeℝ1472771893 Posted May 19, 2012 Author Share Posted May 19, 2012 i whant it for hydra and that only for Admins Link to comment
Castillo Posted May 19, 2012 Share Posted May 19, 2012 Use the event: onVehicleEnter and the functions: getPlayerAccount getAccountName isObjectInACLGroup Link to comment
Jokeℝ1472771893 Posted May 19, 2012 Author Share Posted May 19, 2012 Use the event: onVehicleEnter and the functions: getPlayerAccount getAccountName isObjectInACLGroup nononono not for only admins hydra i whan't that only Admins car never broke(BLOW up) Link to comment
Stanley Sathler Posted May 19, 2012 Share Posted May 19, 2012 Lazy member... the functions already were posted. P.S: Is not "whant", is "want". There's not letter "h". Link to comment
Jokeℝ1472771893 Posted May 19, 2012 Author Share Posted May 19, 2012 Lazy member... the functions already were posted.P.S: Is not "whant", is "want". There's not letter "h". yeh yeh sorry :) i type very fast Link to comment
Jaysds1 Posted May 19, 2012 Share Posted May 19, 2012 The functions already were posted. You could use those functions and use the event handler onVehicleDamage or, if the admin goes in to the car, set it damage proofed setVehicleDamageProof Link to comment
Jokeℝ1472771893 Posted May 19, 2012 Author Share Posted May 19, 2012 newvehicle = createVehicle(602, 0, 0, 6) 602 is ID of car 0, -? 0, -? 6, -??????????????? Link to comment
Jaysds1 Posted May 19, 2012 Share Posted May 19, 2012 (edited) here: x: A floating point number representing the X coordinate on the map.y: A floating point number representing the Y coordinate on the map. z: A floating point number representing the Z coordinate on the map. Main_Page Edited May 19, 2012 by Guest Link to comment
X-SHADOW Posted May 19, 2012 Share Posted May 19, 2012 0 = x 0 = y 6 = z and you Can get Them by Admin Panel --serverSide function damage (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then local driver = getVehicleOccupant ( thePlayer) if ( driver ) then setVehicleDamageProof(driver, true) outputChatBox('Your vehicle is Damage Proof',thePlayer,255,255,0) else outputChatBox('You Must Be Admin to do this',thePlayer,255,255,0) end end end addEventHandler ( "onVehicleEnter", getRootElement(), damage ) Link to comment
Stanley Sathler Posted May 20, 2012 Share Posted May 20, 2012 X-Shadow, your code won't work. You must change getVehicleOccupant() to getPedOccupiedVehicle(). The first function returns the player and the second returns the vehicle. Link to comment
Jokeℝ1472771893 Posted May 20, 2012 Author Share Posted May 20, 2012 here:x: A floating point number representing the X coordinate on the map.y: A floating point number representing the Y coordinate on the map. z: A floating point number representing the Z coordinate on the map. Main_Page this is make car in some location which never blow up? Link to comment
Jaysds1 Posted May 20, 2012 Share Posted May 20, 2012 (edited) newvehicle = createVehicle(602, 0, 0, 6) 602 is ID of car 0, -? 0, -? 6, -??????????????? here:model: The vehicle ID of the vehicle being created. x: A floating point number representing the X coordinate on the map. y: A floating point number representing the Y coordinate on the map. z: A floating point number representing the Z coordinate on the map. Main_Page try this, Server-side: addEventHandler("onVehicleEnter",root,function(player,seat,jacked) if(player)and(seat==0)then acc = getAccountName(getPlayerAccount(player)) if(isObjectInACLGroup("user."..acc,aclGetGroup("Admin")))then setVehicleDamageProof(source,true) end end end) Edited May 20, 2012 by Guest Link to comment
Stanley Sathler Posted May 20, 2012 Share Posted May 20, 2012 Joker, you must learn LUA! You're trying create a server and you don't know absolutely NOTHING about LUA. Everytime you're asking here for a script ready. - Jaysds, bro, don't make codes to Joker. If you read the other topics created by him, you'll see: he's a big lazy member. He don't want learn LUA, he don't want work. Link to comment
Jaysds1 Posted May 20, 2012 Share Posted May 20, 2012 ok, sorry JokeR, You have to either pay a scripter or learn LUA your self... Here's a topic for more lua sites: viewtopic.php?f=148&t=40809 Link to comment
mjr Posted May 20, 2012 Share Posted May 20, 2012 Lazy member... the functions already were posted.P.S: Is not "whant", is "want". There's not letter "h". yeh yeh sorry :) i type very fast how it's possible to press "H" button when buttons with letters "W" and "A" are not even close to it? ps. "whant" was hilarious Link to comment
Smart. Posted May 20, 2012 Share Posted May 20, 2012 Just because StanleySathler corrected him about "whant" I'm gonna correct you all with saying that it isn't "LUA" it's "Lua" And what I could see you never checked the vehicle model? But as StanleySathler said, I've seen several topics from this "Joker" guy where he requests us to script, he doesn't even try himself. Link to comment
myonlake Posted May 20, 2012 Share Posted May 20, 2012 (edited) I don't see how hard it is to make this script work from you guys. It's a simple script guys. local hydra = createVehicle(model, x, y, z) addEventHandler("onVehicleEnter", root, function(player, seat, jacked) if isGuestAccount(getPlayerAccount(player)) then return end if seat == 0 then if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) then setVehicleDamageProof(hydra, true) setVehicleDoorsUndamageable(hydra, true) else setVehicleDamageProof(hydra, false) setVehicleDoorsUndamageable(hydra, false) end end end ) Don't understand anything from this script? I suggest to learn lua first. Scripting Introduction to MTA:SA Edited May 20, 2012 by Guest Link to comment
Stanley Sathler Posted May 20, 2012 Share Posted May 20, 2012 myonlake, is not hard. But we are not free scripters, then we don't wanna create a free script. If you read what I said, you'll see that JokeR is lazy and don't wanna work. Your example does work, but not for only admins. For it, you must increment to Jaysds example, getting the group of ACL. Link to comment
myonlake Posted May 20, 2012 Share Posted May 20, 2012 Edited my code. @Jaysds1: I suppose you didn't pay attention to the 'jacked' part there, since in my opinion, it makes no sense if the admin entering the car can only set the vehicle invincible if he doesn't jack it from a player. So you can just take off the part where the 'jacked' is mentioned. Link to comment
Jaysds1 Posted May 20, 2012 Share Posted May 20, 2012 thanks for telling me that, at the time I was working between scripts and was thinking of a person jacking it instead of the admin... thanks anyways 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