Jump to content

drk

Members
  • Posts

    1,607
  • Joined

  • Last visited

Everything posted by drk

  1. pressed = false player = localPlayer function resetState( ) pressed = false end ---------------------------- Create --------------------------------------------- myWindow = guiCreateWindow ( 0.20, 0.20, 0.6, 0.6, "Test Window", true ) Label = { guiCreateLabel(15 , 24, 220, 17,"Name: N/A",true,myWindow), guiCreateLabel(15 , 24 ,220 , 17,"IP: N/A",true,myWindow), guiCreateLabel(0.03,0.34,0.66,0.0887,"Money: N/A",true,myWindow), guiCreateLabel(0.03,0.39,0.17,0.0806,"Health: N/A",true,myWindow), guiCreateLabel(0.20,0.39,0.30,0.0806,"Armour: N/A",true,myWindow), guiCreateLabel(0.03,0.44,0.17,0.0806,"Skin: N/A",true,myWindow), guiCreateLabel(0.20,0.44,0.30,0.0806,"Weapon: N/A",true,myWindow), guiCreateLabel(0.03,0.49,0.66,0.0806,"Faction: N/A",true,myWindow), guiCreateLabel(0.03,0.27,0.66,0.0806,"Ping: N/A",true,myWindow), guiCreateLabel(0.03,0.56,0.66,0.0806,"Vehicle: N/A",true,myWindow), guiCreateLabel(0.03,0.63,0.66,0.0806,"Warns: N/A",true,myWindow), guiCreateLabel(0.6,0.41,0.4031,0.0766,"Location: N/A",true,myWindow), guiCreateLabel(0.6,0.12,0.4031,0.0766,"X:",true,myWindow), guiCreateLabel(0.6,0.17,0.4031,0.0766,"Y: N/A",true,myWindow), guiCreateLabel(0.6,0.22,0.4031,0.0766,"Z: N/A",true,myWindow), guiCreateLabel(0.6,0.29,0.2907,0.0806,"Interior: N/A",true,myWindow), guiCreateLabel(0.6,0.34,0.2907,0.0806,"Dimension: N/A",true,myWindow), guiCreateLabel(0.03,0.17,0.66,0.0887,"Admin Level: N/A", true,myWindow), guiCreateLabel(0.03,0.22,0.66,0.0887,"Donator Level: N/A",true,myWindow), guiCreateLabel(0.6,0.48,0.4093,0.0806,"Hours Ingame: N/A",true,myWindow), } guiSetVisible( myWindow,false ) for _,v in pairs( Label ) do guiSetVisible( v,false ) end ---------------------------[HELP]-------------------- function F4Uc( key, keyState ) if not (pressed) then pressed = true setTimer(resetState, 200, 1) for _,v in pairs( Label ) do guiSetVisible( v,not guiGetVisible( v ) ) end guiSetVisible( myWindow,not guiGetVisible( myWindow ) ) showCursor( not isCursorShowing( ) ) end end bindKey( "F4", "down", F4Uc ) addEventHandler( "onClientRender", root, function() if isElement( myWindow ) and guiGetVisible( myWindow ) then guiSetText ( Label[1], "Name: " .. getPlayerName(player) .. " (" ..tostring( getElementData( player, "gameaccountusername" ) ) .. ")") local x, y, z = getElementPosition(player) guiSetText ( Label[13], "X: " .. x ) guiSetText ( Label[14], "Y: " .. y ) guiSetText ( Label[15], "Z: " .. z ) guiSetText ( Label[3], "Money: $" .. tostring( exports.global:getMoney( player ) ) .. " (Bank: $" .. tostring( getElementData( player, "bankmoney" ) ) .. ")") guiSetText ( Label[4], "Health: " .. tostring( math.ceil( getElementHealth( player ) ) ) ) guiSetText ( Label[5], "Armour: " .. tostring( math.ceil( getPedArmor( player ) ) ) ) guiSetText ( Label[6], "Skin: " .. tostring( getElementModel( player ) ) ) local weapon = getPedWeapon( player ) if weapon then weapon = getWeaponNameFromID( weapon ) else weapon = "N/A" end guiSetText ( Label[7], "Weapon: " ..tostring( weapon ) ) local team = getPlayerTeam(player) if team then guiSetText ( Label[8], "Faction: " ..tostring( getTeamName( team ) ) ) else guiSetText ( Label[8], "Faction: N/A") end guiSetText ( Label[9], "Ping: " ..tostring( getPlayerPing( player ) ) ) local vehicle = getPedOccupiedVehicle( player ) if vehicle then guiSetText ( Label[10], "Vehicle: " .. getVehicleName( vehicle ) .. " (" ..tostring( getElementData( vehicle, "dbid" ) ) .. ")" ) else guiSetText ( Label[10], "Vehicle: N/A") end guiSetText ( Label[12], "Location: " .. tostring( getZoneName( x, y, z ) ) ) guiSetText ( Label[16], "Interior: " .. tostring( getElementInterior( player ) ) ) guiSetText ( Label[17], "Dimension: " .. tostring( getElementDimension( player ) ) ) guiSetText ( Label[20], "Hours Ingame: " .. tostring( getElementData( player, "hoursplayed" ) or 0 ) ) end end ) Try this.
  2. local spam = {} local setting = get("kick") function loseSpam(player) if spam[player] > 0 then spam[player] = spam[player] - 1 end end function onChat ( message, messageType ) spam[source] = spam[source] or 0 spam[source] = spam[source] + 1 if spam[source] == 3 then outputChatBox("Warning - Do Not Spam! ",source,255,0,0) elseif spam[source] > 3 and setting == "true" then outputChatBox("Kicking " .. getPlayerName(source) .. " For Flooding The Chat!",getRootElement(),255,0,0) kickPlayer(source,"You Have Been Kicked For Flooding!") elseif spam[source] > 3 and setting == "false" then setPlayerMuted(source,true) outputChatBox(getPlayerName(source) .. " Has Been Auto Muted [20 sec]",getRootElement(),255,0,0) setTimer(setPlayerMuted,20000,1,source,false) end end addEventHandler ( "onPlayerChat", getRootElement(), onChat) function quitPlayer() spam[source] = nil end addEventHandler ( "onPlayerQuit", getRootElement(), quitPlayer ) Tested.
  3. Where this line lol? Show full code. LOL else destroyElement(myWindow) myWindow = nil showCursor(false) end end ) He posted the code
  4. drk

    adding XML Files

    I also wanna know this. But I think it is: Table > Makes it possible to use function on things inside this table. (take all the vehicle and use at one of these the script.) row and col> first check if they exist. "row and col and" Check count of them. "~= -1 and col ~= -1" Maybe we can find it here: http://www.lua.org/manual/5.1/manual.html PLS I seriously need to know if what I am saying is right!! Need some profesional information!! I think you're right. for name, file in pairs (myFiles) do -- Loop, used mostly when we are working with tables, this define the index ( if exists ) and data stored in it. pairs -- Is used for all tables ( non-indexed and indexed ) ipairs -- Is used for indexed tables, like the name: i = indexed, pairs = table if row and col and row ~= and col ~= -1 then -- I can't explain right, only what can I say is, if you don't put -1 and if you use onClientGUIClick it will not work when you click in any row... Start learning Lua: http://lua-users.org/wiki/TutorialDirectory
  5. I know that it's your v1. But it's a shit. CREATE YOUR OWN IDEAS. BE ORIGINAL!
  6. I think you can't change the player nick color...
  7. ---------------------------[HELP]-------------------- function F4Uc( key, keyState ) if guiGetVisible(myWindow) == false then myWindow = guiCreateWindow ( 0.20, 0.20, 0.6, 0.6, "Test Window", true ) Label = { guiCreateLabel(0.20, 0.20, 0.6, 0.6,"Name: N/A",true,Window), guiCreateLabel(0.20, 0.21, 0.6, 0.6,"IP: N/A",true,Window), guiCreateLabel(0.03,0.34,0.66,0.0887,"Money: N/A",true,Window), guiCreateLabel(0.03,0.39,0.17,0.0806,"Health: N/A",true,Window), guiCreateLabel(0.20,0.39,0.30,0.0806,"Armour: N/A",true,Window), guiCreateLabel(0.03,0.44,0.17,0.0806,"Skin: N/A",true,Window), guiCreateLabel(0.20,0.44,0.30,0.0806,"Weapon: N/A",true,Window), guiCreateLabel(0.03,0.49,0.66,0.0806,"Faction: N/A",true,Window), guiCreateLabel(0.03,0.27,0.66,0.0806,"Ping: N/A",true,Window), guiCreateLabel(0.03,0.56,0.66,0.0806,"Vehicle: N/A",true,Window), guiCreateLabel(0.03,0.63,0.66,0.0806,"Warns: N/A",true,Window), guiCreateLabel(0.6,0.41,0.4031,0.0766,"Location: N/A",true,Window), guiCreateLabel(0.6,0.12,0.4031,0.0766,"X:",true,Window), guiCreateLabel(0.6,0.17,0.4031,0.0766,"Y: N/A",true,Window), guiCreateLabel(0.6,0.22,0.4031,0.0766,"Z: N/A",true,Window), guiCreateLabel(0.6,0.29,0.2907,0.0806,"Interior: N/A",true,Window), guiCreateLabel(0.6,0.34,0.2907,0.0806,"Dimension: N/A",true,Window), guiCreateLabel(0.03,0.17,0.66,0.0887,"Admin Level: N/A", true,Window), guiCreateLabel(0.03,0.22,0.66,0.0887,"Donator Level: N/A",true,Window), guiCreateLabel(0.6,0.48,0.4093,0.0806,"Hours Ingame: N/A",true,Window), } end end end bindKey( "F4", "down", F4Uc ) addEventHandler( "onClientRender", root, function() if isElement( myWindow ) and guiGetVisible( myWindow ) then guiSetText ( Label[1], "Name: " .. tostring(getPlayerName(localPlayer)) .. " (" ..tostring( getElementData( localPlayer, "gameaccountusername" ) ) .. ")") local x, y, z = getElementPosition(localPlayer) guiSetText ( Label[13], "X: " .. x ) guiSetText ( Label[14], "Y: " .. y ) guiSetText ( Label[15], "Z: " .. z ) guiSetText ( Label[3], "Money: $" .. tonumber( exports.global:getMoney( localPlayer ) ) .. " (Bank: $" .. tonumber( getElementData( localPlayer, "bankmoney" ) ) .. ")") guiSetText ( Label[4], "Health: " .. tonumber( math.ceil( getElementHealth( localPlayer ) ) ) ) guiSetText ( Label[5], "Armour: " .. tonumber( math.ceil( getPedArmor( localPlayer ) ) ) ) guiSetText ( Label[6], "Skin: " .. tostring( getElementModel( localPlayer ) ) ) local weapon = getPedWeapon( localPlayer ) if weapon then weapon = getWeaponNameFromID( weapon ) else weapon = "N/A" end guiSetText ( Label[7], "Weapon: " ..tostring( weapon ) ) local team = getPlayerTeam(localPlayer) if team then guiSetText ( Label[8], "Faction: " ..tostring( getTeamName( team ) ) ) else guiSetText ( Label[8], "Faction: N/A") end guiSetText ( Label[9], "Ping: " ..tonumber( getPlayerPing( player ) ) ) local vehicle = getPedOccupiedVehicle( localPlayer ) if vehicle then guiSetText ( Label[10], "Vehicle: " .. getVehicleName( vehicle ) .. " (" ..tostring( getElementData( vehicle, "dbid" ) ) .. ")" ) else guiSetText ( Label[10], "Vehicle: N/A") end guiSetText ( Label[12], "Location: " .. tostring( getZoneName( x, y, z ) ) ) guiSetText ( Label[16], "Interior: " .. tonumber( getElementInterior( localPlayer ) ) ) guiSetText ( Label[17], "Dimension: " .. tonumber( getElementDimension( localPlayer ) ) ) guiSetText ( Label[20], "Hours Ingame: " .. tostring( getElementData( localPlayer, "hoursplayed" ) or 0 ) ) end end ) I think it will not work, but why not try?
  8. setTeamColor first argument isn't player element, but the team variable.
  9. Nada haver conexão partilhada com isso... Verifique se as portas 22003 a 44003 estão liberadas ( ou 22003-22005-22126 ).
  10. Acho que com mais ningúem acontece isso... Mas mesmo assim, reporte o bug no Bug Tracker.
  11. I agree with Benxamix2. Why all use Toolbox? Why all use Puma-Markers? Why all steal ideias from others? Why all don't do anything that no one has done before? Please, start creating your mapping style, create new ideas.
  12. I need to use LUA in one tabpanel LOL Lua is a scripting language. All you are doing is in Lua. And I don't understand this: I'm trying to make one of the tab to be able to use LUA within it, the "stats" tabpanel so it displays the player "looking" at the 'stats' panel >> their stats Explain in English
  13. drk

    spawn timer

    Because I am still learning Relax, no problem dude
  14. No problem Only don't forget: Don't use event, command handlers and timer function names before you create the function or you will get error. And pls, start tabulating your code
  15. Not sure, but afaik you should specify if it's server-side or client-side, then it must be like this: "SantaB" type="script" name="RvB" description="RvB" /> It's server-side. You don't need to specify the type ( if you don't specify then it will be server-side type ).
  16. You have to integrate this in your code. You don't understand this? It's only a example.
  17. local setting = get("kick") function flood(msg,msgType) if setting == true then outputChatBox("Please Dont Repate more then 3 Times or You Well Be Kicked. 1/0",source,255,255,0) outputChatBox("Please Dont Repate more then 3 Times or You Well Be Kicked. 2/2",source,255,255,0) outputChatBox("Please Dont Repate more then 3 Times or You Well Be Kicked. 3/3",source,255,255,0) outputChatBox(getPlayerName(source) .."Has Been Kicked For Flooding the Chat 3/3",255,0,255) kickPlayer ( source, "You Have Been Kicked For Flooding The Chat !") else setPlayerMuted(source,true) setTimer(setPlayerMuted,15000,1,source,false) end end Like this? Or like this: function flood(msg,msgType) local setting = get("kick") if setting == true then setTimer ( outputChatBox, 1500, 1, "Don't repeat again or you will be kicked! - First time" ) setTimer ( outputChatBox, 3000, 1, "Don't repeat again or you will be kicked! - Second time" ) setTimer ( outputChatBox, 5000, 1, "Don't repeat again or you will be kicked! - Third time" ) outputChatBox(getPlayerName(source).." has been kicked for flooding chat!",root,255,0,255,false) kickPlayer(source,"You have been kicked for flooding!") else setPlayerMuted(source,true) setTimer( function() setPlayerMuted(source,false) outputChatBox("You have been unmuted!",source,0,255,0,false) end, 15000,1) end end You have to integrate this in your code.
  18. drk

    [Help Me] Shader

    Mine? Or anksel script?
  19. I think that now it working. If not, I post the code.
  20. 1.onResourceStart --> trigger Client event onLoginLoad. 2.if player logout you destroy guis? 1.onResourceStart --> trigger Client event onLoginLoad. I will try 2.if player logout you destroy guis? Not
  21. drk

    [Help Me] Shader

    Can you show the full code?
  22. BORING... BORING... BORING... And with stolen and old ideias
×
×
  • Create New...