xXGhostXx Posted October 1, 2018 Posted October 1, 2018 Hi guys ! i want script for enter vehicle for acl group ! Please answer me.
xXGhostXx Posted October 1, 2018 Author Posted October 1, 2018 local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) function vh ( player, seat ) if not ( pGroup ( thePlayer ) ) then return false end if seat == 0 then -- allow to sit only next to the driver cancelEvent() outputChatBox ( "#ffff00Shoma Dar Faction F.B.I Nistid!", player,240,155,15,true) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), vh ) What is problem in my code ?! ACL group can enter vehicle and other player cant enter vehicle !
KillerX Posted October 1, 2018 Posted October 1, 2018 5 minutes ago, xXGhostXx said: local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) function vh ( player, seat ) if not ( pGroup ( thePlayer ) ) then return false end if seat == 0 then -- allow to sit only next to the driver cancelEvent() outputChatBox ( "#ffff00Shoma Dar Faction F.B.I Nistid!", player,240,155,15,true) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), vh ) What is problem in my code ?! ACL group can enter vehicle and other player cant enter vehicle ! if you want it through the tables local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" Table = {} addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) if ( Table[ player ] == false or Table[ player ] == nil ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end ) if you want it by rank local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) Account_Name = getAccountName( getPlayerAccount( player ) ) if ( isObjectInACLGroup( 'user.' .. Account_Name , aclGetGroup( 'Your Group Name' ) ) == false ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end )
xXGhostXx Posted October 1, 2018 Author Posted October 1, 2018 2 minutes ago, KillerX said: if you want it through the tables local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" Table = {} addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) if ( Table[ player ] == false or Table[ player ] == nil ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end ) if you want it by rank local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) Account_Name = getAccountName( getPlayerAccount( player ) ) if ( isObjectInACLGroup( 'user.' .. Account_Name , aclGetGroup( 'Your Group Name' ) ) == false ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end ) Worked ! But player cant G in vehicle ! But other vehicle in model id cant enter or g !
KillerX Posted October 1, 2018 Posted October 1, 2018 2 minutes ago, xXGhostXx said: Worked ! But player cant G in vehicle ! But other vehicle in model id cant enter or g ! local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) Account_Name = getAccountName( getPlayerAccount( player ) ) if ( seat ~= 0 ) then return end if ( isObjectInACLGroup( 'user.' .. Account_Name , aclGetGroup( 'Your Group Name' ) ) == false ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end )
xXGhostXx Posted October 1, 2018 Author Posted October 1, 2018 4 minutes ago, KillerX said: local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) Account_Name = getAccountName( getPlayerAccount( player ) ) if ( seat ~= 0 ) then return end if ( isObjectInACLGroup( 'user.' .. Account_Name , aclGetGroup( 'Your Group Name' ) ) == false ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end ) Not work !
xXGhostXx Posted October 1, 2018 Author Posted October 1, 2018 1 minute ago, KillerX said: What do you want exactly? ACL Group Police can enter vehicle ! Other player can G in vehicle ! And spawn vehicle model by admin other player can enter
Behnam-Edit Posted October 1, 2018 Posted October 1, 2018 (edited) really? u wanna keep asking these questions to make a gamemode and tell u wrote it ur self? god bless u my friend first start learnin lua basics then start practicing mta events and functions then maybe u could write a gamemode ur self u know why im saying this? because when u cant write these basic things how u wanna write for example full functional faction system? if i want to be honest i hate guys like u who wants to abuse other peoples help, so if u wanna write a gamemode learn scripting and write it yourself and dont waste our time i respect everyone on this forum but i have to say something to all of them , dont waste ur time guys let him learn something Edited October 1, 2018 by Behnam-Edit 1 1
HɪᴅᴅᴇN Posted October 1, 2018 Posted October 1, 2018 2 minutes ago, Behnam-Edit said: really? u wanna keep asking these questions to make a gamemode and tell u wrote it ur self? god bless u my friend first start learnin lua basics then start practicing mta events and functions then maybe u could write a gamemode ur self u know why im saying this? because u cant write these basic things how u wanna write for example full functional faction system? if i want to be honest i hate guys like u who wants to abuse other peoples help, so if u wanna write a gamemode learn scripting and write it yourself and dont waste our time i respect everyone on this forum but i have to say something to all of them , dont waste ur time guys let him learn something like @Behnam-Edit made the right word 1
xXGhostXx Posted October 3, 2018 Author Posted October 3, 2018 On 01/10/2018 at 19:33, KillerX said: local policeVehicles = { {411, 1595.4, -1710.1, 5.7}, {411, 1591.6, -1710.1, 5.7}, } local police = "Police" addEventHandler("onResourceStart",resourceRoot,function() for _, v in ipairs(policeVehicles) do local veh = createVehicle(v[1],v[2],v[3],v[4]) -- spawn a car end end) addEventHandler( 'onVehicleStartEnter' , root , function( player , seat , jacked ) Account_Name = getAccountName( getPlayerAccount( player ) ) if ( seat ~= 0 ) then return end if ( isObjectInACLGroup( 'user.' .. Account_Name , aclGetGroup( 'Your Group Name' ) ) == false ) then outputChatBox( "You Don't Have Premission To Ride This Vehicle" , player , 255 , 0 , 0 , true ) cancelEvent( true ) end end ) This code fixed ! But spawn vehicle model 411 from admin cant enter vehicle !
HɪᴅᴅᴇN Posted October 4, 2018 Posted October 4, 2018 1 hour ago, xXGhostXx said: This code fixed ! But spawn vehicle model 411 from admin cant enter vehicle ! bache kuni to nemitoni sv bezani baba nemitoni!!! chera nemikhai befahmi kos madar? bayad hatman bokonam to kose madaret in kiro ? madar jende haroom zade
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