novo Posted October 3, 2011 Share Posted October 3, 2011 (edited) Hi all. I need to make commands what just can use the people of a specific acl group. I tryed to make the code, but idk what is wrong; function pushHisFreakingAss (playerSource, command, arg1) if (arg1 == nil ) or arg1 == false then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end end addCommandHandler("push", pushHisFreakingAss) I'ts the command for "push" Please help me. ¡Bye! Edited October 3, 2011 by Guest Link to comment
Kenix Posted October 3, 2011 Share Posted October 3, 2011 Try function pushHisFreakingAss (playerSource, command, arg1) if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss) Link to comment
novo Posted October 3, 2011 Author Share Posted October 3, 2011 Ty Kenix, it's nice to have you as a Multi Lingual Moderator ;P Bye. Link to comment
Kenix Posted October 3, 2011 Share Posted October 3, 2011 Ty Kenix, it's nice to have you as a Multi Lingual Moderator ;PBye. No problem Link to comment
novo Posted October 3, 2011 Author Share Posted October 3, 2011 Can i know what did you changed ? I wanna learn ^^ Link to comment
Kenix Posted October 3, 2011 Share Posted October 3, 2011 Can i know what did you changed ?I wanna learn ^^ Sure. First Wrong if if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then Correct if isObjectInACLGroup("user." .. playerElement, aclGetGroup("VIP")) == false then Second.You forgot 2 end`s Use an editor that shows the errors in the code example: viewtopic.php?t=24834&f=91 Link to comment
novo Posted October 3, 2011 Author Share Posted October 3, 2011 Aaaah sometimes i fail writting in default notes block in windows, ty anyway. PD: Noob error ^^ Bye. Link to comment
novo Posted October 3, 2011 Author Share Posted October 3, 2011 I have now a problem, i used the code what you gave to me, but "playerElement" is a nill value. Then i'm using now this code, i added some more commands too; -------------------------- -- PUSH CMD start -- -------------------------- function pushHisFreakingAss (playerSource, command, arg1) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss) -------------------------- -- PUSH CMD end -- -------------------------- -------------------------- -- FIX CMD start -- -------------------------- function fixx ( playerSource, command ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." has fixed his self !", getRootElement(), 255, 255, 255, true) player=getLocalPlayer(playerSource) if isPedInVehicle(player) then local vehicle=getPedOccupiedVehicle(player) fixVehicle(vehicle) end end end end addCommandHandler ( "fix", fixx ) -------------------------- -- FIX CMD end -- -------------------------- -------------------------- -- NOS CMD start -- -------------------------- function nitro1 ( playerSource, command ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." gives nos to his self !", getRootElement(), 255, 255, 255, true) player=getLocalPlayer(playerSource) if isPedInVehicle(player) then local vehicle=getPedOccupiedVehicle(player) addVehicleUpgrade(vehicle,1010) end end end end addCommandHandler ( "nos", nitro1 ) -------------------------- -- NOS CMD end -- -------------------------- -------------------------- -- WARP CMD start -- -------------------------- function warpuj2(command,nazwa) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." warps to "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) nazwa=tostring(nazwa) if (nazwa) then player2=getPlayerFromName(nazwa) vehicle=getPedOccupiedVehicle(player2) x,y,z=getElementPosition(vehicle) vehicle2=getPedOccupiedVehicle(player) setElementPosition(vehicle2,x,y,z+4) end end end end addCommandHandler("warp",warpuj2) -------------------------- -- WARP CMD end -- -------------------------- Plz help Link to comment
BriGhtx3 Posted October 3, 2011 Share Posted October 3, 2011 Edit : Didn't see the local sorry Link to comment
novo Posted October 3, 2011 Author Share Posted October 3, 2011 Same problem. Please help me Link to comment
Castillo Posted October 3, 2011 Share Posted October 3, 2011 Your script is a total mess, you are using like 3 or more different variables for the player element, that'll never work. I suggest you to take a while to read your script and try to find out your error(s). Link to comment
TAPL Posted October 3, 2011 Share Posted October 3, 2011 this for push function pushHisFreakingAss (playerSource, cmd, arg1) if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(getPlayerAccount (playerSource)), aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) local hisCar = getPedOccupiedVehicle(playerElement) if playerElement and hisCar then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerSource) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8"..name.." pushes "..sourceName.."!", root, 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss) and this for fix cmd function fixx ( playerSource, cmd ) if not isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP")) then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isPedInVehicle(playerSource) then local veh = getPedOccupiedVehicle(playerSource) fixVehicle(veh) outputChatBox ("#0082D8" .. getPlayerName(playerSource) .." has fixed his self !", root, 255, 255, 255, true) end end end addCommandHandler ( "fix", fixx ) and this for nos cmd function nitro1 ( playerSource, command ) if not isObjectInACLGroup("user." ..getAccountName(getPlayerAccount(playerSource)), aclGetGroup("VIP")) then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isPedInVehicle(playerSource) then local veh = getPedOccupiedVehicle(playerSource) addVehicleUpgrade(veh,1010) outputChatBox ("#0082D8" .. getPlayerName(playerSource) .." gives nos to his self !", root, 255, 255, 255, true) end end end addCommandHandler ( "nos", nitro1 ) Link to comment
Kenix Posted October 4, 2011 Share Posted October 4, 2011 Try -------------------------- -- PUSH CMD start -- -------------------------- function pushHisFreakingAss (playerSource, command, arg1) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if (arg1 == nil ) or ( arg1 == false ) then outputChatBox ("You must to insert a valid player name.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == true then local playerElement = getPlayerFromName(arg1) if playerElement then local name = getPlayerName(playerElement) local sourceName = getPlayerName(playerElement) local theVehicle = getPedOccupiedVehicle(playerElement) local hisCar = getPedOccupiedVehicle(playerElement) local x, y, z = getElementVelocity ( hisCar ) setElementVelocity ( hisCar, x , y, z + 0.3 ) outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." pushes "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) end end end end end addCommandHandler("push", pushHisFreakingAss) -------------------------- -- PUSH CMD end -- -------------------------- -------------------------- -- FIX CMD start -- -------------------------- function fixx ( playerSource, command ) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." has fixed his self !", getRootElement(), 255, 255, 255, true) if isPedInVehicle(playerSource) then local vehicle = getPedOccupiedVehicle(playerSource) fixVehicle(vehicle) end end end end addCommandHandler ( "fix", fixx ) -------------------------- -- FIX CMD end -- -------------------------- -------------------------- -- NOS CMD start -- -------------------------- function nitro1 ( playerSource, command ) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." gives nos to his self !", getRootElement(), 255, 255, 255, true) if isPedInVehicle(playerSource) then local vehicle = getPedOccupiedVehicle(playerSource) addVehicleUpgrade(vehicle,1010) end end end end addCommandHandler ( "nos", nitro1 ) -------------------------- -- NOS CMD end -- -------------------------- -------------------------- -- WARP CMD start -- -------------------------- function warpuj2(playerSource,command,nazwa) local account = getPlayerAccount( playerSource ) if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("You aren't VIP. You can't use that command.", playerSource, 255, 12, 15, false) else if isObjectInACLGroup("user." ..getAccountName(account), aclGetGroup("VIP")) == false then outputChatBox ("#0082D8" .. getPlayerName(playerElement) .." warps to "..getPlayerName(playerSource).."!", getRootElement(), 255, 255, 255, true) nazwa=tostring(nazwa) if (nazwa) then player2=getPlayerFromName(nazwa) vehicle=getPedOccupiedVehicle(player2) local x,y,z=getElementPosition(vehicle) vehicle2=getPedOccupiedVehicle(player) setElementPosition(vehicle2,x,y,z+4) end end end end addCommandHandler("warp",warpuj2) -------------------------- -- WARP CMD end -- -------------------------- 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