esporta05
Members-
Posts
60 -
Joined
-
Last visited
Everything posted by esporta05
-
does the project is suspended?
-
Thank you for helping me, I understand from this, using player could create some problems to me. I should use source rather than player on server side scripting. But I dont understand why you put toBuy argument to the function. It is working without it too. btw it worked. Thank you again and if you explain me why you use toBuy argument i will really appreciate it
-
Hello wonderful MTA:SA community. I was working on a Ammu Nation script and I get stucked with some problems. So if you guys can tell me whats wrong with my script I will really appreciate it. the command based one working perfectly without any problems but the other one which is getting triggered by the gui button s not working. Here is the debugscript: http://i.imgur.com/XiFcI4f.png function buygun (player) local m4money = 2000 local money = getPlayerMoney(player) if (money >= m4money) then giveWeapon ( player, 31, 100, true ) takePlayerMoney ( player, m4money ) else outputChatBox ("You havent got enough money to buy this weapon!", source) end end addCommandHandler ("m4", buygun) -- -- -- function buym4 (player) local money = getPlayerMoney(player) local m4money = 2000 if ( money >= m4money ) then giveWeapon ( player, 31, m4ammo, true) else outputChatBox ("You havent got enough money to buy this!", source) end end addEvent("buym4",true) addEventHandler("buym4",getRootElement(),buym4) -- Steps: -- Give weps with command |Done -- Take money while giving weps with command |Done -- Establish connections between your client sided script and server sided script. |Done -- Make a simple button and sell weps from that button when it get clicked | Having errors -- Make a simple gui window and add all neccesary weps. | Not Finished -- Make a marker and set visible the GUI when the player hits to that marker | Not Finished Here is the function script that use in my client sided script for triggering the server sided buym4 function: function buym4 () triggerServerEvent ( "buym4", getRootElement(), "buym4" ) end addEventHandler ( "onClientGUIClick", M4.button, buym4, false )
-
Oh well thank you so much. I dont know how I didnt see the Client part of it
-
So I decided to write my own death handler script. While I was checking useful functions at wiki I saw that spawnPlayer is bugged and I cant use it with onPlayerWasted event. So how can i script a death handler without onPlayerWasted event? It is simply going to spawn the player to the spesified location. I am using latest 1.4 night build
-
Wow I see that setelemnthealth is both client and server sided when I check the wiki. You are right i dont need a client side You are a good person bonsai
-
Okay here is the thing, I tried to make a virus script. Servers picks a random guy and slaps him every 10 seconds because he has got virus(randomly choosen).
-
Thank you for helping me but I am not just trying to script a virus scrip. I am trying to learn lua so if you explain me the script that you wrote here I will really appreciate it.
-
I am picking a random guy at my server side script. I need to reach that player from my client sided script. This is all I am trying to do. After than player is going to get slapped bla bla bla... So what can i do for reaching that randomly picked player from my client sided script?
-
There is a bug at engineloadtxd I think, I am having same issue with extremely simple script.
-
Hello, its me again I was trying to understand exports so I tried to make a script to understand how it works but I failed. I was trying to apply this tutorial https://forum.multitheftauto.com/viewtopic.php?f=148&t=46167 . So can someone tell me what is wrong with my script? Server sided scrit: -- -- Virus Script -Server Sided -- function PickVPlayer() local chat = outputChatBox local virusPlayer = getRandomPlayer ( ) outputServerLog ("Virus: " ..getPlayerName ( virusPlayer ).." has been choosen for virus." ) end addCommandHandler("viruspick",PickVPlayer) addEvent("vplayer", true) addEventHandler("vplayer", root, PickVPlayer) Client sided script: -- -- Virus Script -Client Sided -- function virus (virusPlayer,vplayer) triggerServerEvent(virusPlayer, "vplayer", virusPlayer) local chat = outputChatBox local timervalue = 10000 local slapvalue = 5 if (virusPlayer == localPlayer) then setTimer( setElementHealth, timervalue, 1, localPlayer, getElementHealth(localPlayer) - slapvalue ) chat("Error: You are supposed to define a vehicle id! /vehicle id",player,255, 0, 0) end end addCommandHandler("virus",virus)
-
I found a tutorial about my first question, thank you for your help.
-
My first question is, if i add my own event can i use that event at different resource? if yes so whats the difference between exports and adding my own events? Second question: How can i add a settimer to this slap function: setElementHealth ( localPlayer, getElementHealth(localPlayer) - 5 )
-
This is my own script and I want it to be deleted because the project getting harder for me. I need to improve my self before starting a project like this. https://community.multitheftauto.com/in ... ls&id=9724 DONE
-
Hello all, I know that I am posting too many help topics. I am sorry about that but I am really new on LUA and I am trying to learn new things with scripting new scripts all the time for improving myself. I am sorry about posting too many help topic. I have got another problem too. I was trying to do a simple cursor enable, disable script but I am getting this debug script error all the time: http://i.imgur.com/DDeibZO.png function MouseOn(source, thePlayer, commandName) local thePlayer = ( source ) showCursor ( thePlayer, true ) end addCommandHandler("mouseon",MouseOn) function MouseOff(source) local thePlayer = ( source ) showCursor ( thePlayer, false ) end addCommandHandler("mouseoff",MouseOff)
-
Even I dont set a guisetvisible for my button it is getting enabled in resource start. and I put my button inside of my windows but still I cant attach it to my window
-
For your question: I tried to attach button to the windows but it get dissepeated. local MainCloseButton = guiCreateButton(0.6747, 0.1599, 0.075, 0.04, "CLOSE", true,MainWindow) I tried to attach it as same as I saw in the wiki but it get dissepeared all the time without any debug errors. thank you for your help, if you can tell me whats wrong with the button I will really appreciate it.
-
Here is the debug log screen shot http://i.imgur.com/yBbuKJf.png function Information (button) MainWindow = guiCreateWindow ( 0.2, 0.20, 0.55, 0.5, "Information", true ) --Main Window MainCloseButton = guiCreateButton(0.6747, 0.1599, 0.075, 0.04, "CLOSE", true) local TabPanel = guiCreateTabPanel ( 0, 0.1, 1, 1, true, MainWindow ) local RuleTab = guiCreateTab( "Rules", TabPanel ) local CommandTab = guiCreateTab( "Commands", TabPanel ) guiCreateMemo(15,10,1000,420,"Deatmatching is'nt allowed! \nbla bla bla!",false,RuleTab) --Main/Rules Window Text guiCreateMemo(15,10,1000,420,"This part was too long so I dont put this part to the forum.",false,CommandTab) --Commands Window Text end addCommandHandler ("info",Information) addEventHandler ( "onClientGUIClick", MainCloseButton, CloseButton, false ) --run closebuyon function function CloseButton (button) guiSetVisible(MainWindow, false)--close the mainwindow gui end
-
Try this please function health1(localPlayer) outputChatBox("test") -- made this to check if the function self was working and it does setElementHealth ( localPlayer, getElementHealth(localPlayer) + 25 ) end addCommandHandler("healme",health1)
-
Well you will need lua knowledge first of all, not much. Beginner level is enough for a script like this. If you know little bit lua, check those wiki links. They will help you about how to do it. https://wiki.multitheftauto.com/wiki/SetBlipColor https://wiki.multitheftauto.com/wiki/GetTeamColor
-
I have got pretty simple script. But my debugscript 3 is giving me error at my addeventhandler. here is my script: function Blood(loss,attacker,weapon,bodypart) local rootElement = getRootElement() local x, y, z = getElementPosition(source) local slapvalue = 5 local timervalue = 10000 local healthamount = 30 if loss > healthamount then fxAddBlood ( x, y, z-2, 0.00000, 0.00000, 0.00000, 1, 1 ) --setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - slapvalue ) end end addEventHandler ("OnClientPlayerDamage",rootElement,Blood)
-
I dont beleive that. MTA SE is absolutaly better than notepad ++ for MTA Lua development. Everything is much more faster and easier to do.
-
I was using MTA SE. When I create the script from scratch using notepad ++ everything worked just fine. There is a problem about MTA SE but what is the problem? MTA SE is a big comfort for me...
-
Hello, my server giving me cant parse meta file error. Whats wrong with the meta file? "Esporta" version="0.5" name="Spawner" description="This script handles spawns and server joins" type="script" />
