nasserdfdd Posted August 12, 2015 Share Posted August 12, 2015 hi all so i made a vehicle mod for a people with acl admin but when i start and enter veh no error or change in vehicle script function enterVehicle () if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then txd = engineLoadTXD("infernus.txd", 411 ) --this is veh id engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) else outputChatBox("Only acl admin have shader", 0, 255, 0, false) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) Link to comment
KariiiM Posted August 12, 2015 Share Posted August 12, 2015 Dude; you're wrong, -Put this part only in client side since it's client sided only. txd = engineLoadTXD("infernus.txd", 411 ) --this is veh id engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) and other part is server side only, so you have to put it in server side, be carefull. -Don't forget to add them to META,and you didn't explain your problem as well, also i didn't understand what you trying to do Link to comment
nasserdfdd Posted August 12, 2015 Author Share Posted August 12, 2015 sorry can u make it for me meta "nasser." version="1.0" name="inferus mod for admin" type="misc" /> inf_c.lua function enterVehicle () if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then txd = engineLoadTXD("infernus.xd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) else outputChatBox("Only acl admin have shader", 0, 255, 0, false) end end addEventHandler ( "onPlayerEnterVehicle", getRootElement(), enterVehicle ) can u make it for me cuz i did not understand u edit:i want the mod only for acl admin but every one see the modded of the admin vehicle when he enter it if u did not understand pls tell me Link to comment
KariiiM Posted August 12, 2015 Share Posted August 12, 2015 (edited) These functions are server side only and you put them in client side,so it will not works. What i understand from what you trying to do, is you want let only the player who is in ACL he who can use the vehicle ? isObjectInACLGroup getAccountName getPlayerAccount aclGetGroup Edited August 12, 2015 by Guest Link to comment
nasserdfdd Posted August 12, 2015 Author Share Posted August 12, 2015 can u give me any simple example Link to comment
KariiiM Posted August 12, 2015 Share Posted August 12, 2015 the player who is in ACL he who can use the vehicle ? Answer my question to let me know about what you want to do Link to comment
nasserdfdd Posted August 12, 2015 Author Share Posted August 12, 2015 edit:i want the mod only for acl admin but every one see the modded of the admin vehicle when he enter it if u did not understand pls tell me i already told u so please tell me how Link to comment
Malak Posted August 12, 2015 Share Posted August 12, 2015 You need to say if the admin will have an another vehicle of normal players, then you make like he said at client-side the code for load TXD/DFF for ALL and you only give this type of vehicle for players. If you want different skins for same vehicle its not possible (u can but normal player will see their skin and not the admin skin, and admin skin will see player skin). I hope ou will understand. You need to be clear. Link to comment
nasserdfdd Posted August 12, 2015 Author Share Posted August 12, 2015 ok i want admin to see his skin and player see their skin Link to comment
KariiiM Posted August 12, 2015 Share Posted August 12, 2015 --server side: local infernus = {[411]=true} addEventHandler ( "onVehicleStartEnter", crimainlTheftVehicle, function ( player, seat ) if ( seat == 0 ) then if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then local theVehicle = source local vehModel = getElementModel(theVehicle) if (infernus[vehModel]) then return end else cancelEvent ( ) outputChatBox ( "You cannot enter this vehicle,Only Admin can.", player, 255, 0, 0 ) end end end) --client side: addEventHandler ( "onClientResourceStart" , resourceRoot , function ( ) txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end ) --meta.xml should be like that: Link to comment
nasserdfdd Posted August 12, 2015 Author Share Posted August 12, 2015 bad argument @ 'addeventhandler' [expected element at argument 2 got nil i get this eroor and i dont get any mod edit i now see all car mooded let try to reconnect with no admin right Link to comment
nasserdfdd Posted August 12, 2015 Author Share Posted August 12, 2015 every one can see the car if he is out in sider the car and if he is admin or no why pls help Link to comment
KariiiM Posted August 12, 2015 Share Posted August 12, 2015 Be sure the files names are the same as in meta Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 pls help all have the vehicle mooded and there is error warrning : test\server.lua:2: Bad argument @ 'addEventHandler' [Expected element at argument 2,got nil] so anyone pls help Link to comment
HUNGRY:3 Posted August 13, 2015 Share Posted August 13, 2015 Your scripting skills 92% awesome local infernus = {[411]=true} addEventHandler ( "onVehicleStartEnter", root, function ( player, seat ) if ( seat == 0 ) then if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" ) ) then local theVehicle = source local vehModel = getElementModel(theVehicle) if (infernus[vehModel]) then return end else cancelEvent ( ) outputChatBox ( "You cannot enter this vehicle,Only Admin can.", player, 255, 0, 0 ) end end end) Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 so can any one help i want every one can enter the infernus but the mod only is made for acl admin is it possible so pls any one give me example Link to comment
HUNGRY:3 Posted August 13, 2015 Share Posted August 13, 2015 Client function enterveh () triggerServerEvent("check",localPlayer) txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) else outputChatBox("Only acl admin have shader", 0, 255, 0, false) end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), enterveh ) Server function lol(thePlayer) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then end end addEvent("check",true) addEventHandler("check",root,lol) Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 it does not mod the vehicle when i enter nor when i am out of vehicle there is no errors edit : i worte debug script 3 then i found the following error loading script failed:test\client.lua:8:(to close function at line 2) near else Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 i fixed it and i got this error warrnign test\server.lua:3: bad argument @ getplayeraccount' expected element at argument 1,got boolean seond test\serverlua:3: attemept to concatentate a boolean value and they get me out of vehicle Link to comment
HUNGRY:3 Posted August 13, 2015 Share Posted August 13, 2015 (edited) My bad Edited August 13, 2015 by Guest Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 warrnign test\server.lua:3: bad argument @ getplayeraccount' expected element at argument 1,got boolean seond test\serverlua:3: attemept to concatentate a boolean value and they get me out of vehicle i get the same error Link to comment
HUNGRY:3 Posted August 13, 2015 Share Posted August 13, 2015 function permission (player) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then end end addEvent("check",true) addEventHandler("check",root,permission) ლ(ಠ益ಠ)ლ damn Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 i get this error warrning test\server.lua:2: bad argument @ getplayeraccount' expected element at argument 1,got nil warrning test\server.lua:2: bad argument @ getplayername' expected element at argument 1,got boolean seond test\serverlua:3: attemept to concatentate local 'accname'(a boolean value) Link to comment
HUNGRY:3 Posted August 13, 2015 Share Posted August 13, 2015 It's server side? Show meta Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 ok meta server function permission (player) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then end end addEvent("check",true) addEventHandler("check",root,permission) client function enterveh () triggerServerEvent("check",localPlayer) txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), enterveh ) 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