Jump to content

bartje01

Members
  • Posts

    208
  • Joined

  • Last visited

Posts posted by bartje01

  1. Hey guys. I want that if the player his level = 2, the triggerevent activates.

    I have this:

      
            if getElementData(source, tostring(sqldata[1]["level"])) == 2 then 
            triggerClientEvent ( source,"l2", source ) 
      
    

    Well, I know that this is terribly wrong, but I'm not sure how to fix it. Does anyone have an idea?

    This is the executetable (Not sure if needed)

      
    executeSQLCreateTable("levels", "accountname STRING, level INT") 
      
    

  2. guiCreateStaticImage( 20, 200, 100, 100, "get5zombiekills.png", true ) 
    

    How do you expect the image to appear if you are using absolute positions but you have defined the positioning as relative?

    Change

    guiCreateStaticImage( 20, 200, 100, 100, "get5zombiekills.png", true ) 
    

    to

    guiCreateStaticImage( 20, 200, 100, 100, "get5zombiekills.png", false ) 
    

    Thankyou, works fine now. But.. how can I set a timer that it stays for two seconds? :oops:

  3.   
    <meta> 
        <settings> 
            <setting name="*MaxZombies" value="[100]" /> <!--maximum allowed zombies --> 
            <setting name="*StreamMethod" value="[1]" /> <!-- 1 to constantly stream zombies, 0 to only allow zombies to spawn via createZombie function, 2 to only allow spawning at set spawnpoints --> 
            <setting name="*Speed" value="[1]" /> <!-- 0 is slowest, 1 is normal, 2 faster --> 
        </settings> 
         
        <info author="Slothman" name="Zday script" version="3.0.1" type="script" description="Zombie Infestation script" edf:definition="edf/zombies.edf"/>/> 
        <script src="zombie_server.lua" /> 
        <script src="teams.lua" /> 
        <script src="zombiekill_server.lua" /> 
            <script src="saver.lua" /> 
        <script src="level.lua" /> 
        <script src="zombie_client.lua" type="client"/> 
      
      
        <script type="client" src="Client_SW.lua"/> <script type="server" src="Server_SW.lua"/> <file src="images/1.png"/> <file src="images/16.png"/> <file src="images/22.png"/> <file src="images/23.png"/> <file src="images/24.png"/> <file src="images/25.png"/> <file src="images/26.png"/> <file src="images/27.png"/> <file src="images/28.png"/> <file src="images/29.png"/> <file src="images/30.png"/> <file src="images/31.png"/> <file src="images/32.png"/> <file src="images/33.png"/>  
    <file src="images/34.png"/> 
        <file src="zombiewood.png" /> 
        <file src="skins/13.txd" /> 
        <file src="skins/22.txd" /> 
        <file src="skins/56.txd" /> 
        <file src="skins/67.txd" /> 
        <file src="skins/68.txd" /> 
        <file src="skins/69.txd" /> 
        <file src="skins/70.txd" /> 
        <file src="skins/84.txd" /> 
        <file src="skins/92.txd" /> 
        <file src="skins/97.txd" /> 
        <file src="skins/105.txd" /> 
        <file src="skins/107.txd" /> 
        <file src="skins/108.txd" /> 
        <file src="skins/111.txd" /> 
        <file src="skins/126.txd" /> 
        <file src="skins/127.txd" /> 
        <file src="skins/128.txd" /> 
        <file src="skins/152.txd" /> 
        <file src="skins/162.txd" /> 
        <file src="skins/167.txd" /> 
        <file src="skins/188.txd" /> 
        <file src="skins/192.txd" /> 
        <file src="skins/195.txd" /> 
        <file src="skins/206.txd" /> 
        <file src="skins/209.txd" /> 
        <file src="skins/212.txd" /> 
        <file src="skins/229.txd" /> 
        <file src="skins/230.txd" /> 
        <file src="skins/258.txd" /> 
        <file src="skins/264.txd" /> 
        <file src="skins/274.txd" /> 
        <file src="skins/277.txd" /> 
        <file src="skins/280.txd" /> 
        <file src="skins/287.txd" /> 
        <file src="sounds/mgroan1.ogg" /> 
        <file src="sounds/mgroan2.ogg" /> 
        <file src="sounds/mgroan3.ogg" /> 
        <file src="sounds/mgroan4.ogg" /> 
        <file src="sounds/mgroan5.ogg" /> 
        <file src="sounds/mgroan6.ogg" /> 
        <file src="sounds/mgroan7.ogg" /> 
        <file src="sounds/mgroan8.ogg" /> 
        <file src="sounds/mgroan9.ogg" /> 
        <file src="sounds/mgroan10.ogg" /> 
        <file src="edf/zombiespawn.png" /> 
        <file src="get5zombiekills.png" /> 
      
        <export function="createZombie" type="server"/> 
        <export function="isPedZombie" type="server"/> 
    </meta> 
      
    

    And yes, the outputchatbox works.

  4. You're calling the "achievement" event and sending an argument "Hello World". But your function achiev() doesn't accept arguments, then you do not need use it.

    Try use:

    triggerClientEvent("achievement", getRootElement()) 
    

    And please, tabulate your code. It's horrible.

    Using getRootElement() will trigger the event for all players ..

      
    function addPlayerZombieKills(killer) 
        local account = getPlayerAccount(killer) 
            if isGuestAccount(account) then return end 
                local zombieKills = getAccountData(account,"Zombie kills") or 0 
                setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) 
                if getElementData(killer, "Zombie kills") == 5 then 
                    triggerClientEvent ( killer,"achievement", killer ) 
                end 
    end 
      
    

    Now this is my client side:

      
    function achiev (  ) 
        guiCreateStaticImage( 20, 200, 100, 100, "get5zombiekills.png", true ) 
        outputChatBox ( "test" ) 
      
    end 
    addEvent( "achievement", true ) 
    addEventHandler( "achievement", getRootElement(), achiev ) 
      
    

    The img still doesn't show up :l.

  5. Hmm. I tried. Can't come out.. :(

    Client

      
    function achiev (  ) 
        guiCreateStaticImage( 20, 200, 100, 100, "get5zombiekills.png", true ) 
    end 
    addEvent( "achievement", true ) 
    addEventHandler( "achievement", getRootElement(), achiev ) 
      
    

    server

      
    function addPlayerZombieKills(killer) 
        local account = getPlayerAccount(killer) 
        if isGuestAccount(account) then return end 
        local zombieKills = getAccountData(account,"Zombie kills") 
        if not zombieKills then setAccountData(account,"Zombie kills",0) end 
        setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) 
        if getElementData(killer, "Zombie kills") == 5 then 
        triggerClientEvent ( "achievement", getRootElement(), "Hello World!" ) 
      
      
    end 
      
    end 
      
    

    Please help me.

  6. Hey all, I want to get a screen in my server side script. How can I do this?

    I putted this in guiCreateStaticImage( 20, 200, 100, 100, "get5zombiekills.png", false ) but it's'client side only. It has to be in my server.

  7. Oh indeed ,it was with a lower case. But still, it doesn't work.

    function addPlayerZombieKills(killer) 
        local account = getPlayerAccount(killer) 
        if isGuestAccount(account) then return end 
        local zombieKills = getAccountData(account,"Zombie kills") 
        if not zombieKills then setAccountData(account,"Zombie kills",0) end 
        setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) 
        if getElementData(attacker, "Zombie kills") == 5 then 
        outputChatBox ("Achievement unlocked.") 
    end 
      
    end 
      
    

  8. Hey all. I want that if you reach 5 zombie kills it'll say: achievement unlocked. I have this:

    if getElementData(attacker, "Zombie Kills") == 5 then 
    outputChatBox ("Achievement unlocked.") 
    

    Doesn't seem to work. What'wrong?

  9. Actually, you could use the admin panel,

    Here's some steps:

    • Open Admin Panel
    • Go to the Resource Tab
    • Click on the ACL Button
    • Click on Moderator and there should be a some buttons on the right.
    • if there's a edit bar then type in "user.THEPLAYER"

    Thankyou!

  10. Hey all. I was wondering how this works. I want that if you type: "strike", it'll check if you're in the strikeforce.

    I have this:

      
    function strike ( source ) 
         
        if ( playerTeam(source) == "Strike Force")then               
             
        else 
            outputChatBox ( getPlayerName ( source ) .. " You're not in strike force" ) 
        
    end 
    addCommandHandler ( "strike", strike ) 
      
    

    Well, it didn't work :P. Could someone explain me how it does work?

  11. Hey guys. Everytime when I play Valhalla and I walk around my screen freezes everytime. It lags as well. My PC is good enough. Does anyone knows how to fix this?

  12. Hey guys. How can I set the interior of a zombie?

    It's like this now to set their locations

      
        locations = { 
        {1676.63,-1717.06,13.54}, 
    {1542.68,-1675,13.55}, 
    {2179.56,-1770.89,96.36}, 
    {2189.72,-1671.97,96.37}, 
    {2189.72,-1671.97,96.37}, 
    {1728.70,-1668.57,22.60} 
    } 
      
    for i,v in pairs(locations) do 
    local zomb = createPed (v[1],v[2],v[3]) 
             
        end 
      
    

    So how to make it like

    {1728.70,-1668.57,22.60,interiorid} ?

×
×
  • Create New...