Jump to content

Perfect

Members
  • Posts

    563
  • Joined

  • Last visited

Everything posted by Perfect

  1. First calm down, Second It is not that serious like you are thinking, Its just a freaking script. Third your "ffffaasssst!!!!111" will not make it any better for us to help you, after all it is in our hands to help you or not. Fourth and last, try your self to fix it using the following function:- setElementVisibleTo
  2. Sorry, My fault, i was bit asleep (still) and didn't look carefully at the code. Try this: Serverside:- addEvent("helmet") local cases = {} for i,v in ipairs(getElementsByType("player"))do setElementData(v, "helmet", 0) end addEventHandler("helmet", function(player) if(getResourceState(getResourceFromName("bone_attach")) == "running")then if(getElementType(player) == "player")then if(getElementData(player, "helmet") ~= 1)then case = createObject(2054,0,0,0) exports.bone_attach:attachElementToBone(case,player,1,0,0.04,0.06,0,0,180) setElementData(player, "helmet", 1) cases[player] = case elseif(getElementData(player, "helmet") == 1)then setElementData(player, "helmet", 0) exports.bone_attach:detachElementFromBone(cases[player]) destroyElement(cases[player]) end end else outputChatBox("ERROR #1", player, 255, 50, 0) end end ) Clientside:- if itemID then if (itemID==90) then -- Fullface Helmet triggerEvent("onClientGUIClick", source, value) triggerServerEvent("helmet",source) else outputChatBox("Error", player, 255, 50, 0) end end
  3. In your code, at line #8, 'thePlayer' isn't define, use Source. function teamSet ( ) local team = getTeamFromName ( "Taxi Driver" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 255, 0 ) setElementModel(source, 57) createVehicle(420, 1777.3017578125, -1891.779296875, 13.157614707947) outputChatBox("you are now driver", source) else local teamw = getTeamFromName ( "Taxi Driver" ) if teamw then cancelEvent() outputChatBox("You are already driver!", source) end end end
  4. You can use Stage :- https://community.multitheftauto.com/in ... ils&id=646
  5. The error is very simple, you just need to put function inside the event handler Or give function a name and called it in event handler. Server Side:- addEvent("ffhelmet") local cases = {} for i,v in ipairs(getElementsByType("player"))do setElementData(v, "ffhelmet", 0) end addEventHandler("ffhelmet", function(player) if(getResourceState(getResourceFromName("bone_attach")) == "running")then if(getElementType(player) == "player")then if(getElementData(player, "helmet") ~= 1)then case = createObject(2054,0,0,0) exports.bone_attach:attachElementToBone(case,player,1,0,0.04,0.06,0,0,180) cases[player] = case elseif(getElementData(player, "helmet") == 1)then setElementData(player, "helmet", 0) exports.bone_attach:detachElementFromBone(cases[player]) destroyElement(cases[player]) end end else outputChatBox("ERROR #1", player, 255, 50, 0) end end ) Client side (There is nothing wrong in this code except the bracket and it was bit messy so i fixed it):- if itemID then if (itemID==90) then -- Fullface Helmet triggerEvent("onClientGUIClick", source, value) setElementData(player, "helmet", 1) case = createObject(2054,0,0,0) exports.bone_attach:attachElementToBone(case,player,1,0,0.04,0.06,0,0,180) cases[player] = case elseif(getElementData(player, "helmet") == 1)then setElementData(player, "helmet", 0) exports.bone_attach:detachElementFromBone(cases[player]) destroyElement(cases[player]) end end else outputChatBox("Error", player, 255, 50, 0) end end -- ) <- Why bracket here ?
  6. What you mean by translate script ? If you mean making a help page for different languages then You can simply use a table. Example:- Languages = { English = "Hello, this is an english language tab/n have fun!!" , -- if you need it for gui German = "Some german :~", AnyOtherLanguage = " Any Other Language :~" } Languages.English -- English message Languages.German -- German message Languages.AnyOtherLanguage -- AnyOtherLanguage message
  7. You can't use 'else' without 'if'. The correct syntax is:- If 2+2=5 then true else false end And yes every 'if' statement needs an 'end' at the end of the statement. More brief explanation:- viewtopic.php?f=148&t=75501 You can use IsPlayerNametagShowing Now try to solve it your self with the help of given information.
  8. Perfect

    MTA 1.4

    What is going on! This just happened to me today in mta 1.3 but didn't knew that this is global thing.
  9. Hi, I made simple payday script, which pays player every 24 hours. But the problem is, 'setTimer' is resetting everytime the resource restart. Is there anyway to stop resetting of 'setTimer' ? Here is the script:- function payMoney() givePlayerMoney(source,10000) end function payMoneyTimer() setTimer(payMoney,86400000,0) end Can you guys please help me ?
  10. See this thread and do what it says. https://forum.multitheftauto.com/viewtopic.php?f=104&t=31668 (Yeah, it client and maybe the problem is also client)
  11. playerWeapons = {} root = getRootElement() local state = false -- Save Weapons. function saveWeapons() playerWeapons[source] = {} for i=1, 12 do table.insert(playerWeapons[source], getPedWeapon(source,i)) end state = true end addEventHandler("onPlayerWasted",root,saveWeapons) -- Load Weapons. function loadWeapons() if (state == true) then for i=1,12 do giveWeapon(source,tonumber(playerWeapons[source][i] )) end playerWeapons[source] = nil state = false end end addEventHandler ( "onPlayerSpawn", root, loadWeapons)
  12. So Exciting about createEffect and many other new functions, Gonna test them all!! Thanks MTA Team, MTA Contributors And MTA Bug Testers For making mta more and more better on each release. What else i can say, Yeehaaa!!!
  13. 1)sometimes, I can play in servers as long i want and sometimes. So its random. 2) I don't know why but my server is just crashing other players not me. btw sometimes when launching mta sa, it gives me error saying "Gta sa is not launched correct press Ok to terminate". Sometimes those errors are repeats, like i terminate it then launch it back then it gives again. I remember seeing some error code like CD22 (When launching mta sa). Also it never crash just gives"disconnected from server ..." errors.
  14. it doesn't matter in which server i am playing, I see the same message "Disconnected from the server" or "Connection to the server lost", I just want to confirm, if its my pc fault ? I mean my system can handle MTA SA ?
  15. Its happen in huge servers, usually at the time of connecting but in my local server, its random.
  16. Well, How can you say that i got last crash on May 05. Not crash itself, but disconnect from server due to connect lost. Several players in my server getting timed-out. Sometimes at once.(Including myself) It sometimes says "Dead connect detected for PlayerName" in console. I don't know if it my pc problem, Server or MTA Problem. And also i am not playing MTA too often because of those reasons. Hope, You guys can Help Me.
  17. Hello, I have an local server and players are getting random crashes like they are 2 players in server named 'A' and 'B' then Player 'A' get timed out then he came back then Player 'B' get timed out after some minutes then he came back then Player 'A' again and so on. but sometimes when they are 4 or 5 players in server including me, all of us get crash/Timed Out (Usually). I checked the console and i notice that It says 'Dead Connect For PlayerName'. I Don't Really whats happening. Edit:- Okay, Here is MTA Diag:- http://pastebin.mtasa.com/775638515 in Middle Of Process. It says that the following files are Non-Standard:- VorbisFile.dll, audio\SFX\SPC_EA, audio\SFX\SPC_FA, audio\SFX\SPC_GA, audio\SFX\SPC_NA, audio\SFX\SPC_PA, audio\streams\AA, audio\streams\ADVERTS, audio\streams\AMBIENCE, audio\streams\CUTSCENE. If that helps. Can You Guys Please Help Me ?
  18. Perfect

    MTA Store

    Simply no, Mta sa is open source and so its community (not including that compiled :~). They will be many problems like flame wars/Scams, etc... (And it will be bit funny )
  19. The Tutorial Is Good So Far. (Without considering the above noted mistake) Waiting for the completion of the Tutorial. Thank You For The Tutorial.
  20. There is a big difference in a car and in uploading same types of resources again and again. Not all the resources are Unique. Well, I agree with you on "Every user has right to upload his resource"(as per Community Statement) But why already exist ones ? I am not talking about maps and game modes But others. There are many resources in community which are uploaded years back and still have less then 500 downloads because of no uniqueness and some other reasons.
×
×
  • Create New...