itHyperoX
Members-
Posts
522 -
Joined
-
Last visited
-
Days Won
1
Everything posted by itHyperoX
-
Right click on your draw or text, then click on "Relative" the default value is "Absolute".
-
triggerServerEvent("triggetSomething",getLocalPlayer(),triggetSomething) -- Client --Server addEvent("triggetSomething",true) addEventHandler("triggetSomething",root,function() -- Your code here end)
-
when u type /pvp use setElementData(player,"weapon-id1,weapon) then takeplayer weapon when out of pvp zone getelementdanta weapon-id1 then giveWeapon removeElementData
-
addEventHandler ( "onClientChatMessage", root, function ( text ) if text == "login: You successfully logged in" then cancelEvent() end end) client
-
exports["inventory"]:addPlayerItem(player,ItemID, Amount) for me working
-
give us the code, without that hard to help
-
When changing the weather, randomly get this erro: Error:Line 23 : attemt to index local 'weather' (a nil value) then the timer dead. Need to restart. After some time again error, then need restart..
-
Error:Line 23 : attemt to index local 'weather' (a nil value) local weatherTable={ { weatherid=0, name="Nagyon meleg"}, { weatherid=1, name="Meleg"}, { weatherid=2, name="Napos, kissé ködös"}, { weatherid=9, name="Ködös"}, } local currentWeatherTable={} function setNewWeather() while (#currentWeatherTable<7) do table.insert(currentWeatherTable,weatherTable[math.random(1,#weatherTable)]) end end function weatherSystemStart() setWeather(1) end addEventHandler("onResourceStart", resourceRoot,setNewWeather) addEventHandler("onResourceStart", resourceRoot,weatherSystemStart) function newWeather() local weather=table.remove(currentWeatherTable,1) outputChatBox("The Weather changes. ("..weather.name..")",root,255,255,255,true) setWeather(weather.weatherid) end setTimer(newWeather,360,0) Whats the problem?
-
with this work. What can be the problem?
-
its is.. <script src="codeS.lua" type="server" />
-
i tried nothing in debug. Tried with :outputServerLog("login "..getElementDimension(source).."") always 0
-
Why not saving dimension? function onPlayerQuit ( ) local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in local dim = getElementDimension ( source ) -- get the player dim setAccountData ( playeraccount, "dimension", dim ) -- save it in his account end end function onPlayerLogin (_, playeraccount ) if ( playeraccount ) then local dim = getAccountData ( playeraccount, "dimension" ) if ( dim ) then setElementDimension ( source, dim ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
-
Hi. Whats the problem? debug error: line:10/attempt to index field '?' (nil value) g_Root = getRootElement() g_ResRoot = getResourceRootElement(getThisResource()) g_PlayerData = {} function joinHandler(player) if not player then player = source end local r, g, b = math.random(50, 255), math.random(50, 255), math.random(50, 255) g_PlayerData[player].blip = createBlipAttachedTo(player, 0, 2, r, g, b) -- Line 10 end addEventHandler('onPlayerJoin', g_Root, joinHandler) addEventHandler('onResourceStart', g_ResRoot, function() joinHandler(player) end ) function quitHandler(player) if type(player) ~= 'userdata' then player = source end if g_PlayerData[player].blip and isElement(g_PlayerData[player].blip) then destroyElement(g_PlayerData[player].blip) end g_PlayerData[player] = nil end addEventHandler('onPlayerQuit', g_Root, quitHandler) addEventHandler('onResourceStop', g_ResRoot, function() for player,data in pairs(g_PlayerData) do quitHandler(player) end end )
-
bad argument #1 to "ceil" (number expected, got string)
-
Hi. I made a old time samp bank script, i got 1 little problem. The deposit command looks like this: The problem is, when i just type /deposit, it show the syntax, but when i type something /deposit xdxd (Not number) then i get this debug error: 14: bad argument #1 to 'ceil' (number expected, got string) How can i make that, when player type something, return to syntax? addCommandHandler("deposit",function(player,cmd,money) local money = tonumber(math.ceil(money)) -- line 14 if not money then outputChatBox(syntax.." /"..cmd.." [Amount]",player,38,194,129,true) else if (money) <= 0 then outputChatBox(error.." Bigger hatn 0.",player,177,9,45,true) elseif exports["rc_core"]:getMoney(player) >= tonumber(money) then exports["rc_core"]:takeMoney(player,tonumber(money)) giveBankMoney(player,money) else outputChatBox(error.." You cant afford that.",player,177,9,45,true) end end end )
-
Can you help me please, how did u fixed that "hex" ? I tried many times..
-
I highly recommend you to use setElementData, getElementData for administrator system! If you want, you can use feel free , and if you need more help you can PM me! --< Belépéskor >-- addEventHandler("onPlayerLogin", getRootElement(),function(_, account) tonumber(setElementData(source, "acc.admin", tonumber(getAccountData(account, "acc.admin"))) or 0) end) --< Mentés >-- addEventHandler('onPlayerQuit',root,function( account ) local account = eventName == 'onPlayerLogout' and account or getPlayerAccount(source) if (account) and (not isGuestAccount(account)) then setAccountData(account,'acc.admin',getElementData(source,'acc.admin') or 0) end end)
-
Hi, i want to create a very simple script, when player join attachblip to player, when he left destroy. Can anybody give me a tip, what should i use for this I want attach blip which is looks like triangle.