Jump to content

nameforthisforum

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by nameforthisforum

  1. Hi! I'm new in scripting and i made a simple teleport command. When i'm in car and i type the command, nothing happends. How can i make this: When i type the command, it will teleport me with the car? Here is my script:

    Quote
    
    function pronto (thePlayer)
    local adminname = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup ("user."..adminname, aclGetGroup ( "Admin" ) ) then 
          setElementPosition(thePlayer, 1770.90, -1539.29, 8.86)
    	else
    	    outputChatBox("Not Admin!", thePlayer, 255, 0, 0)
    	end
    end
    addCommandHandler("tppoliciafederal", pronto)

     

  2. Hi! I want to make a faction system for a roleplay server and when i want to remove a player from faction i'm typing "/fpk <PlayerName> <FactionID>". How can i add in command the "Reason"? To looks like: "/fpk <PlayerName> <FactionID> <Reason>". I want only the codes how can i add this, i want to add it by myself. Thanks for help! :) 

  3. Oh, sorry, i forgot to put my script :))

    function jail (thePlayer)
    local adminname = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup ("user."..adminname, aclGetGroup ( "Admin" ) ) then 
          setElementPosition(thePlayer, 1770.90, -1539.29, 8.86)
    	else
    	    outputChatBox("Acces Denied!", thePlayer, 255, 0, 0)
    	end
    end
    addCommandHandler("gotojail", jail)

     

  4. Hi! I'm new in scripting and i made a simple teleport command. When i'm in car and i type the command, nothing happends. How can i make this: When i type the command, it will teleport me with the car? Here is my script:
     

  5. 1 hour ago, Tekken said:

    outputChatBox("text with color code here", player, red, green, blue, true)

    The true at the end enables the color codes within string.

    When you in trouble with a function always give a check on the wiki.

    Thanks a lot!!! You saved me !!!!! :D

  6. Hi! I want to make an OLX chat, and i have some problems. This is my script:

    function Advertismente(thePlayer, commandName, ...)
    		local players = getElementsByType("player")
    		local playerName = getPlayerName ( thePlayer )
    		local chatContent = {...}
    		for index, player in ipairs ( players ) do
    			outputChatBox( "#757374[ #6600ffO#00ff00L#ff6600X #757374]" .. playerName.. ": " ..table.concat ( chatContent, " "), player, 0, 190, 40)
    		end
    	end
    addCommandHandler( "olx", Advertismente )

    Look how it is on server: https://imgur.com/a/BaFibii

    And i want to be like this: https://imgur.com/a/4k1fFQm

    How can i solve it? I'm new in scripting. Thanks a lot :) 

  7. Hi! I want to make a script like this: When you press '2' the engine will start and the sound too. There is my script and have 2 problems: 

    1.SCRIPT ERROR: OffEngine\server.lua:17: '<eof>' expected near 'end'
     ERROR: Loading script failed: OffEngine\server.lua:17: '<eof>' expected near 'end'

    2. ERROR: Client (#ff8000Name) triggered serverside event motor_event, but event is not added serverside

    EDIT: Error 1, server.lua:17 is the last 'end' from Server Side

    There is my Script:

    Server Side:

    function motor_fonskiyon()
    local arac = getPedOccupiedVehicle(source)
    if arac then
    local aracadi = getVehicleName(arac)
    if getVehicleEngineState(arac) == false then
    setVehicleEngineState(arac, true)
    outputChatBox("Engine on. Car: ["..aracadi.."]", source, 0, 153, 51, true)
    startSound = playSound("files/starter.mp3", false)
    elseif getVehicleEngineState(arac) == true then
    setVehicleEngineState(arac, false)
    outputChatBox("Engine off. Car: ["..aracadi.."]", source, 0, 153, 51, true)
    end
    end
    end
    end
    addEvent("motor_event", true)
    addEventHandler("motor_event", getRootElement(), motor_fonskiyon)

    Meta.XML

    <meta>
    <info author="Name" name="Engine" version="1" type="script"/>
    
    <script src="client.lua" type="client" cache="false"/>
    <script src="server.lua" type="server"/>
    <file src="files/starter.mp3" />
    </meta>

    Client Side:

    Quote


    bindler = {

     motor = "2", --//Motor Oprit

    }

    bindKey(bindler.motor,"down",
    function()
    if getPedOccupiedVehicleSeat (localPlayer)== 0 then
    triggerServerEvent("motor_event", getLocalPlayer())
    end
    end)
     

     

    I would be grateful if you could help me! Thanks :) 

  8. Hi! With your help i started to learn scripting, thanks a lot! :D I have this script:

    Quote

    comand = "insta" 

    function chatinsta( thePlayer, _, ... )
        local message = table.concat ( { ... }, " " )
        if ( isPlayerOnGroup ( thePlayer ) ) then
        for _, player in ipairs ( getElementsByType ( "player" ) ) do
        if ( isPlayerOnGroup ( player ) ) then
        if getElementData(thePlayer, "Chat:Delay1") == true then
        outputChatBox("#ff0000Stop spamming!", thePlayer, 255, 255, 255, true )
        return end
        conta = getAccountName(getPlayerAccount(thePlayer))                

        if isObjectInACLGroup ("user."..conta, aclGetGroup ( "Admin" ) ) then
            outputChatBox(" #F04190 » Instagram » #ADFF2FPresidente - #ADFF2F["..getElementData(thePlayer, "ID").."] - #ffffff".. getPlayerName ( thePlayer ) .." #ADFF2F» :#F04190 ".. message, player, 255, 255, 255, true )
                                                        
        elseif isObjectInACLGroup ("user."..conta, aclGetGroup ( "Everyone" ) ) then
            outputChatBox(" #F04190 » Instagram » #ADFF2FPlayer - #ADFF2F["..getElementData(thePlayer, "ID").."] - #ffffff".. getPlayerName ( thePlayer ) .." #ADFF2F» :#F04190 ".. message, player, 255, 255, 255, true )    
            end
        end
        end
        end
        setElementData ( thePlayer, "Chat:Avisado", true )
        setElementData ( thePlayer, "Chat:Delay1",true )
        setTimer ( setElementData, 3000, 1, thePlayer, "Chat:Delay1", false )
    end
    addCommandHandler ( comand,  chatinsta)

    addEventHandler("onPlayerJoin", getRootElement(),  
    function() 
      bindKey(source, "m", "down", "chatbox", "insta") 
    end 

    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
      for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"m", "down", "chatbox", "insta")
      end 
    end 

    The problem is this: When i press "m" and text or type "/insta <Text>" i'm getting this in Console: ERROR: [Mods]\InstaChat\Chat.lua:36: attempt to concatenate a boolean value.

    Line 36 is "outputChatBox(" #F04190 » Instagram » #ADFF2FPresidente - #ADFF2F["..getElementData(thePlayer, "ID").."] - #ffffff".. getPlayerName ( thePlayer ) .." #ADFF2F» :#F04190 ".. message, player, 255, 255, 255, true )"   --- The line with aclGetGroup Admin

    Can you please, help me?

  9. Hi! I want to make this command but i don't know how: on chat ( T ) type /olx <Text> and when you press enter it will take from you 150$ with (OutPutChatBox -150$) and will appear on chat: [ O L X ]<PlayerName>: <Text> . Can someone explain me how can i do this? Thanks a lot!!

  10. Hi! I made a Clan System, but i don't know how to make the deposit and withdraw. I made the GUI and Buttons, i only need how can i script this: Upper will show you the ammount in the Clan Safebox. when you press/select on "Deposit" you will need to enter an ammount to deposit. "Withdraw" button where you will withdraw money. Can someone help me? Thanks a lot!

×
×
  • Create New...