Jump to content

Hero192

Members
  • Posts

    512
  • Joined

  • Last visited

Everything posted by Hero192

  1. Okay,how to use setElementData for this setTimer and i want to get this elementdata for checking if this getElementData == true then the ghost mod be working and if it's ended mean false so then it must back to 255 ALPHA, NOTE: i want to use getElementData because i have to use this ghost system in other script Help me please if you know
  2. I didn't, it doesn't fit my problem
  3. I made an hospital system, i did that when the player spawn in the Nearest hospital he be alpha 155 and i added timer for it. Also i made an Spawner system my problem is, i want to check if the timer still not ended from hospital system then the player spawn a vehicle with alpha 155 and if the timer ended the player spawn a car with alpha 255 ,thats all addEvent ("Hospital", true) addEventHandler ("Hospital", root, function ( data ) spawnPlayer (source, data[2], data[3], data[4]+2, data[8], data[9], 0, 0) setCameraTarget (source,source) setElementData ( source, "SpawnProtectionEnabled", true ) setElementData ( source, "GodmodeEnabled", true ) setElementAlpha ( source, 150 ) toggleControl ( source, "fire", false ) toggleControl ( source, "next_weapon", false ) toggleControl ( source, "previous_weapon", false ) setTimer ( function ( source ) setElementData ( source, "GodmodeEnabled", false ) setElementData ( source, "SpawnProtectionEnabled", false ) setElementAlpha ( source, 255 ) toggleControl ( source, "fire", true ) toggleControl ( source, "next_weapon", true ) toggleControl ( source, "previous_weapon", true ) end, 10000, 1, source ) end) so i want to check if the SpawnProtectionEnabled == false then the setElementAlpha be 255 i tried that in the spawner system but doesn't working here's the part of my code when the player spawn a VEHICLE: addEvent("spawn",true) addEventHandler("spawn",root, function (player, ID, marker) if isElement(Vehicles[player]) then destroyElement(Vehicles[player]) end local x, y, z = getElementPosition(marker) Vehicles[player] = createVehicle(ID, x, y, z+3, 0, 0, markers[marker][3]) warpPedIntoVehicle(player, Vehicles[player]) setElementData(Vehicles[player],"allowedRoles",markers[marker][1]) setElementData(Vehicles[player],"allowedData",markers[marker][4]) if (Vehicles[player] and getElementData ( player, "isSpawnProtectionEnabled" ) == true) then setElementData ( player, "isSpawnProtectionEnabled", true ) setElementData ( player, "isGodmodeEnabled", true ) setElementAlpha ( Vehicles[player], 150 ) toggleControl ( player, "fire", false ) toggleControl ( player, "next_weapon", false ) toggleControl ( player, "previous_weapon", false ) elseif (veh and getElementData ( player, "isSpawnProtectionEnabled" ) == false) then setElementData ( player, "isGodmodeEnabled", false ) setElementData ( player, "isSpawnProtectionEnabled", false ) setElementAlpha ( Vehicles[player], 255 ) toggleControl ( player, "fire", true ) toggleControl ( player, "next_weapon", true ) toggleControl ( player, "previous_weapon", true ) end end)
  4. Hey guy i want to do an countries language chat system Which functions and events should i use, like for example Only people who from Brazil people can use this chat
  5. Anyone please can give me a hand?
  6. When i use the Cursor from this resource i binded it in a key, for example if i want to hide the cursor after clicking on the button it doesn't works i have to exports the cursor from the Cursor file, so please just helps me to exports it because i don't know how and i know what am i talking about..
  7. Hey guys , I want to do an exports for Cursor, i want it be like that exports.Mouse:mouse(false) replace the showCursor(false) because i use the resource Mouse and if i want to cancel the mouse i need to do an exports it doesn't cancel it with showCursor i already tried that. --Mouse script for export: (I already added the function exports to meta, problem is on the script i tried this way but doesn't works , please give me a hand if you know.. function enablemouse (key, keyState) if(isCursorShowing()) then showCursor(false) end end function mouse () return enablemouse end
  8. For example: i have a table i will get something from the table and convert them and tell me if im wrong or right local Table= { {"Jack",900}, } for index, v in ipairs (Table) do outputChatBox(tostring(v[1]).. " got " ..tonumber(v[2]).."$",root,255,0,0) end
  9. Hey guys, i want to be sure of these lua functions , tonumber and tostring don't recomand me the lua.org website because it's hard to get it from them. Give me some examples only if you are sure you know about these functions i wont get something wrong Thanks
  10. Hey guys how to make a button visible but not clickable?
  11. Anyone can help me here please?
  12. Hey guys, as the title say ,how to disable players GTA sa Mods and do not let them join a server if they're with it which functions should i use Like if a player got a GTA mod in his GTA (skin / car / weapon..etc) he can't use them ,he can only use the server mods
  13. Doesn't working even with that, anyone? i want to know what should i do to let the player see the screen on joining and warp to this position addEventHandler("onPlayerJoin",root, function() setElementPosition(source,329.10980224609, -2117.2749023438, 40.161201477051) setCameraTarget(source,source) fadeCamera(source,false) end)
  14. I tried that but doesn't works, what i have to do ? i want to create gamemode addEventHandler("onPlayerJoin",root, function() setElementPosition(source,329.10980224609, -2117.2749023438, 40.161201477051) setCameraTarget(source,source) fadeCamera(source,source) end)
  15. Hey guys, i tried to make a gamemode so, i removed all the default MTA scripts i let only "web resources" then i added my resources but, when i try to enter in game (i can't ) i face a BLACK SCREEN, why that? What i have to add? (i won't add the freeroam / play resources) i want make gamemode
  16. Thanks both of you , i understood my problem
  17. I want when i hit the pickup the gui be visible, but this doesn't works, any one? it give warning and doesn't show the GUI, bad argument WARNING: Bad Argument @'TriggerClient Event( [Expected element at argument 3, got none] Client side: Window = guiCreateWindow(491,318,399,175,"",false) guiWindowSetSizable(Window,false) guiSetVisible(Window,false) yes = guiCreateButton(230,133,143,33,"Accept",true,Window) no = guiCreateButton(26,133,143,33,"Cancel",true,Window) addEvent("show",true) addEventHandler("show",root, function () guiSetVisible(Window,true) showCursor(true) end) Server side: WARNING: Bad Argument @'TriggerClient Event( [Expected element at argument 3, got none] local pickup = createPickup(2196.70,1677.11,12.36,3,1273,0) addEventHandler ( "onPickupHit", pickup, function( hitPlayer ) if (hitPlayer and getElementType ( hitPlayer ) == 'player' and not isPedInVehicle (hitPlayer) ) then triggerClientEvent(hitPlayer,"show") end end)
  18. And,How to create Database?
  19. Small Question, Mysql = SQL? or Sqlite = SQL
  20. Hey Citizen, i used your first code i didn't modify it, and i did the setElementData CriminalBlip = createBlipAttachedTo ( Vehicle, 51 ) setElementData(CriminalBlip, "visibleForTeam", Criminal) --Like that but it still showing for No Criminal Team, maybe im wrong, can you correct me please? updateTeamBlipsVisibility() --Your code: ------------------------------------- ---- /!\ DO NOT MODIFY BELOW /!\ ---- ------------------------------------- ------- Logic for the onPlayerChangeTeam event ------- addEvent("onPlayerChangeTeam", true) local _playersTeamCache = {} function onPlayerChangeTeamWatcher() -- DO NOT MODIFY for i, player in ipairs(getElementsByType("player")) do local pTeam = getPlayerTeam(player) local oldTeam = _playersTeamCache[player] or false if pTeam and pTeam ~= oldTeam then -- If he changed team triggerEvent("onPlayerChangeTeam", player, oldTeam, pTeam) _playersTeamCache[player] = pTeam end end end setTimer(onPlayerChangeTeamWatcher, 600, 0) --[[ you can change the "sensibility" of the team change detection: the lower the timer is, the faster the event will be triggered but it can produces lags on a big amount of players and blips ]] addEventHandler("onPlayerQuit", root, function () _playersTeamCache[source] = nil end) ------------------------------------------------------ ----------- Logic for the team blips system ---------- -- This function will get all blips that should be visible for a team and will show it for that entire team and will hide it for all others function updateTeamBlipsVisibility() -- DO NOT MODIFY for k, blip in ipairs(getElementsByType("blip")) do local blipTeam = getElementData(blip, "visibleForTeam") if blipTeam and getElementType(blipTeam) == "team" then clearElementVisibleTo(blip) -- reset the visibility settings for the blip setElementVisibleTo(blip, root, false) -- hide for everyone setBlipVisibleForTeam(blip, blipTeam) -- show for the entire team the blip is associated with end end end -- show a blip for an entire team it is associated with function setBlipVisibleForTeam(blip, team) -- DO NOT MODIFY for i, player in ipairs( getPlayersInTeam(team) ) do setElementVisibleTo(blip, player, true) end end addEventHandler("onPlayerChangeTeam", root, function () updateTeamBlipsVisibility() end) ----------------------------------------------------
×
×
  • Create New...