Jump to content

IIYAMA

Moderators
  • Posts

    6,062
  • Joined

  • Last visited

  • Days Won

    208

Everything posted by IIYAMA

  1. maybe bullet sync will solve it, (server mtaserver.conf) I can't see the bug, is the weapon invisible or the bullets invisible or both? Btw try to reduce using element data, it will totally generate teleportation, trust me.
  2. ? spawnPlayer ( player, x, y, z, 0, 287) ------ playerskins = {} --opentable function store(player) playerskins[player]={} local skin = getElementModel (player ) playerskins[player]["skin"]=skin end function deathplayer() local player = source if playerskins[player] == nil then store(player) return -- don't set the data again........ end local skin = getElementModel (player ) playerskins[player]["skin"]=skin end addEventHandler ( "onPlayerWasted", getRootElement(), deathplayer ) function playerexit() local player = source playerskins[player] = {} playerskins[player] = nil end addEventHandler ( "onPlayerQuit", getRootElement(), playerexit ) try it, if there are any erros, let me know.
  3. Is player2 not death? I have that bug sometimes when I kill somebody at a bike, but than I don't see him at all. (with the stealth resource) But that's another story....
  4. I see players teleport with it already, lal. But thank you very much.
  5. Hello, Question: will math.floor be calculated at server or client side? I don't know, because it is maybe possible that the math will be send with the trigger. I use math.floor to reduce high bandwidth. triggerServerEvent("S_SHOOT",getLocalPlayer(),weapon,aHits,math.floor(sX), math.floor(sY), math.floor(z),getTickCount()/1000*45);
  6. It means I don't wanna argument about it. To prevent fights and tears.
  7. http://forum.mtavc.com/viewtopic.php?f=91&t=50682 local g_50p sure,
  8. triggerserverevent triggerclientevent In my opinion element data is useless, why? server to client = trigger event client to client = global table(g_) or trigger event and yes global tables do exist between client and client. But server to client, I don't know. I use Elementdata only for flashbang and tab score.
  9. Very late reaction(sorry), thank you
  10. Wooow!! I didn't even know it existed. THANK YOU!!!
  11. Hello, I got a question, How can I calculate a rotation of something without using "getElementRotation". I have 1 ped that is watching an object. This object will be moving arround the ped. The ped will change it's rotation when the object is moving "setElementRotation". It isn't in the sample, because this ped will be a player. -- I have 2 locations. The one of the ped and the one of the object. This is a sample: local ped = createPed ( 63, 0, 0, 3 ) local object = createObject ( 1337, 5540.6654, 1020.55122, 1240.545, 90, 0, 0 ) function setrotation() local rotate = getPedRotation(ped) setPedRotation ( ped, rotate+40 ) end setTimer(setrotation, 100, 0) -- how can I calculate the rotation of a ped when I have the locations of the direction were the ped is watching to. local x,y,z = getElementPosition( ped ) local x2,y2,z2 = getElementPosition( object ) NO USING getElementRotation, because I have to compare with that one.
  12. Thank you all, Your explanations were very clear.
  13. so: function myFunction( ... ) if ( ... ) then local varArgs = { ... }; -- it can be used here end if ( not varArgs ) then -- it can't be used here. end end right?
  14. thank you, just one more question. local H = 1 -- set H to 1 local G = 0 -- set G to 0 function normal () if H == 1 then -- check if H is 1 local G = 1 -- make local end if G == 1 then -- check if G is 1 outputChatBox ("G") -- will it output G? end end normal() --trigger because they say at wiki: local showHealth = true outputChatBox("This is your status:", player) if showHealth == true then local health = getElementHealth(player) outputChatBox("Health: "..tostring(health), player) end
  15. I don't understant when I need to use "local" Wiki: The health variable only exists within the if-condition block, that is between the 'then' and the 'end'. They mean this? function epic () if 7 > 3 then--starts? local P = 1 if P then outputChatBox("this works") end end--ends? end I know what they mean, but I don't know when I need to use it: Their samples: local playermoney = getPlayerMoney ( source ) local health = getElementHealth(player) Do I need local for math? or will it only make lagg. number1 = 1 number2 = 2 number3 = number1 + number2 outputChatBox(number3) Do I need local for tables? number3 = {[3] = 1,[2] = 2,[1] = 3} I hope you can explane to me when I do need to use local and when I don't need to use it. THX
  16. --server addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function() call(getResourceFromName("scoreboard"),"addScoreboardColumn","spawnlocalition") end ) --client or server setElementData(getLocalPlayer(),"spawnlocalition",location) setElementData(source,"spawnlocalition",location) @Klesh Then his question isn't correctly formulated. What ever... location = getElementZoneName ( source )
  17. Make sure the element do exist. Most of the time the problem: When you try to destroy an element that already have been destroyed. To solve it: if robhouseMarker and robhouseBlip then destroyElement ( robhouseMarker ) destroyElement ( robhouseBlip ) end or if you aren't sure they both exist: if robhouseMarker then destroyElement ( robhouseMarker ) end if robhouseBlip then destroyElement ( robhouseBlip ) end
  18. IIYAMA

    question,

    https://wiki.multitheftauto.com/wiki/SetTimer https://wiki.multitheftauto.com/wiki/GetTimers https://wiki.multitheftauto.com/wiki/OnResourceStart --when this script is loaded, if you want to know the time when he joins. (also pre trigger to prevent the client isn't loaded bevore the server triggers) https://wiki.multitheftauto.com/wiki/TriggerClientEvent and as Rekon said: https://wiki.multitheftauto.com/wiki/SetElementData -- https://wiki.multitheftauto.com/wiki/GetElementData (the client can deside for him self) or use a trigger to deside the server when he must see the time. Elementdata will be set on serverside. When you need it, you can easy ask the time from the server when you use getElementData. But Element data can be laggy.(I never use it)
  19. IIYAMA

    Teams problem:

    Well it is just the gamemode stealth you got on your pc, but if you seriously want it. function teamstealthgamestart() killmessageRes = getResourceFromName"killmessages" call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Score") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "kills") call(getResourceFromName("scoreboard"), "addScoreboardColumn", "deaths") playingaround = 0 redwinsdisplay = textCreateDisplay() local redtext = textCreateTextItem ( "RED Team Wins the Match!", 0.5, 0.5, "low", 255, 0, 0, 255, 3, "center", "center" ) textDisplayAddText ( redwinsdisplay, redtext ) bluewinsdisplay = textCreateDisplay() local bluetext = textCreateTextItem ( "BLUE Team Wins the Match!", 0.5, 0.5, "low", 0, 0, 255, 255, 3, "center", "center" ) textDisplayAddText ( bluewinsdisplay, bluetext ) tiegamedisplay = textCreateDisplay() local tietext = textCreateTextItem ( "The Match was a Tie!", 0.5, 0.5, "low", 255, 255, 255, 255, 3, "center", "center" ) textDisplayAddText ( tiegamedisplay, tietext ) waitDisplay = textCreateDisplay() local waittext = textCreateTextItem ( "Wait for next round to spawn.", 0.5, 0.9, "low", 255, 255, 255, 255, 1.6, "center", "center" ) textDisplayAddText ( waitDisplay, waittext ) team1 = createTeam("RED",255,0,0)--red team2 = createTeam("BLUE",0,0,255)--blue teamprotect = get("stealth.teamdamage") if teamprotect == 1 then setTeamFriendlyFire( team1, false ) setTeamFriendlyFire( team2, false ) elseif teamprotect == 0 then setTeamFriendlyFire( team1, true ) setTeamFriendlyFire( team2, true ) end setElementData ( team1, "Score", 0 ) setElementData ( team2, "Score", 0 ) local players = getElementsByType("player") for k,v in ipairs(players) do player = v aTablePlayer[player]={}; aTablePlayer[player]["shieldup"] = false killPed(v) fadeCamera(v,true) thisplayer = v --setTimer(triggerClientEvent,2000,1,v,"swaptoggle",getRootElement(), thisplayer, teamswap) setElementData ( v, "kills", 0 ) setElementData ( v, "deaths", 0 ) setPlayerNametagShowing ( v, false ) spectators[v] = true bindKey ( v, "F3", "down", selectTeamKey ) end --Enable laser sight setElementData(getRootElement(),"lasersight",get("stealth.lasersight")) end addEventHandler( "onGamemodeStart", resourceRoot, teamstealthgamestart ) Welcome to the old codes of stealth. see line 18 function spectateNext (source) -- THIS IS THE FUNCTION USED TO SWICH WHO IS BEING SPECTATED BY PRESSING R if playingaround == 1 then -- IF A ROUND IS IN PROGRESS --if getElementHealth(source)<1 then if ( isPedDead ( source ) ) then --IF THE PLAYER IS DEAD local specPlayer = getPlayerSpectatee[source] -- gets the spectatee player if not specPlayer then specPlayer = 1 spectators[source] = true bindKey ( source, "r", "down", spectateNext ) end local deadplayerTeam = getPlayerTeam(source)--local --local deadplayerTeam2 = getTeamFromName ( deadplayerTeam ) local deadplayerTeam2 = getTeamName ( deadplayerTeam ) if source then-- my checks outputChatBox ("source does exist") end if deadplayerTeam then-- my checks outputChatBox ( deadplayerTeam2)--output > TeamRED and Team1-----------------------< this end local playersTable = getPlayersInTeam ( deadplayerTeam )--local end playersTable = filterPlayersTable ( playersTable ) -- local playerCount = #playersTable if playerCount == 0 then outputSpectateMessage("Nobody to Spectate",source) -- IF ITS JUST THE 1 PLAYER, SPECTATING IS IMPOSSIBLE else specPlayer = specPlayer+1 outputChatBox( playersTable .. " " .. specPlayer) if playersTable[specPlayer] then while isPedDead ( playersTable[specPlayer] ) do --while getElementHealth(playersTable[specPlayer])<1 do specPlayer = specPlayer+1 end end if specPlayer > playerCount then specPlayer = 1 end --setCameraMode ( source, "player" ) setCameraTarget ( source, playersTable[specPlayer] ) outputSpectateMessage("Now spectating "..getPlayerName(playersTable[specPlayer]),source) getPlayerSpectatee[source] = specPlayer end end end end I have tryed this for a long time and I just getting creazy..... and now I know why 1 team = (2 teams) SO THE DATA I GET WITH local deadplayerTeam = getPlayerTeam(source) IS USELESS
  20. Hello guys, I got a very strange bug. In the gamemode there is: team1 = createTeam("RED",255,0,0)--red team2 = createTeam("BLUE",0,0,255)--blue When I check this player his team I get this: TeamRED Team2 I get 2 team instead of 1. How can I splits or fix this? Because I can do nothing with this data.
  21. Small question: If I shutdown a resource, all tables will be gone only the element data will remain (of this resource). Element data will be gone at the moment this element is gone. True or false?
  22. IIYAMA

    Update MTA virus wtf?

    Thank you very much.
  23. Hi, I just started my mta, clicked on a server. Then he asked for an update and clicked on yes... I downloaded it and bevore he asked for "instal". My virus scan blocked it, because he said virus etc.. C:\ProgramData\MTA San Andreas All\1.3\upcache\_mtasa-1.3.1-rc-04793-0-000-files-all-cksummed.rar_tmp_\MTA\loader.dll Virus: TR/Hijacker.Gen --wtf? Something wrong? I have never had this kind of warnings from mta, so I am worried. Virus: TR/Hijacker.Gen Date discovered: 19/06/2007 Type: Trojan In the wild: Yes Reported Infections: Low Distribution Potential: Low Damage Potential: Low Static file: No Engine version: 7.04.00.34
×
×
  • Create New...