Synthe1 Posted August 18, 2018 Share Posted August 18, 2018 Hello community, I need your help with script, I want to make this command only for VIP group but I don't know how, one thing I know is that I have to use: if isObjectInACLGroup Can you help me please? function addPaintjob(commandName,paintjobID) me = getLocalPlayer() if isPedInVehicle ( me ) then triggerServerEvent ( "addPJ", resourceRoot, tonumber(paintjobID), me ) end end addCommandHandler ("addpaintjob",addPaintjob) function addPaintjob2(paintjobID,player) if paintjobID == 1 then myTexture = dxCreateTexture( "paintjob1.png" ) elseif paintjobID == 2 then myTexture = dxCreateTexture( "paintjob2.png" ) elseif paintjobID == 3 then myTexture = dxCreateTexture( "paintjob3.png" ) elseif paintjobID == 4 then myTexture = dxCreateTexture( "paintjob4.png" ) elseif paintjobID == 5 then myTexture = dxCreateTexture( "paintjob5.png" ) elseif paintjobID == 6 then myTexture = dxCreateTexture( "paintjob6.jpg" ) elseif paintjobID == 7 then myTexture = dxCreateTexture( "paintjob7.jpg" ) elseif paintjobID == 8 then myTexture = dxCreateTexture( "paintjob8.jpg" ) elseif paintjobID == 9 then myTexture = dxCreateTexture( "paintjob9.jpg" ) else if player == getLocalPlayer() then outputChatBox ("There is no such paintjob ID!") return end end engineRemoveShaderFromWorldTexture ( shader_cars, "vehiclegrunge256", getPedOccupiedVehicle(player) ) shader_cars, tec = dxCreateShader ( "shader.fx" ) engineApplyShaderToWorldTexture ( shader_cars, "vehiclegrunge256", getPedOccupiedVehicle(player) ) dxSetShaderValue ( shader_cars, "TX0", myTexture ) end addEvent( "addPJ2", true ) addEventHandler( "addPJ2", getLocalPlayer(), addPaintjob2 ) Link to comment
Discord Moderators Pirulax Posted August 18, 2018 Discord Moderators Share Posted August 18, 2018 Create the command server-side, and just do a triggerClientEvent. Link to comment
Mr.Loki Posted August 18, 2018 Share Posted August 18, 2018 local ValidIDs = { -- Create a table with valid paintjob ids [1]=true, [2]=true, [3]=true, [4]=true, [5]=true, [6]=true, [7]=true, [8]=true, [9]=true } function addPaintjob(player,_,paintjobID) local acc = getAccountName( getPlayerAccount( player ) ) -- get player account name if not isObjectInACLGroup( "user."..acc, aclGetGroup( "VIP" ) ) then return end -- chekck if player is in ACL 'VIP' and if not then return if tonumber(paintjobID) and ValidIDs[paintjobID] then -- Check if the ID is Valid if isPedInVehicle ( player ) then -- Check if the player is in a vehicle triggerClientEvent( root, "addPJ", resourceRoot, paintjobID, player ) -- trigger the client event setting the player who used the command as the source else outputChatBox( "You are not in a vehicle.", player, 255,100,100 ) end else outputChatBox( "Invalid Paintjob ID.", player, 255,100,100 ) end end addCommandHandler ("addpaintjob",addPaintjob) This is serverside. Also you should store the shaders and textures within a table and delete them when they are no longer needed because i can drain your memory after constant use. 1 Link to comment
xXGhostXx Posted August 18, 2018 Share Posted August 18, 2018 2 minutes ago, Mr.Loki said: local ValidIDs = { -- Create a table with valid paintjob ids [1]=true, [2]=true, [3]=true, [4]=true, [5]=true, [6]=true, [7]=true, [8]=true, [9]=true } function addPaintjob(player,_,paintjobID) local acc = getAccountName( getPlayerAccount( player ) ) -- get player account name if not isObjectInACLGroup( "user."..acc, aclGetGroup( "VIP" ) ) then return end -- chekck if player is in ACL 'VIP' and if not then return if tonumber(paintjobID) and ValidIDs[paintjobID] then -- Check if the ID is Valid if isPedInVehicle ( player ) then -- Check if the player is in a vehicle triggerClientEvent( root, "addPJ", resourceRoot, paintjobID, player ) -- trigger the client event setting the player who used the command as the source else outputChatBox( "You are not in a vehicle.", player, 255,100,100 ) end else outputChatBox( "Invalid Paintjob ID.", player, 255,100,100 ) end end addCommandHandler ("addpaintjob",addPaintjob) This is serverside. Also you should store the shaders and textures within a table and delete them when they are no longer needed because i can drain your memory after constant use. Please answer me job system please ! @Mr.Loki Link to comment
WorthlessCynomys Posted August 18, 2018 Share Posted August 18, 2018 addCommandHandler has a restricted argument. Setting that to true and adding the permission to the group in the acl will do the thing. 1 1 Link to comment
Mr.Loki Posted August 18, 2018 Share Posted August 18, 2018 10 minutes ago, xXGhostXx said: Please answer me job system please ! @Mr.Loki The guy above me already gave you an answer. I don't help people who can't make an effort to help themselves(Unless you pay me ofcourse). Also Do not hijack threads you can get your account removed. Link to comment
Synthe1 Posted August 18, 2018 Author Share Posted August 18, 2018 Thanks all, can be locked. 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