devildead622 Posted March 4, 2013 Posted March 4, 2013 I'm doing a system vip for my server, and I need help with some things! First I want to know what function to give the weapon a player.
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 Thanks! You can analyze my complete code, to see if there is some mistake? function givekit2( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then if not tempokit2 then giveWeapon ( source, 31, 300 ) --Give M4 giveWeapon ( source, 34, 80 ) -- Give Sniper Rifle tempokit2 = true setTimer(set1hora,3600000,1,player) end end end addCommandHandler("kitvippremiun",givekit2) function set1hora() tempokit2 = false end function givekit1( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then if not tempokit1 then giveWeapon ( source, 29, 300 ) --Give MP5 giveWeapon ( source, 34, 10 ) -- Give Sniper Rifle tempokit1 = true setTimer(set30mim,1800000,1,player) end end end addCommandHandler("kitvip",givekit1) function set30mim() tempokit1 = false end function givebike( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then local x,y,z= getElementPosition(player) veh = createVehicle(509, x+1, y, z) warpPedIntoVehicle(player, veh) end end addCommandHandler("bikevip",givebike)
PaiN^ Posted March 4, 2013 Posted March 4, 2013 You should start it at your server and see if it works .. If it wasn't, Then debug your script with debugscript 3 ( Wright it at the console ..! ) And then if you couldn't fix it yourself, We'll help you ^^
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 Just want to know if something is wrong or missing, because I never did a script for mta. I thought alquem who knows more could help me with the system I'm doing, I'm just asking for a little help to see if there's something wrong.
iPrestege Posted March 4, 2013 Posted March 4, 2013 if use source it won't work try this : function givekit2( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then if not tempokit2 then giveWeapon ( player, 31, 300 ) --Give M4 giveWeapon ( player, 34, 80 ) -- Give Sniper Rifle tempokit2 = true setTimer(set1hora,3600000,1,player) end end end addCommandHandler("kitvippremiun",givekit2) function set1hora() tempokit2 = false end function givekit1( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then if not tempokit1 then giveWeapon ( player, 29, 300 ) --Give MP5 giveWeapon ( player, 34, 10 ) -- Give Sniper Rifle tempokit1 = true setTimer(set30mim,1800000,1,player) end end end addCommandHandler("kitvip",givekit1) function set30mim() tempokit1 = false end function givebike( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then local x,y,z= getElementPosition(player) veh = createVehicle(509, x+1, y, z) warpPedIntoVehicle(player, veh) end end addCommandHandler("bikevip",givebike) ((=
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 Thank you! It was copied the wiki = D But the rest this correct? Also can tell me if there is a function for destroir the vehicle?
PaiN^ Posted March 4, 2013 Posted March 4, 2013 Also can tell me if there is a function for destroir the vehicle? You can use destroyElement
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 Thanks! And how do I activate a setTimer, after pressing enter, to leave the "veh" (in case the bike/ID:509 that was created) of the function below? function givebike( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then local x,y,z= getElementPosition(player) veh = createVehicle(509, x+1, y, z) warpPedIntoVehicle(player, veh) end end addCommandHandler("bikevip",givebike)
Jaysds1 Posted March 4, 2013 Posted March 4, 2013 so, you want to destroy the vehicle after the player leaves the vehicle?
Jaysds1 Posted March 4, 2013 Posted March 4, 2013 ok, try this: function givebike( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Vip" ) ) then local x,y,z= getElementPosition(player) veh = createVehicle(509, x+1, y, z) warpPedIntoVehicle(player, veh) addEventHandler('onVehicleExit',veh,function() setTimer(destroyElement,5000,1,veh) end) end end addCommandHandler("bikevip",givebike)
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 very thanks! =D has some function to add one player to a group? in my case "Vip"
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 Thanks! So will it work? function givevip (playerSource, commandName, accountName) if accountName then aclGroupAddObject (aclGetGroup("Vip"), "user."..accountName)) outputChatBox ("Account '"..accountName.."' succesfully added to the Vip group", playerSource) else outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /givevipfor [accountName]", playerSource) end end addCommandHandler ("givevipfor", givevip)
Castillo Posted March 4, 2013 Posted March 4, 2013 One problem at this line: aclGroupAddObject (aclGetGroup("Vip"), "user."..accountName)) You have an extra ")" at the end, should be: aclGroupAddObject ( aclGetGroup ( "Vip" ), "user.".. accountName )
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 put the command to remove, and placed so that only admins can use, you can check please? function delvip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupRemoveObject (aclGetGroup("Vip"), "user."..accountName) outputChatBox ("ACL: Account '"..accountName.."' succesfully removed as vip.", playerSource) outputChatBox ("ACL: Someone have removed you as admin.", accountName) else outputChatBox ("ACL: No account name specified.", playerSource) outputChatBox ("ACL: Syntax: /delvip [accountName]", playerSource) end end end addCommandHandler ("delvip", delvip) function givevip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupAddObject (aclGetGroup("Vip"), "user."..accountName)) outputChatBox ("Account '"..accountName.."' succesfully added to the Vip group", playerSource) else outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /givevipfor [accountName]", playerSource) end end end addCommandHandler ("givevipfor", givevip)
Castillo Posted March 4, 2013 Posted March 4, 2013 local accName = getAccountName ( getPlayerAccount ( player ) ) That's wrong, your player argument is: "playerSource".
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 function delvip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupRemoveObject (aclGetGroup("Vip"), "user."..accountName) outputChatBox ("ACL: Account '"..accountName.."' succesfully removed as vip.", playerSource) outputChatBox ("ACL: Someone have removed you as admin.", accountName) else outputChatBox ("ACL: No account name specified.", playerSource) outputChatBox ("ACL: Syntax: /delvip [accountName]", playerSource) end end end addCommandHandler ("delvip", delvip) function givevip (playerSource, commandName, accountName) local accName = getAccountName ( getPlayerAccount ( playerSource ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then if accountName then aclGroupAddObject (aclGetGroup("Vip"), "user."..accountName) outputChatBox ("Account '"..accountName.."' succesfully added to the Vip group", playerSource) else outputChatBox ("No account name specified.", playerSource) outputChatBox ("Correct syntax: /givevipfor [accountName]", playerSource) end end end addCommandHandler ("givevipfor", givevip) ?
devildead622 Posted March 4, 2013 Author Posted March 4, 2013 I suppose so, I'm not at home to test! = D What do you think?
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