Jump to content

Infinity#

Members
  • Posts

    75
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Infinity#

  1. Add it on to your script. Client-side file. So it would be: function isPlayerInTeam(player, team) assert(isElement(player) and getElementType(player) == "player", "Bad argument 1 @ isPlayerInTeam [player expected, got " .. tostring(player) .. "]") assert((not team) or type(team) == "string" or (isElement(team) and getElementType(team) == "team"), "Bad argument 2 @ isPlayerInTeam [nil/string/team expected, got " .. tostring(team) .. "]") return getPlayerTeam(player) == (type(team) == "string" and getTeamFromName(team) or (type(team) == "userdata" and team or (getPlayerTeam(player) or true))) end local screenW, screenH = guiGetScreenSize() function teams_images () local team_mercenarios = isPlayerInTeam(source,"Mercenarios") if team_mercenarios then addEventHandler("onClientRender", root, drawTeamImage) end end addEventHandler("onClientPlayerSpawn", getLocalPlayer(),teams_images) function drawTeamImage() dxDrawImage(100, 100, 40,40,"mercenarios.png") end But you need to do something because this is suppose to be client-side and 'isPlayerInTeam' is a server-side event.
  2. if team_mercenarios then addEventHandler("onClientRender", root, drawTeamImage) end function drawTeamImage() dxDrawImage(100, 100, 40,40,"mercenarios.png") end Then make it onClientPlayerWasted to remove the onClientRender event. Let me know if it works.
  3. Bumped the topic.
  4. Everyone has their own opinion and their own point of view on how they see things. Doesn't give them the right to share their opinions whenever they feel they should, and especially when it isn't a positive one either. But hey, it's your opinion and I respect it. Not everyone is perfect, don't punish these guys for it. Stop by and see, and because you might not like something doesn't mean you should have a say on it. Move on.
  5. We're still up and running on the same IP. Going to update this thread in a few days.
  6. We are still up and running! Our activity seems to be back! https://imgur.com/a/qb0Lw Join now and play with us! Forums: http://sarsrpg.us/ MTA:SA Server IP: mtasa://79.137.33.163:9905 Our Discord channel: https://discord.gg/kwKX3VR
  7. "Server running on stolen scripts," funny how you talk without knowing the facts whatsoever. Anyhow, proving people wrong is what I'm known for. Name a script, multiple ones to satisfy you enough if you wish, and I'll show you the client and server code myself and you can do the comparison yourself to other servers.
  8. Thank you, and I understand what you're trying to say. But unfortunately, when we created SARS, our intention wasn't for the server's name to be any similar to any other existing server. We were focused on what might reflect on the game-mode and gameplay itself. And how might it describe it as a name, so we came up with 'San Andreas' Response Services. And it matches the server, it's gamemode (RPG), etc.
  9. Bump! Hey, guys! We are still up and running! Join us today and start playing with us now!
  10. We are back! Server IP: mtasa://79.137.33.163:9905
  11. Bump. Server still up and running.
  12. That means element data "acc.accID" data doesn't exist. Please make sure you're giving us the right data name. Try this: local enableSkinForAccount = {[1] = {303}, [4] = {50}} addEventHandler("onElementModelChange", root, function(oldModel) if (getElementType(source) == "player") then local accountID = getElementData(source, "acc.accID") if accountID and enableSkinForAccount[accountID] then local newModel = enableSkinForAccount[accountID] if newModel and tonumber(newModel[1]) then setElementModel(source, newModel[1]) end else setElementModel(source, 0) end else setElementModel(source, oldModel) end end) If your model is changed to '0', then that's because "acc.accID" is returning nil. @TheMOG
  13. local enableSkinForAccount = {[1] = {303}, [4] = {50}} addEventHandler("onElementModelChange", root, function(oldModel) if (getElementType(source) == "player") then local accountID = getElementData(source, "acc.accID") if accountID and enableSkinForAccount[accountID] then local newModel = enableSkinForAccount[accountID] if tonumber(newModel) then setElementModel(source, newModel[1]) end else setElementModel(source, oldModel) end end end) If accountID exists and found in the enableSkinForAccount table, then it'll set his new model (when element model change event is triggered) to the one set from the table. If accountID doesn't exist and isn't found in the table, it'll return his previous model.
  14. Thank you :). We're doing everything we can to make the server better day by day. Currently we're working on new things such as an Ipad system, Interaction menu, etc. But thank you for the feedback.
  15. Then use this code to block rhino. No one would be able to use the rhino on your server. local blockedVehicles = {[432] = true} function blockEnterOnBlockedVehicles(player, seat, jacked) local model = getElementModel(source) if isElement(source) and getElementType(source) == "vehicle" and (model and blockedVehicles[model]) then if isElement(player) and getElementType(player) == "player" and seat == 0 then cancelEvent(true, "blockedvehicle") outputChatBox("You cannot enter blocked vehicles.", player, 255, 0, 0, false) end end end addEventHandler("onVehicleStartEnter", getRootElement(), blockEnterOnBlockedVehicles)
  16. Make sure the script has admin rights. "resource.resourceName" in the "Admin" group on "ACL Management" from the default admin panel.
  17. Yeah, absolute is used when you're going to use https://wiki.multitheftauto.com/wiki/CenterWindow or something else. Use "Relative." I highly recommend it, and its better. Also, "GUIEditor" can be used by anyone, I use it myself sometimes. But if you're good at math and know your calculations well as well as your resolution, GUIEditor won't be really necessary in the future for you. Credits to R3mp, this was explained from the GUIEditor resource itself. Difference between absolute and relative: Enjoy.
  18. -- client side function changeSkinUponSpawn(team) -- The source of this event is the player that spawned -- if isElement(source) and getElementType(source) == "player" then triggerServerEvent("setSkinUponSpawning", source) end end addEventHandler ("onClientPlayerSpawn", getRootElement(), changeSkinUponSpawn) -- server side function setSkinUponSpawningCall() if source then setElementModel(source, 0) end end addEvent("setSkinUponSpawning", true) addEventHandler("setSkinUponSpawning", resourceRoot, setSkinUponSpawningCall) Keep in mind, you can only change a player's skin is when he's successfully spawned with the spawnPlayer event. "onClientPlayerJoin" is called as soon as the player join the server, you can't change his model as he hasn't been spawned yet. So we make it when the player spawns, to change his skin to 0. Can be changed from server side. Here is an example of what onClientPlayerJoin can be used for. (From MTA wiki) function remotePlayerJoin() outputChatBox("* " .. getPlayerName(source) .. " has joined the server") end addEventHandler("onClientPlayerJoin", getRootElement(), remotePlayerJoin)
  19. Yes, that is the GUIEditor. It allows you to create GUIs with it and output the code for it. It'll fix your problem.
  20. https://community.multitheftauto.com/index.php?p=resources&s=details&id=141 That's the GUIEditor resource made by R3mp. This allows you to create in-game GUIs with standard MTA GUI interface or DX. You can create this "dxDrawText" and put it "relative." Where it remains in the position you put on all resolutions.
  21. But hey, tell me what you're trying to do. I might be able to do the whole thing for you @kieran
  22. Infinity#

    Pregunta

    Puedes mostrar el codigo completo, porfavor?
  23. Infinity#

    help please

    How do you want it? I can make you one for free. It isn't that hard.
  24. What do you mean how to block rhino and some vehicles? Here you go from what I understand. @sami2277 local blockedVehicles = {[432] = true} function blockEnterOnBlockedVehicles(player, seat, jacked) local model = getElementModel(source) if isElement(source) and getElementType(source) == "vehicle" and (model and blockedVehicles[model]) then if isElement(player) and getElementType(player) == "player" and seat == 0 then cancelEvent(true, "blockedvehicle") outputChatBox("You cannot enter blocked vehicles.", player, 255, 0, 0, false) end end end addEventHandler("onVehicleStartEnter", getRootElement(), blockEnterOnBlockedVehicles) This won't allow anyone to access the rhino as a driver. You may add more vehicles to the blockedVehicles list, you will need to add their vehicle ID like I did and set it to 'true' in order for it to work. You separate the list with commas.
  25. local jobTeam = createTeam("Test", 20, 100, 150) local jobMarker = createMarker(7002.419921875, -4831.384765625, 9.60000038147, "cylinder", 2.0, 20, 100, 150, 255) local testingMarker = createMarker(7000.419921875, -4831.384765625, 9.7, "cylinder", 1.0, 20, 100, 150, 255) function takeJob(hitElement, matchingDimension) if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if getTeamFromName("Test") then local team = getTeamFromName("Test") if team then setPlayerTeam(hitElement, team) end end end end addEventHandler("onMarkerHit", jobMarker, takeJob) function testMarker(hitElement, matchingDimension) if isPedInVehicle(hitElement) then return end if isElement(hitElement) and getElementType(hitElement) == "player" and matchingDimension then if getPlayerTeam(hitElement) and getTeamFromName("Test") then local playerTeam = getPlayerTeam(hitElement) local checkTeam = getTeamFromName("Test") if tostring(playerTeam) == tostring(checkTeam) then outputChatBox("It works!", hitElement, 255, 0, 0, false) end end end end addEventHandler("onMarkerHit", testingMarker, testMarker) This will definitely work. But since I have no idea what you're trying to do, I just did this to help you out with the bugs that are being output to your debugscript. This should fix it. Please post below to what you're trying to do, I read the first post but I didn't quite understand. Let me know so I can help you.
×
×
  • Create New...