Jump to content

Imposter

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by Imposter

  1. on the debugscript, im getting an error, "WARNING:[roleplay]\CivilianTeam\server.lua:3: Bad arguement @ 'getAccountData' [Expected account at arguement 1, got boolean]" this error is coming still even from using your code server side code: function onConnect () local playerAccount = getPlayerAccount(source) local theTeam = getAccountData ( playerAccount, "hisTeam" ) if source then if theTeam=="" then setPlayerTeam ( source, civilianTeam ) if theTeam==("Civilians") then setPlayerTeam ( source, civilianTeam ) end else outputChatBox ( "ERROR!" ) end end end addEventHandler ( "onPlayerLogin" , getRootElement(), onConnect ) function onLeave () local playerAccount = getPlayerAccount(source) local playerTeam = getPlayerTeam ( source ) if playerTeam then setAccountData ( playerAccount, "hisTeam" , playerTeam ) end end addEventHandler ( "onPlayerQuit" , getRootElement(), onLeave ) function onResourceStart() civilianTeam = createTeam ( "Civilians", 255, 255, 255 ) outputChatBox ( "Civilian Team Created!" ) onConnect() end addEventHandler ( "onResourceStart" , getRootElement(), onResourceStart )
  2. I referenced the wiki getAccountData and thats what it says, what am i supposed to use, getElementRoot() ?
  3. I want to see if the player's account contains the value of civilian and if it does then it sets his team as civilian. thanks! function onConnect () local theTeam = getAccountData ( source, "hisTeam" ) if source then if theTeam=="" then setPlayerTeam ( source, civilianTeam ) if theTeam==("Civilians") then setPlayerTeam ( source, civilianTeam ) end else outputChatBox ( "ERROR!" ) end end end addEventHandler ( "onPlayerLogin" , getRootElement(), onConnect )
  4. Thanks guys, this stuff finally gets into my dumb head, and it is working
  5. so this is wrong?? function markerHit ( thePlayer, matchingDimension ) if ( thePlayer == theEstateEntrance ) then outputChatBox ( "You are entering the Estate!", getRootElement() ) setElementInterior ( thePlayer , 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) setElementDimension ( thePlayer, 3 ) end end
  6. OHHH!!!! So i have to use source? No , addCommandHandler function have 3 parameters : player , command and the passed arguments .. so your function should be "function outputPOS ( player , command )" while player is the player who wrote the command you will use player instead of getRootElement() .. "local x, y, z = getElementPosition( player )" and so on. AL3GRAB u are a genius. i am going to release the resource right now with u and AMARANT in the credits thanks! here is the link : https://community.multitheftauto.com/ind ... ls&id=5242
  7. this is NOT WORKING PLEASE HELP ME server side : function loadResource ( ) theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 170 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( thePlayer == theEntrance ) then outputChatBox ( "You are entering the Estate!", getRootElement() ) setElementInterior ( thePlayer , 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) setElementDimension ( thePlayer, 3 ) end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit )
  8. OHHH!!!! So i have to use source?
  9. For some strange reason, when i type "/pos" in mta, it dumps my position as 0,0,0. look. positiondump.txt 0, 0, 0 ---------- Server Side: function outputPOS () local x, y, z = getElementPosition( getRootElement() ) local car = getPedOccupiedVehicle( getRootElement() ) local cx, cy, cz = getElementPosition( car ) local file = fileOpen("positiondump.txt") if not file then file = fileCreate("positiondump.txt") outputDebugString("Creating positiondump.txt") end if file then if (car) then fileSetPos(file,fileGetSize(file)) local written = fileWrite( file, cx .. ", " .. cy .. ", " .. cz,"\r\n----------\r\n") fileFlush(file) fileClose(file) if written then outputChatBox("Succesfully saved your car's position!",source) outputChatBox(valuetype,source) end else fileSetPos(file,fileGetSize(file)) local written = fileWrite( file, x .. ", " .. y .. ", " .. z,"\r\n----------\r\n") fileFlush(file) fileClose(file) if written then outputChatBox("Succesfully saved your position!",source) outputChatBox(valuetype,source) end end else outputDebugString("ERROR: Cannot find or create positiondump.txt") end end addEvent("OutputGUIToFile",true) addCommandHandler("pos" ,outputPOS)
  10. im sorry i didnt see your post earlier. there is an easier way to do this, turn on your server and login as admin in mta. open the admin panel with p. then go to the resources tab, look for the resource called "realdriveby" and start it. then get a uzi or a smg and go into any car and RIGHT CLICK to aim and LEFT CLICK to shoot. not much of a scripting problem.
  11. client side addEvent ("viewGUI", true) function viewShop () if (getLocalPlayer() == source) then guiSetVisible (carshopWindow, true) showCursor (true) end end addEventHandler ("viewGUI", getRootElement(), viewShop) server side function markerHit (hitPlayer, matchingDimension) if (source == carShopMarker) then triggerClientEvent ("viewGUI", hitPlayer) end end addEventHandler ("onMarkerHit", getRootElement(), markerHit) somehow the information wont get to the client side, but the server side is working well.
  12. OK, i got the id and locations, how will i use it? "PAPER" posX="388.87132732" posY="173.80432323" posZ="1008.38323254" rot="320" world="3" />
  13. No, you didn't get me wrong. You just need to learn more about interior system in GTA. There are specific interiors with their own ID and coordinates. That function "setElementInterior" I gave to you is used to change your current noraml interior (which is 0). And you also have to know about dimensions. so technically, my script is suppose to work??
  14. If i understand u correctly, then this should work...but it doesnt. function loadResource ( ) theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 170 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( source == theEntrance ) then outputChatBox ( "You are entering the Estate!", thePlayer ) setElementDimension ( source, 10 ) setElementInterior ( source, 3 , 389.8681640625, 173.9693145752, 1008.3828125 ) elseif ( source == theExit ) then outputChatBox ( "You are leaving the Estate!", thePlayer ) setElementDimension ( source, 0 ) setElementInterior ( source, 0 , 1481.0408935547, -1771.6051513672, 18.795755386353 ) end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit )
  15. yeah, but i need to warp it into a building interior for example the news paper interioir, this command puts me in a different place......................................IS ANYBODY GONNA HELP???
  16. How can i make a player warp>? function loadResource ( ) warpthingy= createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) end addEventHandler ( "onResourceStart", resourceRoot, loadResource ) function markerHit ( thePlayer, matchingDimension ) if ( source == warpthingy) then end end addEventHandler ( "onMarkerHit", getRootElement(), markerHit )
  17. This still wont work, if u wanna try it, go to the police station at SA and go to the triads marker it wont do anything. Found the prob.. it says if ( source == theEntrace ) then instead of if ( source == theEntrance ) then one more thing, how can i make it teleport the player into an interior?
  18. This still wont work, if u wanna try it, go to the police station at SA and go to the triads marker it wont do anything.
  19. i know that, but it wont even output to the chat box!!
  20. still a problem, when i hit the marker , nothing hapens, it]s there a problem in my positioning? code: function loadResource() theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 100 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 100 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", getRootElement(), loadResource) function markerHitE (hitPlayer, matchingDimension) if (source == theExit) then outputChatBox( "You are leaving the Estate!", hitPlayer ) end end addEventHandler ("onMarkerHit", getRootElement(), markerHitE) function markerHitE (hitPlayer, matchingDimension) if (source == theEntrace) then outputChatBox( "You are entering the Estate!", hitPlayer ) setElementPosition ( hitPlayer, 389.8681640625, 173.9693145752, 1008.3828125 ) end end addEventHandler ("onMarkerHit", getRootElement(), markerHitE)
  21. Hey guys, im trying to make a code that will allow a player to enter a building, but it wont work, when i step on the marker, nothing happens. the marker "theExit" is inside the interior PAPER"3" and is NOT VISIBLE. Please help, im so screwed over. function loadResource() theEntrance = createMarker ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, "arrow", 1.5, 0, 255, 0, 170 ) theExit = createMarker ( 389.8681640625, 173.9693145752, 1008.3828125+1, "arrow", 1.5, 0, 255, 0, 170 ) estateBlip = createBlip ( 1481.0408935547, -1771.6051513672, 18.795755386353+1, 44, 0, 0, 0, 255 ) outputChatBox ( "The Estate has been Loaded!!" ) end addEventHandler ( "onResourceStart", getRootElement(), loadResource) function markerHitE (hitPlayer, matchingDimension) if (source == theExit) then outputChatBox( "You are leaving the Estate!", source ) end end addEventHandler ("onMarkerHit", getRootElement(), markerHitE) function markerHitE (hitPlayer, matchingDimension) if (source == theEntrace) then outputChatBox( "You are entering the Estate!", source ) end end addEventHandler ("onMarkerHit", getRootElement(), markerHitE)
  22. i thought that would be a problem, and im still getting a bunch of warnings in the console, do you thnk i should change the handler? it keeps giving warnings for getPedOccupiedVehicle, getPlayerIdleTime( thePlayer ), getElementVelocity ( theVehicle )
  23. Can someone help me out with this? cant get it to work!! addEvent("onMapStarting") minTime = 10*1000 maxTime = 15*1000 function killHim () if thePlayer then if theIdleTime > minTime then if theIdleTime > maxTime then if theSpeed < 5 then blowVehicle( theVehicle ) else outputChatBox( getPlayerName(getRootElement()) .. " has beed killed for camping!" ) end end else outputChatBox( "If you do not move in 5 seconds, you will be killed!", thePlayer ) end end end function onMapLoad () loadTimer = setTimer ( startTimer, 15000, 0 ) end addEventHandler ( "onMapStarting", getRootElement(), onMapLoad ) function startTimer () thePlayer = getRootElement() theVehicle = getPedOccupiedVehicle ( thePlayer ) theIdleTime = getPlayerIdleTime( thePlayer ) theSpeed = getElementVelocity ( theVehicle ) checkTimer = setTimer ( killHim, 100, 0 ) end
×
×
  • Create New...