-
Posts
1,273 -
Joined
-
Last visited
-
Days Won
1
Everything posted by GTX
-
Read wiki. setWeaponProperty("uzi", "poor", "accuracy", 9999)
-
function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local x,y,z = getElementPosition( source ) setAccountData ( playeraccount, "pos", {x,y,z} ) end end function onPlayerLogin (_, playeraccount ) if not playeraccount then playeraccount = getPlayerAccount(source) end if ( playeraccount ) then local x, y, z = unpack(getAccountData ( playeraccount, "pos" )) --if ( old ) then setElementPosition ( source, x,y,z ) --end end end addEvent("savePos",true) addEventHandler("savePos",root,onPlayerLogin) addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
-
function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then local x,y,z = getElementPosition( source ) setAccountData ( playeraccount, "pos", {x,y,z} ) end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local x, y, z = unpack(getAccountData ( playeraccount, "pos" )) --if ( old ) then setElementPosition ( source, x,y,z ) --end end end addEvent("savePos",true) addEventHandler("savePos",root,onPlayerLogin) addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
-
No. viewtopic.php?f=91&t=90836#p815961
-
Try: table.sort(TEMP_TABLE, function(a, b) return a[1] < b[1] end) Then just set TEMP_TABLE to toptimes variable.
-
toggleAllControls -- or setElementFrozen
-
I guess: setWeaponProperty
-
They must have disabled it and replaced it with their own. toggleControl(player, "radar", false)
-
Your libmysqlclient.so.16 must be corrupted. Try replacing it with this one.
-
You are searching for a gamemode called multigamemode, if I understood you correctly. You most likely can't make it. This requires a lot of time and experience in Lua. You'll need several functions listed here. You won't need all if you're making regular race just: createMarker createObject setElementDimension spawnPlayer setElementPosition And maybe you'll need some more functions. You'll also need XML functions to get spawnpoints and checkpoints from it. I recommend you to check this viewtopic.php?f=108&t=83045#p755960
-
There is no proper solution. Only setMarkerColor. Maybe later I'll reproduce the bug with alpha, which is probably a bug in MTA source repo. I'll let you know if it works or not.
-
It should work. If not you can do small workaround. Set marker size to 0 or set dimension.
-
setMarkerColor Last argument
-
You can check if specific function exist. function checkSide() if triggerServerEvent then -- It's client side else -- It's server side end end
-
Pretty good, I have suggestion also. When camera goes like inside the building, it would push it a bit forward (so it doesn't suffocate) or something. You can figure something out. Good luck tho.
-
Well, sometimes it's good while you're not in server to see debug and what's going on. Anyhow, I'm pretty interested in this project you're developing. Most people (at least what I've heard) say that Roleplay or real life gamemodes are better on SAMP than on MTA. I hope this will change their opinion hah. I could contribute anyhow because it seems pretty interesting. Good luck!
-
Why the hell do you need that function? It's unsafe and totally useless. Function triggerServerEvent returns boolean, but only when it's successful, it does not return from client side whatsoever. You have to send back details to client side. triggerClientEvent Is that too much work for you? Or are you just lazy?
-
Can you read syntax? gui-scrollbar guiCreateScrollBar ( float x, float y, float width, float height, bool horizontal, bool relative, [gui-element parent = nil]) And your width and height is 0. guiCreateScrollBar(0,0,50,50,false,false,ShopWindow)
-
local cjclothesmarker = { [1]={x=1648.5601806641,y=1732.7150878906,z=10.671875,dim=0,int=0} } local cjTable = { ["Torso"] = 100, ["Hair"] = 130, ["Legs"] = 150, ["Shoes"] = 170, ["Left Upper Arm"] = 110, ["Left Lower Arm"] = 110, ["Right Upper Arm"] = 110, ["Right Lower Arm"] = 110, ["Black Top"] = 120, ["Left Chest"] = 120, ["Right Chest"] = 120, ["Stomach"] = 140, ["Lower Back"] = 140, ["Extra1"] = 200, ["Extra2"] = 230, ["Extra3"] = 260, ["Extra4"] = 250 } addEventHandler("onResourceStart",resourceRoot, function () for index, pos in pairs(cjclothesmarker) do local cjmarker = createMarker(pos.x, pos.y, pos.z-1, "cylinder", 1.6, 247,187, 7, 120) setElementInterior(cjmarker, pos.int) setElementDimension(cjmarker, pos.dim) addEventHandler("onMarkerHit",cjmarker,onCJMarkerHit) end end) function onCJMarkerHit(player, dim) if not dim then return end if getElementType(player) == "player" then if getElementModel(player) > 0 then outputChatBox("Clothing Shop: You need the CJ skin to be able to buy clothes.",player,255,0,0) return end local result = {} local texture, model -- get all clothes result.allClothes = {} result.playerClothes = {} for type=0,17 do table.insert(result.allClothes, {type = type, name = getClothesTypeName(type)}) texture, model = getPedClothes(player, type) if texture then result.playerClothes[type] = {texture = texture, model = model} end end triggerClientEvent(player,"cjshop:show",player,result) end end addEvent("cjshop:buy",true) addEventHandler("cjshop:buy",root, function (client, tempTable) local cashToPay = 0 if (#tempTable > 0) then for index, cloth in pairs(tempTable) do if clothingPrices[getClothesTypeName(getTypeIndexFromClothes(cloth[1], cloth[2]))] then cashToPay = cashToPay + tonumber(clothingPrices[getClothesTypeName(getTypeIndexFromClothes(cloth[1], cloth[2]))]) end end end if getPlayerMoney(client) >= cashToPay then outputChatBox(client,"CJ Shop: you don't have money to buy clothes.",255,0,0) for index, cloth in pairs(tempTable) do addPedClothes(client, cloth[1], cloth[2], getTypeIndexFromClothes(cloth[1], cloth[2])) end saveNewClothing(client) takePlayerMoney(client, tonumber(cashToPay)) outputChatBox(client, "Clothing shop: Come back soon!",0,255,0) else outputChatBox(client, "Clothing shop: You need "..tonumber(cashToPay) .." to buy this clothing.",255,0,0) end end) function saveNewClothing(player) for type=0,17 do local texture, model = getPedClothes(player, type) setAccountData(getPlayerAccount(player),"clothes_".. type,tostring(texture) ..",".. tostring(model)) end end
-
Well, you can't make a GUI detecting some data without client side.
-
Use regex. /^[a-zA-Z][\sa-zA-Z]*$/ Would do the job.
-
Doesn't help. Client side?
-
Use setAccountData instead of assigning ACL for duty state. setAccountData(getPlayerAccount(thePlayer), "duty", true) -- Onduty setAccountData(getPlayerAccount(thePlayer), "duty", true) -- Offduty Would look like this: addCommandHandler("duty", function(thePlayer) local account = getPlayerAccount(thePlayer) if not isObjectInACLGroup("user."..getAccountName(account), aclGetGroup"Admin") then return end if getAccountData(account, "duty") ~= true then setAccountData(account, "duty", true) -- Now he's onduty else setAccountData(account, "duty", false) -- Offduty. end end )