
drk
Members-
Posts
1,607 -
Joined
-
Last visited
Everything posted by drk
-
You are trying to add two times the same event ( onClientRender ).
-
Hey all again. I'm having a problem with the top hunter again. Yesterday, the top hunter is working perfectly. Today, when I start my test server again and started the resource I get False in all values again I get error: Bad argument @ 'getResourceName' and Attempt to concatenate local 'map' ( a nil value ). Error lines: --Bad argument @ 'getResourceName' return getResourceName( exports['mapmanager']:getRunningGamemodeMap( ) ) --Attempt to concatenate local 'map' ( a nil value ) local result = executeSQLQuery ( "SELECT player, time FROM Top WHERE map = '" ..map.. "'" ) map variable: local map = currentMapName( ) I tried to change from a function to only exports.mapmanager:getRunningGamemodeMap() but don't work too. If I get Top in any map it works perfect, but until I get top I get these errors .
-
Dude, stop being a noob. 1º - You can't modify compiled files 2º - We don't help people who stole scripts from others ( if it's a stolen script ) 3º - If you don't post the uncompiled code, we can't help you.
-
Top hunter... My bad, I forget that when all players quit server element data is deleted...
-
Something I will send you the whole code via PM. Edit: Level system is working now. Only top hunter, I get false in all values
-
Its what I did before and don't work
-
Can someone heelp me with SQL and boolean values? I'm trying to make a level system but I get: bad argument @ getPlayerName and attempt to concatenate a bolean value addEventHandler( 'onPlayerLogin',root, function( ) local level = getAccountData(getPlayerAccount(source),'My Level') timer[ source ] = setTimer( function() local account = getPlayerAccount( source ) if not isGuestAccount( account ) then local result = executeSQLQuery("SELECT money FROM Money WHERE player= '"..getPlayerName(source).."'") - ERROR in this line local money = tonumber(result[1]['money']) if money <= tonumber(50000) and getElementData(source,'Race Wins') < 10 then setAccountData( account,'My Level','Newbie' ) setElementData( source,'Level','Newbie' ) elseif money <= tonumber(250000) and money > tonumber(50000) and getElementData(source,'Race Wins') < 50 and getElementData(source,'Race Wins') > 10 then setAccountData( account,'My Level','Regular' ).... And I get False on my top hunter return values addEventHandler( 'onGamemodeMapStart',root, function() local result = executeSQLQuery ( "SELECT * FROM Top WHERE map = '" ..map.. "'" ) if not result or #result == 0 then executeSQLQuery( "INSERT INTO Top VALUES ('"..map.."','No one', '"..tonumber(100)..":"..tonumber(100).."')" ) local resultt = executeSQLQuery ( "SELECT * FROM Top WHERE map = '" ..map.. "'" ) setElementData( root,'playerName',tostring( resultt[1]['player'] ) ) setElementData( root,'timeMT',tostring( resultt[1]['time'] ) ) triggerClientEvent('clientStart',root) else setElementData( root,'playerName',tostring( result[1]['player'] ) ) setElementData( root,'timeMT',tostring( result[1]['time'] ) ) triggerClientEvent('clientStart',root) end end ) Isn't my whole code.
-
oh you mean it will make me visible again when i type /hide without putting setElementAlpha(source,255) and setPlayerNametagShowing(source,true) in the script? No. This only get player acl group and if is in admin, smod or mod it will set element alpha and hide player nametag. If you want to set default again see what Kenix made.
-
It dont need setElementAlpha(source,255) setPlayerNametagShowing(source,true) because it will return if player is admin, smod or mod, if isn't one of these it will output in chat box, nothing more. Then dont need this
-
Server side: function hideMe() local acc = getAccountName(getPlayerAccount(source)) if getElementAlpha(source) == 255 and isPlayerNametagShowing(source) then if isObjectInACLGroup('user.' .. acc, aclGetGroup('Admin')) then setPlayerNametagShowing(source,false) setElementAlpha(source,0) end elseif isObjectInACLGroup('user.' .. acc, aclGetGroup('SuperModerator')) then setPlayerNametagShowing(source,false) setElementAlpha(source,0) end elseif isObjectInACLGroup('user.' .. acc, aclGetGroup('Moderator')) then setPlayerNametagShowing(source,false) setElementAlpha(source,0) end else outputChatBox('You are not allowed to use this command!', source, 255, 0, 0, false) end end addCommandHandler('hide',hideMe) Why he needs setElementAlpha(source,255) setPlayerNametagShowing(source,true) ?
-
Wow! Top Hunter done Thanks for all again Kenix and Solidsnake. Anyone lock or move to trash this post.
-
Ye, thanks for all. I will start searching there before create a topic or reply with a noob question
-
\õ/ MTA SA Wiki have this functions in Resources page?
-
I think this function no longer exists..
-
How can I get the map name without using onGamemodeMapStart? Because when a player joins the player get Top name: False Time: False because no map has been started for the local.
-
LOL? I tried to solve his problem, not to correct the script variables. And, why you don't help too instead of saying nonsenses?
-
Maybe this resource has been made for MTA SA 1.0.0? oO Hahaha
-
Yeah, but it is a community resource. Maybe it's outdated.
-
Maybe this? local client = getLocalPlayer( ) local rootElement = getRootElement() local truckmarker = nil local truckblip = nil addEvent("truck_set_location",true) addEventHandler("truck_set_location",rootElement, function (x, y, z) truckmarker = createMarker(tostring(x), tostring(y), tostring(z)-1, "cylinder", 10, 184, 57, 14, 170) truckblip = createBlipAttachedTo( truckmarker, 19 ) addEventHandler("onClientMarkerHit",truckmarker,onTruckStopHit) end) function onTruckStopHit(hitPlayer) if not hitPlayer == client then return end triggerServerEvent("truck_finish",client,client) if isElement(truckblip) then destroyElement(truckblip) end if isElement(truckmarker) then removeEventHandler("onClientMarkerHit",truckmarker,onTruckStopHit) end end addEventHandler("onClientVehicleExit",rootElement, function () if isElement(marker) then removeEventHandler("onClientMarkerHit",truckmarker,onTruckStopHit) destroyElement(truckmarker) end if isElement(truckblip) then destroyElement(truckblip) end end)
-
We can use like this? local myTable = { [1] = { question='What the Fuck?!', answer='This is a shit!' }, [2] = { question='What the Hell?!', answer='I know, this is a shit xd' } } for i, data in ipairs(myTable) do if myTable[1]['question'] then -- We can use like myTable[index]['value1'] ?? outputChatBox(myTable[1]['answer']) end end I don't know why I need 'if myTable[1]['question'] It's only a example.
-
Para fazer algo decente, é.
-
Thanks dude. It worked. Now I can solve my level system script error
-
local min, sec = convertTime(time) --if time is better than the top 1 theTime = executeSQLQuery( "SELECT time FROM Top WHERE map = '" ..mapName.. "'" ) local old = split(theTime[1]['time'],':') if old[1] < time and old[2] < time then triggerEvent('onGotTop',source) --update top executeSQLQuery( "UPDATE Top SET player= '"..player.."', time= '"..min..":"..sec.."' WHERE map='"..mapName.."'" ) But time variable is only one, if I compare with min and sec it will return string and I will get error "Attempt to compare string with number"