Jump to content

bandi94

Members
  • Posts

    1,037
  • Joined

  • Last visited

Everything posted by bandi94

  1. I started learning LUA whit wiki +some very easy scripts and opening some downloaded script ( but i have 4 year's exp in C++) you will learn a litel harder try to make some easy scripts and opening some scripts and see how its maked
  2. i tested it and work when the resource is started when the next map start all blips are white
  3. ------------ -- Events -- ------------ function playerJoined() check(source) end addEventHandler("onPlayerJoin",getRootElement(),playerJoined) function playerChangedNick(oldNick,newNick) -- Use timer to wait until the nick really has changed setTimer(check,1000,1,source) end addEventHandler("onPlayerChangeNick",getRootElement(),playerChangedNick) function playerQuit() removePlayerFromTeam(source) end addEventHandler("onPlayerQuit",getRootElement(),playerQuit) -- Check for ACL Groups on login/logout function loggedIn() check(source) end addEventHandler("onPlayerLogin",getRootElement(),loggedIn) function loggedOut() check(source) end addEventHandler("onPlayerLogout",getRootElement(),loggedOut) -- Holds the teams as defined in the settings local teams = {} --- -- Reads the settings and creates the teams if enabled. -- function initiate() local rootNode = getResourceConfig("config.xml") local children = xmlNodeGetChildren(rootNode) if children == false then return end for _,node in pairs(children) do local attributes = xmlNodeGetAttributes(node) local name = attributes.name local color = {getColorFromString(attributes.color)} if not color[1] then color = {255,255,255} end teams[name] = attributes teams[name].color = color if not toboolean(get("noEmptyTeams")) then teams[name].team = createTeam(name,unpack(color)) end end for k,v in pairs(getElementsByType("player")) do check(v) end end addEventHandler("onResourceStart",getResourceRootElement(),initiate) --------------- -- Functions -- --------------- --- -- Checks the player's nick and ACL Groups and sets his team if necessary. -- -- @param player player: The player element -- function check(player) if not isElement(player) or getElementType(player) ~= "player" then debug("No player") return end local nick = getPlayerName(player) local accountName = getAccountName(getPlayerAccount(player)) for name,data in pairs(teams) do local tagMatch = false local aclGroupMatch = false if data.tag ~= nil and string.find(nick,data.tag,1,true) then tagMatch = true end if data.aclGroup ~= nil and accountName and isObjectInACLGroup("user."..accountName,aclGetGroup(data.aclGroup)) then aclGroupMatch = true end if data.required == "both" then if tagMatch and aclGroupMatch then addPlayerToTeam(player,name) return end else if tagMatch or aclGroupMatch then addPlayerToTeam(player,name) return end end end removePlayerFromTeam(player) setPlayerTeam(player,nil) end --- -- Adds a player to the team appropriate for the name. -- It is not checked if the team is really defined in the table, since -- it should only be called if it is. -- -- Creates the team if it doesn't exist. -- -- @param player player: The player element -- @param string name: The name of the team -- function addPlayerToTeam(player,name) local team = teams[name].team if not isElement(team) or getElementType(team) ~= "team" then team = createTeam(teams[name].name,unpack(teams[name].color)) teams[name].team = team end setPlayerTeam(player,team) debug("Added player '"..getPlayerName(player).."' to team '"..name.."'") local attached = getAttachedElements (player) local redBar, greenBar, blueBar = unpack(teams[name].color) if (attached) then for k,element in ipairs(attached) do if getElementType (element) == "blip" then setBlipColor(element,redBar,greenBar,blueBar,255) end end end end --- -- Removes a player from a team. Also checks if any team -- needs to be removed. -- -- @param player player: The player element -- function removePlayerFromTeam(player) setPlayerTeam(player,nil) debug("Removed player '"..getPlayerName(player).."' from team") if toboolean(get("noEmptyTeams")) then for k,v in pairs(teams) do local team = v.team if isElement(team) and getElementType(team) == "team" then if countPlayersInTeam(team) == 0 then destroyElement(team) end end end end end --- -- Converts a string-boolean into a boolean. -- -- @param string string: The string (e.g. "false") -- @return true/false Returns false if the string is "false" or evaluates to false (nil/false), true otherwise -- function toboolean(string) if string == "false" or not string then return false end return true end ----------- -- Debug -- ----------- -- Little debug function to turn on/off debug setElementData(getResourceRootElement(),"debug",true) function debug(string) if getElementData(getResourceRootElement(),"debug") then outputDebugString("autoteams: "..string) end end
  4. use "/debugscript 3" to find the error
  5. bandi94

    Weapons Blips

    https://wiki.multitheftauto.com/wiki/CreateBlip
  6. bandi94

    Join Handler

    the play resourc have a default respawn place ...
  7. you can try to bring the car litel up whit modifi car z position or i don't know how
  8. bandi94

    Join Handler

    we use "onPlayerJoin" and when somebody get killed then you get respawn whit the normal play script respawn you need to add "onPlayerWasted" and "onPlayerJoin"
  9. you don't need to open the script to find out its a trick to get spectators number you don't need to give admin right
  10. bandi94

    Join Handler

    function spaw(player) spawnPlayer(player, x , y ,z , 0 , skin id ) end addEventHandler("onPlayerJoin",root,spaw) next time make it yourself use wiki ..
  11. bandi94

    IMAGE DESTOY

    use setCamera... and createObject, moveObject .. ( if you mean a hunter land or something like this )
  12. function kill() killTimer(timername) end addCommandHandler("kt",kill) this is what you ask ?
  13. use /debugscript 3 find the error and say where is the error
  14. check my code i edited it now is workin ... BinSlayer1 if you copy past a code then see if your edited code is working or not ...
  15. function OutputChatbox(thePlayer) outputChatBox (""..getPlayerName(thePlayer).."is now part of the police force!") end addCommandHandler ("police",OutputChatbox)
  16. addEventHandler("onVehicleEnter", getRootElement(), function(thePlayer, seat, jacked) currentElement = createObject(3790, 0.0, 0.0, 0.0)--- the object what to attach 3790 is the object id attachElements(currentElement, source, 1.08, 0.98, 0.28, 0.0, 0.0, 267.994) --- attach to the vehicle currentElement is the object, source is the car and the numbers are the distance form the car x,y,z and rotation x,y,z end) server side
  17. i say that for SDK he think he is the "BOSS" and he say to me what to do ....... (SDK run and say to solidsnake what you say to me he write "functon") go fast if you think you are the BOss...
  18. SDK get out if you can-t delet a return part
  19. SDK ..... if you think i have time to check 3 times a script the ..... i am not obsessed to stay in fornt of comp all day long(like you) i made that script in les that 30 sec i forget to put and say to your ... what to do ok ..... and addEventHandler("onClientVehicleEnter", getLocalPlayer(), radio) its work 100% whit root and its clients side not server so ...
  20. https://wiki.multitheftauto.com/wiki/GetPlayerWeapon https://wiki.multitheftauto.com/wiki/GiveWeapon
  21. this is the version 1.1 whit live stearm i think ist or wrong the playSound("http://myradio.com/listen.pls") or is buged i don't tryed to use the new beta/test scripts of the new version
  22. function radio local vehicle = getPedOccupiedVehicle( getLocalPlayer() ) local id = getVehicleID(vehicle) if (id== write the car id ) then playSound("http://myradio.com/listen.pls") end end addEventHandler("onClientVehicleEnter",root,radio) if whit getVehicleID not work use getElementModel
  23. DjSt3rios if you wana make this for the rpm+gear meter only put playSound("sounds/turbo..mp3") whit a a function what check last gear and the actual gear if gear==lastgear then ... lastgear=gear and setTimer... ( and its for client side and teh rpm is client side ...)
×
×
  • Create New...