Jump to content

Wei

Members
  • Posts

    814
  • Joined

  • Last visited

Posts posted by Wei

  1. botTable =   {} 
    addEvent("Accept",true) 
    addEventHandler("Accept",root, 
        function (hitElement) 
            botTable["Girl"] = call ( getResourceFromName ( "slothbot" ), "spawnBot", x,y,z,0,115,Dim,Int,nil,0) 
            call ( getResourceFromName ( "slothbot" ), "setBotFollow",botTable["Girl"], hitElement ) 
            setTimer( 
            function () 
                call(getResourceFromName("slothbot"), "setBotAttackEnabled",botTable["Girl"],false ) 
            end,60000,0) 
        end 
    ) 
      
    addEvent("onBotWasted",true) 
    addEventHandler ( "onBotWasted", root, 
    function ( attacker ) 
        if (source == botTable["Girl"]) then 
            outputChatBox("Mission Failed",attacker,255,0,0) 
            destroyElement(finishMarker) 
            destroyElement(myBlip) 
        end 
    end) 
    

    do you have x,y,z,Dim,Int defined ?

  2. function kickall(thePlayer, cmd, ...) 
         text = table.concat({...}, " ") 
         for _, player in ipairs (getElementsByType("player")) do 
            kickPlayer(player,thePlayer , text) 
         end 
    end 
    addCommandHandler("kickall", kickall) 
    

  3. I tried to use this code to make the blips on my custom radar.

    viewtopic.php?f=91&t=71784

    But when I rotate mouse everything rotates and blips are not in the position they are supposed to be...

        local blipX = (17+(300/2))+cblipx-(blipsize/2) 
                local blipY = (608+(154/2))+cblipy-(blipsize/2) 
      
             
            blipX = math.max(17, math.min(17 + 300, blipX)) 
            blipY = math.max(608, math.min(608 + 154, blipY)) 
             
    

    this are calculations

    image :

    a7ea1c9abb3f7a1135321e3ead8d138f.png

  4. function finishLoad(player, cash) 
        local cash = tostring(cash) 
        givePlayerMoney(player, tonumber(cash)) 
        setLoadCount(player) 
    end 
    addEvent("finishRoute", true) 
    addEventHandler("finishRoute", root, finishLoad) 
      
    function setLoadCount(plr) 
        local playerAcc = getPlayerAccount(plr) 
        local loads = getAccountData(playerAcc, "hdt.loads") 
        if (loads) then 
            setAccountData(playerAcc, "hdt.loads", loads+1) 
            setElementData(plr, "Completed Loads", loads+1) 
        else 
            setAccountData(playerAcc, "hdt.loads", 1) 
            setElementData(plr, "Completed Loads", 1) 
        end 
    end 
    

    Try

  5. function cars () 
        c1 = createVehicle ( 602, 2284.399, -1114.599, 37.700, 0, 0, 90 ) 
    end 
    addEventHandler ( "onResourceStart", resourceRoot, cars ) 
      
    function lock (vehicle) 
        if (vehicle == c1) then 
            if (not getElementModel (source) == 29) then 
                cancelEvent() 
                outputChatBox ("This vehicle is locked on team: Avenged Sevenfold!", source) 
            end 
        end 
    end 
    addEventHandler ( "onPlayerVehicleEnter", getRootElement(), lock) 
    

  6. Ah nevermind about this problem. I have another question...

    I just want to run function from table... I think I need to use loadstring or _G.. Like

    stringFunction = "getPlayerMoney(player)" 
      
      
    function run(player) 
        money = -- idk what is here 
    end 
    

  7. local theTable = { 
        [1]=getElementData(player, "Bungee"), 
        [2]=getPlayerMoney(player), 
        [3]=getElementDimension(player), 
        -- ... 
    } 
      
    for k=1, #theTable do 
        setAccountData(account, "data."..k, theTable[k]) 
    end 
      
    

    I wan't to save this as what function returns..

  8. You can download mta-paradise here: https://github.com/mabako/mta-paradise

    you need to install mysql server and then you should follow this instructions, if you will have any problems you should post here in forum...

    # MTA: Paradise Installation 
      
    ## MySQL configuration 
      
    ### Creating the database. 
    Create a new database, the server should automatically create all required tables if it can login and the needed privilegies are granted. 
      
    ### Configuring the server 
    To make your server use your MySQL database, edit your *settings.xml* to at least contain the following settings - of course, replace the example values with the MySQL data to connect to the server. 
      
        <settings> 
            <!-- MySQL Configuration --> 
            <setting name="@sql.user" value="username"/> 
            <setting name="@sql.password" value="password"/> 
            <setting name="@sql.database" value="database"/> 
            <setting name="@sql.hostname" value="localhost"/> 
            <setting name="@sql.port" value="3306"/> 
            <!-- Only use this on Linux if the normal connection does fail even though using the correct username & password. --> 
            <setting name="@sql.socket" value="/var/run/mysqld/mysqld.sock"/> 
             
            <!-- Registration --> 
            <setting name="@players.allow_registration" value="1"/><!-- Change to 0 to disable registration and show an error message --> 
            <setting name="@players.registration_error_message" value="Edit this to show the user a message when registration is disabled"/> 
        </settings> 
      
    ## MTA Server configuration 
      
    ### Obtaining the resources 
    To get started, clone either the [main repository]([url=git://github.com/marcusbauer/mta-paradise.git]git://github.com/marcusbauer/mta-paradise.git[/url]) or your fork into *mods/deathmatch*. It should already come with all configuration files required.  
      
    ### Linux 
    If you are using a linux server, edit your *mods/deathmatch/mtaserver.conf* and replace 
      
            <module src="mta_mysql.dll"/> 
      
    with 
      
            <module src="mta_mysql.so"/> 
      
    ### Windows 
    You need to copy the file *mods/deathmatch/modules/libmysql.dll* to your *MTA Server* directory (the one with MTA Server.exe in it) 
      
    ### Ready to go! 
      
    Assuming your MySQL connection details are correctly set up, all left to do is to start the MTA server. Otherwise, the server will keep shutting down on startup, look at *mods/deathmatch/logs/server.log* for a detailed error message. 
      
    

  9. I don't realy know. this is depending on scripts. If they use MySQL database or they use basic database. You should pay this guy if you think it is worth it but I dubt it... I think you should try installing mta-paradise, but it is a bit outdated. But it should work for you at begining :)

  10. The host will not set the scripts for you, this is not their job... What roleplay scripts do you want to install ?

    Basic roleplay by Socialz or MTA-Paradise by Mabako

×
×
  • Create New...