Jump to content

Scooby

MTA Contributors
  • Posts

    976
  • Joined

  • Last visited

Everything posted by Scooby

  1. sometimes no script name is given when this happens. i doubt the name of the file matters. this can also occur if the loop is taking too long... its possible running ur adjust function 10,000 times is too much for the loop. silly question but have u tried with a smaller loop to see if the function is working?
  2. personally i wouldnt trigger on every shot... that wouldnt be good... i would check the ammoInClip client side after shooting each bullet, once ammoInClip == 0 then trigger to give the player the loaded gun again imagine 50 players with a smg... all shooting... that would be some serious trigger activity your way Edit: where did the post go
  3. this used to happen to me a lot more in earlier versions than it has lately too... also, sometimes the gfx in the game would be replaced with other model textures.. which can look quite effective at times
  4. ive had this problem loads of times, not just loading but during play... other people ive spoke to have too. my problem isnt because of this script tho... i dont use it. i guess it could be some graphical problem in the game although sometimes when it happens i get a driver error and my screen reverts back to the biggest res possible. i get the error msg: nv4_disp display driver has stopped working. and have to reboot. im guessing this is an nvidia driver issuse tho.... i rememer googling it long ago, updating drivers, reinstalling etc... nothing has cured it... now i just live with it.
  5. Scooby

    setPedArmor

    I know u had replied with a function, but it was wrong, so i showed the parameters for u both. you've since updated your function, even tho it will work, the parameters are still wrong.
  6. Scooby

    setPedArmor

    function Armor () -- params: posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension setPedArmor ( source, 100 ) end addEventHandler ( "onPlayerSpawn", Armor )
  7. Scooby

    Severe Server Lag

    how many markers are u talking about? i have around 1000 which doesnt really effect my server. I was having some problems at first... mainly the loops i had which had to cycle through the 1000 markers when players joined... i eventually got these sorted and theres not really any problems with this many for me now. the lag i was getting doesnt sound as bad as what ur describing tho... mine was a lag spike noticable in the server for all players for around 1 to 2 seconds when a player joined.
  8. u can use warpPedIntoVehicle still i would think ul need to use onVehicleStartEnter since this is triggered before the player even enters it... u can do ur checks here too, then if all requirements are not met, u can cancel the event, or if all are ok, u can warp him into the seat u need.
  9. not counting the source, the first 3 are ur camera coords (if ur using a player then u can use getElementPosition to get these), the next 3 are the coords u want it to look at. so try: setCameraMatrix (source, 73.6, 1763, 4, 1468.3, -918.4, 0) if this isnt right, check the coords of the place u want ur camera to look at and replace the last 3 numbers.
  10. check this line: local random = musicURL[math.random(1,#musicURL)] also, u should try defining each variable if ur still having problems... so u can see which is causing the error. so rather than: setTimer(playSound,getSoundLength(currentSound)*1000,80,random); do something like: local rand = musicURL[math.random(1,#musicURL)] local length = getSoundLength(currentSound) outputDebugString("Length: " .. tostring(length) .. " - Random: " .. tostring(rand)) setTimer(playSound, length, 80, rand) if u output each variable like this, u will be able to find ur problem a lot easier since u will see which variable is wrong. also, u need to define currentSound or u could make this into function that loops once the current sound (random) is finished.
  11. Scooby

    SQL question

    heh no worries and thanks. ive just finished a workaround... looking at ur querys its a very long work around haha, but i think ive sorted it, i was bored so i wrote a small function to save each piece of data to an ID number in a table, then dropped the sql table and created it again, then resaved the old data from the new details stored. long way round i know but i got there in the end and if it happens again i'll be sure to remember these: thanks
  12. 1) Required Arguments in moveObject * theObject: The object that will be moved. * time: The time in milliseconds the object will arrive at the destination. * targetx: The X value of the target position * targety: The Y value of the target position * targetz: The Z value of the target position im not sure what ur trying to do really, but if ur trying to make an object move to one place then up, then back across, you'll need to add timers to each moveObject, since u give the time it takes to move the object already u would just add a timer to each( if thats what ur trying to do ) 2) its possible but i dont think u can do it with moveObject, u would need to use setElementPosition and move it manually in onClientRender using a function to calculate the new co-ords.
  13. just ur parameters are wrong, it should be: function kickPlayerHandler (playerSource,commandName, kickedname) have a read: https://wiki.multitheftauto.com/wiki/AddCommandHandler for more info also u should check the player 'kicked' exists after u get it from kickedname or u will get an error if a player types /kick bob and bob doesnt exist.
  14. Scooby

    SQL question

    thanks guys, this looks like what i need... i'll give it a try after work. everything i tried with the basic functions deleted both entries leaving the table blank so the 'limit' thing might be the key. but thanks both of u for taking the time out to help. Edit: ive tried both suggestions and had no luck with either... i get a syntax error for both LIMIT and INTO
  15. Scooby

    SQL question

    well i have every line twice... so i was hoping somehow i could remove the duplicated lines.
  16. Scooby

    SQL question

    Hi, i have a small sql problem im not sure how to solve, ive been adding some property info to my sql table over time only to find ive been adding the info twice. (yes my bad ) my current layout is: x,y,z,type,dim,slot,rot,pPrice,oPrice,aPrice,forSale,owner,oldOwner,oldOwnerOwed,ID so currently it would look something like this (theres 1802 in total): 31,90,0,5,2000,9,214.7,99995,99995,0,No,Dave,None,0,1 31,90,0,5,2000,9,214.7,99995,99995,0,No,Dave,None,0,1 12,0,90,5,2001,1,122,24995,24995,0,Yes,Pete,None,0,2 12,0,90,5,2001,1,122,24995,24995,0,Yes,Pete,None,0,2 my question is, how would i go about removing one set of info but leaving the other there? i know the usual basic query's from the wiki but im not sure how i can do this without deleting both sets of info.
  17. Scooby

    Questions...

    there are many weather types, however im not totally sure what ur asking for, have a look here: https://wiki.multitheftauto.com/wiki/Weather to protect ur scripts u need a lua compiler to encode ur clientside scripts, theres plenty around... something like the one below will do u. http://www.qj.net/psp/homebrew-applications/xtreamlua-compiler-02-protect-your-lua-code.html
  18. what u have posted shows images... if u just want something simple in the chat, then: function countdown(player) local name = getPlayerName(player) outputChatBox(name .. ":- Countdown: 3",getRootElement(),0,255,0) setTimer(outputChatBox,1000,1,name .. ":- Countdown: 2",getRootElement(),0,255,0) setTimer(outputChatBox,2000,1,name .. ":- Countdown: 1",getRootElement(),0,255,0) setTimer(outputChatBox,3000,1,name .. ":- GO GO GO!!!!",getRootElement(),0,255,0) end addCommandHandler("count",countdown) if u want something more complex, say so... this is just a basic countdown from 3. ive added the players name so u can see whos activating it. also, this is serverside.
  19. seems u were wrong again....... If its still not working apple, explain whats not working or post the error msgs.
  20. since u didnt do that then i guess the msg wasnt for u.... the reply was to GanJaRuleZ first post which hes now edited. pay more attention.....
  21. i doubt by adding 'showCursor' will fix his existing problem. the error msg from debug isnt much use since uve only posted some of ur code, which at a glance looks ok. make sure u define 'music' when ur resource starts. (run function musicPlayer() when u load the script) failing that, u can add a check for the variable 'music' although that wont fix ur problem, only stop the error. eg: function showWindow() if music then if ( guiGetVisible ( music ) == true ) then guiSetVisible ( music, false ) elseif ( guiGetVisible ( music ) == false ) then guiSetVisible ( music, true ) end end end bindKey ( "F3", "down", showWindow )
  22. sorry my bad, carSpawnCounter should read vehicleSpawnCounter, i changed it after writing it since i thought u might be allowing vehicles other than cars. the line should read: if vehicleSpawnCounter[source] <= vehicleSpawnLimit then sorry about that.
  23. theres no check for the amount of times u spawn a car in your script. u can easily make ur own counter tho. try this.... local root = getRootElement() local disallowedVehicle = { [425]=true, [432]=true } -- add any other vehicle ID's here that u need to disallow local vehicleSpawnCounter = {} local vehicleSpawnLimit = 2 -- set to 2 vehicle spawns, change as required addEvent("onPlayerWantToSpawn",true) function spawnMyVehicle(carID) if disallowedVehicle[carID] then outputChatBox("This is disallowed vehicle!",source,255,0,0) else if carSpawnCounter[source] <= vehicleSpawnLimit then local x,y,z = getElementPosition(source) local vehicle = createVehicle(carID,x + 2,y +2, z) vehicleSpawnCounter[source] = vehicleSpawnCounter[source] + 1 else outputChatBox("Vehicle Spawn Limit Reached!",source,255,0,0) end end end addEventHandler("onPlayerWantToSpawn",root,spawnMyVehicle) function playerJoined() vehicleSpawnCounter[source] = 0 end addEventHandler( "onPlayerJoin", root, playerJoined ) function playerQuit() vehicleSpawnCounter[source] = nil end addEventHandler( "onPlayerQuit", root, playerQuit ) im not familiar with your script and i dont know what gamemode your using so i havent tested this. try it out and let me know if theres any problems.
  24. no worries, i was just having a quick read through and noticed it.
  25. Solidsnake, just out of curiosity, why did u add this line? if (oldMoney < newMoney) then surely with that it only works if old money is less.. what if they have more? shouldnt the function be: function renderMoney() newMoney = getPlayerMoney() if ( tonumber(newMoney) ~= tonumber(oldMoney) ) then triggerEvent("onClientMoneyChange",localPlayer,oldMoney,newMoney) oldMoney = newMoney end end addEventHandler("onClientRender",root,renderMoney) no offence intended... u do a great job on the forums helping people.
×
×
  • Create New...