Jump to content

questions - help


Recommended Posts

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) 
  

Link to comment

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) 
  

((=

Link to comment

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) 
  

Link to comment

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) 

Link to comment

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) 
  

Link to comment

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) 
  

Link to comment
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) 

?

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...