Jump to content

DiGiTal

Members
  • Posts

    277
  • Joined

  • Last visited

Posts posted by DiGiTal

  1. Hi, as i can't install mtasa. i search for a person who can help me by testing my scripts, nothing needed to know about programming, just test my script, if help needed i'll help about setup ur local server. 20% of profit will get it IF my script has been bought by someone

    • Like 1
    • Haha 1
  2. 3 minutes ago, Juuve said:

    script code:

    
    sometable = {1, 2, 3}
    toJSON(sometable)
    
    -- OR
    toJSON({1, 2, 3})
    

    in database (with toJSON)

    
    [[1, 2, 3]]
    

    it gives additional box brackets

    what i writte in SQL  ?

    in database (with toJSON)

    ?
    
     
    1.  
    2. [[1, 2, 3]]

     

    this is the result in my db you mean?

     

  3. i have also added a command for to know, the name,id and positions of the car by /vehs

    ---- STARTS ----
    Veh={}
    function veh(plr,cmd,modelid)
      local accName = getAccountName ( getPlayerAccount ( plr ) ) -- get his account name
         if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then return outputChatBox("you are not a admin to use this comand",plr) end
    	 elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
    	 x,y,z=getElementPosition(plr)
    	 x=x+5
    	 local id=tonumber(vehicleModel)
    	 car=createVehicle(id,x,y,z)
    	if car then
    	setElementData(car,"Id",id)
    	setElementData(car,"Name",getVehicleNameFromModel(id))
    	setElementData(car,"x",x)
    	setElementData(car,"y",y)
    	setElementData(car,"z",z)
    
    	outputChatBox("vehicule id"..modelid.."has been created",plr)
    	
    end
    end
    addCommandHandler("veh",veh)
    
    function destroy(plr,cmd)
    
     local accName = getAccountName ( getPlayerAccount ( plr ) ) -- get his account name
        if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then return outputChatBox("you are not a admin to use this comand",plr) end
    	elseif isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
    	occupe=getPedOccupiedVehicle(plr)
    if occupe then
    destroyElement(occupe)
    end
    end
    addCommandHandler("destroy",destroy)
    
    function destroyall(plr,cmd)
    x1,y2,z3=getElementPosition(getElementsByType("vehicle"))
    for k,v in pairs(getElementPosition(getElementsByType("vehicle"))) do
    if x1==	getElementData(car,"x") and y2==getElementData(car,"y") and z3==getElementData(car,"z") then
    destroy(car)
    else
    outputChatBox("error",plr)
    end
    end
    end
    
    addCommandHandler("destroyall",destroyall)
    
    function vehs(plr,cmd)
    
    outputChatBox(getElementData(getElementsByType("vehicle"),"Id"),plr)
    outputChatBox(getElementData(getElementsByType("vehicle"),"Name"),plr)
    outputChatBox(getElementData(getElementsByType("vehicle"),"x"),plr)
    outputChatBox(getElementData(getElementsByType("vehicle"),"y"),plr)
    outputChatBox(getElementData(getElementsByType("vehicle"),"z"),plr)
    
    end
    addCommandHandler("vehs",vehs)

     

  4.     function jetpack( thePlayer )
            if doesPedHaveJetPack ( thePlayer ) then -- If the player have a jetpack already, remove it
                removePedJetPack ( thePlayer ) -- Remove the jetpack
                return -- And stop the function here
            end
    		
         -- Otherwise, give him one if he has access
    
         local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name
         if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then -- Does he have access to Admin functions?
              if not doesPedHaveJetPack ( thePlayer ) then -- If the player doesn't have a jetpack give it.
                   givePedJetPack ( thePlayer )  -- Give the jetpack
              end
         end
    end
    
     bindKey ( thePlayer, "j", "down", jetpack)

    @Behnam

  5. 
    function fix(plr,cmd)
    
      local accName = getAccountName ( getPlayerAccount ( plr ) ) -- get his account name
         if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
             
    local vehicles = getElementsByType("vehicle")
    for k, v in pairs(vehicles) do
    	-- Fix the vehicle
    	fixVehicle(vehicle)
         outputChatBox( "ADMIN-ALL CARS HAS BEEN FIXED")
    	else outputChatBox( "You dont have access to this command",plr)
    
    end
        end
      end
    addCommandHandler( "fixall", fix)

    @Behnam

  6. you wanna the car blow or just show 5~0 without spam ?

    addEventHandler( "onClientVehicleCollision", root, 
    function ()
    
    	 playerVehicle = getPedOccupiedVehicle ( localPlayer )
      local health = getElementHealth( playerVehicle )/10
    	if health < 25 then
    	countdownRec(5) 
    	end
    end)
    
    function countdownRec(count) 
    while count>=0 do
        outputChatBox(count)
          count = count - 1
    if (count==0) then blowVehicle(playerVehicle) break end
    	end
        end
    	

     

  7. addEventHandler( "onClientVehicleCollision", root, 
    function ()
    
    	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
      local health = getElementHealth( playerVehicle )/10
    	if health < 25 then
    	countdownRec(5) 
    	end
    end)
    
    function countdownRec(count) 
    while count>=0 do
        outputChatBox(count)
          count = count - 1
    if (count==0) then break end
    	end
        end
    	

    @GrubaS

  8. addEventHandler( "onClientVehicleCollision", root, 
    function ()
    
    	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
      local health = getElementHealth( playerVehicle )/10
    	if health < 25 then
    	countdownRec(5) 
    	end
    end)
    
    function countdownRec(count) 
    while count>=0 do
        outputChatBox(count)
          count = count - 1
    	end
        end
        
    

    @GrubaS

  9. ids={}
    function joiner(plr)
    
    for i=1,getMaxPlayers() do
     if not ids[i] then 
                ids[i] = source 
                setElementData(source,"id",i) 
                break 
    end
    end
    end
    
    addEventHandler("onPlayerJoin",root,joiner)
    
    function id()
     for k, v in ipairs(getElementsByType("player")) do 
            local MyID = getElementData(v,"id") 
    if true then
    setPlayerName(v,"[..MyID..]..getPlayerName(v))
    end
    end
    end
    end
    addEventHandler("onPlayerJoin",root,id)

     

×
×
  • Create New...