-
Posts
1,273 -
Joined
-
Last visited
-
Days Won
1
Everything posted by GTX
-
1: viewtopic.php?f=108&t=90687 2: I don't understand. You want only numbers to appear in editbox?
-
You already have exported functions, go to admin_server.lua (I don't know exact name of file) and the export in the correct place. exports["nameOfYourResource"]:banAccount(getPlayerAccount(player), 1, 1, 2016, "Hacking", "Me") -- Example. Note that this only works for account names. Player must be logged in. I'd prefer making your own ban system if you don't have/use login system.
-
Wtf? This doesn't make any sense. local BaseLV = {} addEventHandler( "onPlayerWasted", getRootElement( ), function() local x, y, z = getElementPosition ( source ) BaseLV [ source ] = createPickup ( x, y, z-1, 3, 1210, 1, 1 ) end )
-
First of all, do not triple post. Second, improve your English or go to your language forum. Third, why is this script decompiled? (Can see from variable names) This should work I think. radius = 14 explosionType = 10 timerSeconds = 3000 showTheCredits = function(l_1_0) outputChatBox("Meteor-Rain script was created by Seers!", l_1_0, 200, 200, 30, true) end addCommandHandler("meteor", showTheCredits) rainOnAllPlayers = function() for l_2_3,l_2_4 in ipairs(getElementsByType("player")) do fallMeteo(l_2_4) end end CheckTheFallingRocks = function() for l_3_3,l_3_4 in ipairs(getElementsByType("vehicle")) do if getElementModel(l_3_4) == 564 and getElementData(l_3_4, "meteor") == 1 and getElementData(l_3_4, "exploded") == 0 then new1 = getElementData(l_3_4, "z-koord") + 3 if new1 <= getElementData(l_3_4, "z-koord") then createExplosion(x, y, z, explosionType, nil) setElementData(l_3_4, "exploded", 1) theFallingRock = getElementData(l_3_4, "attachedRock") setTimer(destroyElement, 5000, 1, theFallingRock) end end end end setTimer(CheckTheFallingRocks, 50, 0) thisResourceStarts = function() if tonumber(get("secondsWhenTheNextStoneFalls")) and tonumber(get("secondsWhenTheNextStoneFalls")) >= 1 then timerSeconds = tonumber(get("secondsWhenTheNextStoneFalls")) * 1000 else outputDebugString("Invalid seconds number in settings. Please check meta.xml") timerSeconds = 3000 end if tonumber(get("fallRadius")) and tonumber(get("fallRadius")) >= 0 then radius = tonumber(get("fallRadius")) else radius = 14 outputDebugString("Invalid fall radius in settings. Please check meta.xml") end setTimer(rainOnAllPlayers, timerSeconds, 0) end addEventHandler("onResourceStart", resourceRoot, thisResourceStarts) fallMeteo = function(l_5_0) if getElementInterior(l_5_0) == 0 and getElementDimension(l_5_0) == 0 and getElementHealth(l_5_0) >= 1 then x, y, z = getElementPosition(l_5_0) x1 = x - radius x2 = x + radius y1 = y - radius y2 = y + radius x = math.random(x1, x2) y = math.random(y1, y2) theMeteo = createVehicle(564, x, y, z + 60, 30, 30, 30) setElementData(theMeteo, "meteor", 1) setElementData(theMeteo, "z-koord", z) setElementAlpha(theMeteo, 0) setElementHealth(theMeteo, 250) setVehicleDamageProof(theMeteo, true) theRock = createObject(3930, 0, 0, 0) setElementData(theMeteo, "attachedRock", theRock) attachElements(theRock, theMeteo, 0, 0, 0) if isPedInVehicle(l_5_0) then vx, vy, vz = getElementVelocity(getPedOccupiedVehicle(l_5_0)) setElementVelocity(theMeteo, vx, vy, -5) end end end displayVehicleLoss = function(l_6_0) if getElementModel(source) == 564 and getElementData(source, "meteor") == 1 and getElementData(source, "exploded") == 0 then x, y, z = getElementPosition(source) createExplosion(x, y, z, explosionType, nil) setElementData(source, "exploded", 1) theFallingRock = getElementData(source, "attachedRock") setTimer(destroyElement, 5000, 1, theFallingRock) end end addEventHandler("onVehicleDamage", getRootElement(), displayVehicleLoss)
-
Add this to your meta: <settings> <setting name="*markerSize" value="markerSize" friendlyname="" group="" accept="" examples="" desc="" /> </settings> Then you have to get settings from server side: local markerSize = get"markerSize" triggerClientEvent("receiveSettings", root, markerSize) Client side would look like: local MarkerSize = -0.1 addEvent("receiveSettings", true) addEventHandler("receiveSettings", root, function(markerSize) MarkerSize = markerSize end ) --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local solt = getPedWeaponSlot ( source ) if ( solt == 0 or solt == 1 or solt == 8 or solt == 9 or solt == 10 or solt == 11 or solt == 12 or solt == 7 ) then return end -- if his weapon isn't a gun then don't do the function if isElement ( hitElement ) then -- check if there is a hitElement ( something he is hitting ) if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player or a vehicle then don't make the marker , cuz no need for it end marker = createMarker ( hitX, hitY, hitZ, "corona", MarkerSize, 255, 255, 255, 255 ) -- when the player shoot we create a white marker in the place that the bullet hit and make it visible for the player who is shooting only. if solt == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if solt == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if solt == 4 then -- if he is using a sub machine gun then setMarkerColor ( marker, 255, 255, 0, 255 ) -- set the marker colour as yellow end if solt == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if solt == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, markers ) -- show him the markers
-
What do you mean? This? local MarkerSize = -0.1 --Markers effect.. function markers ( weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) local solt = getPedWeaponSlot ( source ) if ( solt == 0 or solt == 1 or solt == 8 or solt == 9 or solt == 10 or solt == 11 or solt == 12 or solt == 7 ) then return end -- if his weapon isn't a gun then don't do the function if isElement ( hitElement ) then -- check if there is a hitElement ( something he is hitting ) if ( getElementType ( hitElement ) == "player" or getElementType ( hitElement ) == "vehicle" ) then return end -- if he is shooting a player or a vehicle then don't make the marker , cuz no need for it end marker = createMarker ( hitX, hitY, hitZ, "corona", MarkerSize, 255, 255, 255, 255 ) -- when the player shoot we create a white marker in the place that the bullet hit and make it visible for the player who is shooting only. if solt == 2 then -- if he is using a handgun then setMarkerColor ( marker, 255, 0, 0, 255 ) -- set the marker colour as red end if solt == 3 then -- if he is using a shotgun then setMarkerColor ( marker, 0, 0, 255, 255 ) -- set the marker colour as blue end if solt == 4 then -- if he is using a sub machine gun then setMarkerColor ( marker, 255, 255, 0, 255 ) -- set the marker colour as yellow end if solt == 5 then -- if he is using a rifle then setMarkerColor ( marker, 255, 0, 255, 255 ) -- etc end if solt == 6 then setMarkerColor ( marker, 0, 255, 255, 255 ) end if marker then setTimer ( destroyElement,3*1000,1,marker ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, markers ) -- show him the markers Or do you mean settings from meta? get
-
Marker = createMarker (x,y,z,"cylinder",255,0, 0,255) Veh = {} function spawmvehicle(thePlayer) if getElementType(thePlayer) ~= "player" then return end if isElement(Veh[thePlayer]) then return end local px,py,pz = getElementPosition(thePlayer) Veh[thePlayer] = createVehicle(id, px, py, pz) end addEventHandler("onMarkerHit", Marker, spawmvehicle) addEventHandler("onVehicleExit",root, function() if ( source == Veh[source] ) then setTimer(destroyElement,10000,1,Veh[source]) end end )
-
local reward = math.random (2999,5300) function deliveryDoneJob() destroyElement(burger) destroyElement(myBlip) setElementData(source, "reward", reward) givePlayerMoney(source,reward) outputChatBox("here's your money" ..reward.. "well done!",source,0,255,231) end addEvent("doneJob", true) addEventHandler("doneJob", root, deliveryDoneJob) function message() local reward = getElementData(localPlayer, "reward") if not reward then return end dxDrawText(tonumber(reward).."$",620.0*x,395.0*y,802.0*x,466.0*y,tocolor(255,255,255,255),2.3,"pricedown","left","top",false,false,false) end
-
function giveblood (thePlayer) local accountname = getAccountName ( getPlayerAccount ( thePlayer )) if isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." ..accountname, aclGetGroup ( "SuperModerator" )) then if getElementData(thePlayer, "duty") ~= true then outputChatBox ("#1AFF00 Adminul "..getPlayerName(thePlayer).."#1AFF00 este on Duty !",root,255,255,255,true) setElementData(thePlayer, "blood",999999999999999) outputServerLog("Adminul "..getPlayerName(thePlayer).." este on Duty!") setElementData(thePlayer, "duty", true) else outputChatBox ("#FF0000 Adminul "..getPlayerName(thePlayer).."#FF0000 este off Duty !",root,255,255,255,true) setElementData(thePlayer, "blood",12000) outputServerLog("Adminul "..getPlayerName(thePlayer).." este offDuty!") setElementData(thePlayer, "duty", false) end end end addCommandHandler("duty", giveblood)
-
If you only want to restrict one command, use isElementWithinColShape
-
Seperate scripts, stop them one by one and you'll find out which one is lagging. Post here the lagging script and we can help you.
-
Read this PROPERLY and carefully viewtopic.php?f=91&t=47897 Post your script using Lua tags here, in this topic/forum. You can upload pictures to either dropbox, imgur etc. and then post the link here.
-
They are in default race utils_client.lua I guess.
-
AlignVehicleWithUp function does that for you. Just change g_Vehicle variable.
-
setTimer -- Events "onVehicleExit" "onMarkerHit"
-
One database for one table? Or all tables in one database?
GTX replied to Nikolay_888's topic in Scripting
Why do you need 2 databases? Create only 1. It's best for you and the script, because connecting to 2 databases may impact server performance. And you can take backups more easier than having to take 2 backups. -
Be aware, onPlayerLogin is server side event, add requestBrowserDomains function at the top of your client side script.
-
Read actual topic again, he wants to have voice enabled and he wants to create local voice chat.
-
Some functions requires you to do that. Well, it's useful if you want, but it's not important.
-
You need module, but that module might be outdated. I'd prefer DB functions.
-
Use processLineOfSight or getGroundPosition to get ground position. Note that player must be near that position, otherwise it returns false.
-
Post your script here. Do you understand what I am saying????