Jump to content

Hell-Mate

Members
  • Posts

    198
  • Joined

  • Last visited

Everything posted by Hell-Mate

  1. so, can anyone please help me ? too long time and no reply ..
  2. And how i can fix this ? As i know this files get generated when the game opens, the game doesnt work, just a loading mouse then nothing therefore no files get generated ..
  3. Hello, I have a problem with gta san andreas, i was windows 8 and downloaded gta san andreas and it was working good and no problem .. Then i downgraded my windows to windows 7 and now its not working note : the link i downloaded it from windows 7 is the same link i downloaded it from windows 8 and the same are without install just extracted files and im 100% sure is that the problem not from the game, its from the windows .. I tried this and nothing worked : - changed compatible to xp and win 2000 etc .. - tried to go to gta san andreas user files but found nothing, just 2 empty files called gallery and user tracks. - run as administrator. - and lots of online solutions and nothing helped so i decided to come here and im sure that someone will help me here Regards,
  4. guys -.- take a minute to read all the code, if i triggered this to all players so if an admin do /talktoplayer, the gui will appear for all not for only the one who typed /talktoplayers the problem is not here, the problem is at onClientChanged thingy, read it carefully and tell me why the gui ( the another gui which only have a memo ) only appear to the admin which is typing on the memo but i want it not to appear to the admin which is typing at /talktoplayers gui and appear to all.
  5. Hello community, I made a simply script which is Admin speach, simply any one at Admin acl group can open a panel with /talktoplayer and this panel have a memo when u write on it force all players on server to stop and read what u say on another memo ( it force them as it will show cursor to them so they are freezed ) my problem is that, i made it if the memo is empty the whole window get closed, but it don't and another problem is that the window only show to the admin not for all server and also i want it to dont show the another memo to the admin ( just the panel that opened by /talktoplayer ) and finally here is the code .. --Client presWindow = guiCreateWindow(459, 109, 352, 512, "Admin speach panel", false) guiWindowSetSizable(presWindow, false) guiSetVisible ( presWindow, false ) presSpeach = guiCreateMemo(10, 26, 332, 390, "", false, presWindow) clearnclose = guiCreateButton(92, 431, 160, 50, "Clear and Close", false, presWindow) guiSetProperty(clearnclose, "NormalTextColour", "FFAAAAAA") speachWindow = guiCreateWindow(342, 93, 606, 520, "Admin is talking", false) guiWindowSetSizable(speachWindow, false) guiSetVisible ( speachWindow, false ) speachText = guiCreateMemo(13, 30, 583, 480, "", false, speachWindow) guiMemoSetReadOnly ( speachText, true ) guiSetFont(speachText, "default-bold-small") addEvent ( "openPresGui", true ) addEventHandler ( "openPresGui", root, function () if not ( guiGetVisible ( presWindow ) == true ) then guiSetVisible ( presWindow, true ) showCursor ( true ) else return end end) addEventHandler ( "onClientGUIClick", root, function () if source == clearnclose then guiSetVisible ( presWindow, false ) guiSetVisible ( speachWindow, false ) guiSetText ( presSpeach, "" ) showCursor ( false ) end end) addEventHandler ( "onClientGUIChanged", presSpeach, function () local Speach = guiGetText (source) local Speach2 = guiGetText ( speachText ) if (Speach ~= ("")) then guiSetVisible ( speachWindow, true ) showCursor ( true ) guiSetText ( speachText, Speach ) end if ( Speach2 == ("")) then guiSetVisible ( speachWindow, false ) showCursor ( false ) end end) --Server function presGUIOpen ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "openPresGui", thePlayer ) end end addCommandHandler ( "talktoplayers", presGUIOpen ) Regards, Hell-Mate.
  6. Hello community, i've a question about guiSetText, the ques is, well, i made a script that when u press a button it set a label on a window to a client info that clicked the button, and i have a problem that when another player hit the marker that opens the gui of the window that has the label, it shows the last client info that pressed the button so to update he have to re-press the button. so how to make it so it only set this guiText only to the player who press the button ?
  7. it sets it as nil EDIT: Saml1er code worked fine but it was having some errors and i fixed it. Thanks, Lock.
  8. the data is a number not characters or else .. so it have to be number AFAIK
  9. tried it, no error but the label not get set, the reason that there is no error is that u put a check if it nill or not .. when i removed the check i got the same error.
  10. Server function datas () local theacc = getPlayerAccount ( source ) local mydata = getAccountData ( theacc, "myData", datano ) or 0 end addEvent ("getTheData", true) addEventHandler ("getTheData", root, datas) Client addEventHandler( "onClientGUIClick", root, function () if source == data.button[3] then triggerServerEvent( "getTheData", localPlayer) guiSetText ( datalabel, "Your life time iron : "..tonumber(mydata) ) end end )
  11. triggering didnt help, same error, as triggering won't get defines from server side it will just start functions on the client event .. anymore answers to my ques ?
  12. Hello community, i just wanna ask about server only functions, as you all know getAccountData is server only function the ques is, how to use it client side ?? What i mean ? simply i wanna set a gui label with guiSetText ( label, the define of the account data( at server side ) ) i tried to make it with a local define and failed and tried to remove local and make it not local and also same error which is attempt to concatenate a nil value. I hope anyone can help me example .. server function getnum( thePlayer ) local theacc= getPlayerAccount ( thePlayer ) dataNum= getAccountData ( theacc, "data", mydata) or 0 outputChatBox ( "Your data number is: "..tonumber(dataNum), thePlayer, 0,255,0 ) end addCommandHandler ( "datanum", getnum) Client addEventHandler( "onClientGUIClick", root, function () if source == data.button[3] then guiSetText ( label1, "you data number is : "..tonumber(dataNum) ) end end )
  13. uhh, i got it. all what i meant with "" is to place the id here nither more nor less any way thanks TAPL and Saml1er. EDITED
  14. TAPL i mean whith "Skin ID" that he replace it with any skin id, for example if hmm == 0 then -- if thePlayer skin is CJ Skin then got what i mean ? btw it's tested and working .. Thanks
  15. what u mean .. i tested it like that and it is working ..
  16. Are you making examples for him? * getElementModel return integer NOT string. * You've used variable accName while you have it defined as hmm. Edited !!
  17. Hello community ,, today i decided to make a simple tutorial for MTA beginner scripters i hope that this tutorial help them to start their scripting life. Okay first of all i recommend all beginners to start learning the basic of LUA and try to understand every basic thing then start to learn much harder things. Basic tutorial to start with :- -------------------------------------- 1 ) What is Programming ? ( Not recommended but you have to know what is programming ) 2 ) The Editor. ( Tools you can use when scripting. ) 3 ) Variables in LUA. ( 100% Recommended ) 4 ) LUA – Mathematics ( Recommended but not now ! you will use it later when jumping from beginner level. ) 5 ) Comments - Keywords ( Just read. ) 6 ) Operations of Comparison / Logical Operations( 50% Recommended ) 7 ) Chunks / Blocks ( Must read !! 100% Recommended ) 8 ) Strings ( Read this later ) 9 ) Loops ( Must read !! 100% Recommended. ) 10 ) Conditional Structures ( Must read carefully !! ) 11 ) Tables ( Very useful in MTA LUA Scripting. Must read !! ) 12 ) Functions ( Totally recommended. i call this god of LUA. MUST READ !! ) ______________________________________________________________________________________________________________ MTA LUA Basic scripting _______________________ Questions and Answers :- --------------------------------- 1) Who is you fellow scripter that can help you with any function you forgot ? - MTA Wiki is ! 2 ) Program to use in writing MTA LUA in an easier way ? - MTA Script editor is. 3 ) Why i have to use MTA Script editor ? - It will help u to script in an easier way as it have auto complete function name feature. 4 ) Can i add more than one event for one function ? - Yes you can. 5 ) How to protect my scripts from hackers ? - you can use MTA compiler or use exports. 6 ) How to export ? - [TUT] How to export << This TUT will help ! 7 ) What is the difference between commands and events ? - Command will call the function when the player write the command but event will call the function when the player do something. ----------------------------------------------------------------------------------------------------------------------------------------------------------------- MTA Basic scripts ( Read Comments ) ---------------------------------------------------- 1 ) Creating a useful event. ourMarker = createMarker(x, y, z,"cylinder",2,0,150,255,255) -- Created a marker called ourMarker. dont forget to replace x, y, z with you co-ordinates function tutorial () -- creating a function called tutorial -- add function bodies here ( what the marker do when the player hits the marker ? ) end -- to end the function. addEventHandler ( "onMarkerHit", ourMarker, tutorial ) -- translate : when the player hit ourMarker call tutorial function. onMarkerHit is the Event. you know more about Events at MTA Wiki 2 ) Creating a useful command. function tutorial () --Created a function called tutorial -- add function bodies here ( what the function do when thePlayer write the Command ) end -- to end the function. addCommandHandler ( "CommandHere", tutorial ) -- translate : when the player write the command /CommandName it will call tutorial function. CommandHere is the Command. ----------------------------------------------------------------------------------------------------------------------------------------------------------------- Some useful scripts :- --------------------------- How to create a moving gate ? Tools we need : 1) x,y,z of the gate. 2) x,y,z of the gate after moving. 3) time in mili seconds in which the gate will open. 4) colshape to open the gate when the player hit the colshape. ( you can also use marker ) 5) onColShapeHit Event. ( you can also use onMarkerHit ) 6) onColShapeLeave Event. ourGate = createObject (objectIDOrTheGateID, x, y, z, rX, rY, rZ) -- change x,y,z to the gate co-ordinates, change rX,rY,rZ to the gate rotation co-ordinates. and for sure change objectIDOrTheGateID to the gate ID. ourColShape = createColCircle (x, y, z) -- change x,y,z to the x,y,z of the ColCirle function opendagate() moveObject (ourGate, timeInMiliSeconds, x, y, z) -- change x,y,z to co-ordinates of the gate after moving. and timeInMili seconds to time which the gate will open. for ex: 1000 : the gate will open after a second when the player hit the colShape. end addEventHandler("onColShapeHit", ourColShape, opendagate) function closedagate() moveObject (ourGate, timeInMiliSeconds, x, y, z) -- change x,y,z to co-ordinates of the gate normal position of the gate to close it. and timeInMili seconds to time which the gate will close. for ex: 1000 : the gate will close after a second when the player leave the colShape. end addEventHandler("onColShapeLeave", ourColShape, closedagate) Will add more useful scripts in the next topic update .. ______________________________________________________________________________________________________________ Thanks for reading and i hope all enjoyed.
  18. --Server side appear= createMarker (1725, -1638.5, 19, 'cylinder', 2.0, 255, 0, 0, 150) -- this marker when the player hit the another marker will appear. setElementInterior (joinmarker, 18) function firstJoin ( hitElement ) if getElementType ( hitElement ) and not isPedInVehicle ( hitElement ) then triggerClientEvent ( "MarkerAppear", source ) -- To trigger the client event end end addEventHandler ("onMarkerHit", appear, firstJoin) ' -- Client function marker () createMarker (1727, -1638.5, 19, 'cylinder', 2.0, 255, 0, 0, 150) end addEvent ( "MarkerAppear", true ) addEventHandler ( "MarkerAppear", root, marker ) I made the marker in client side to make it only appear for only one player that will hit the another marker. i hope this will work.
  19. You mean u want this marker ( joinmarker ) appear when thePlayer hit another marker so this marker appear ?
  20. oh my bad, EDITED. Thanks
  21. Hello community ,, i've scripted a simple code to destroy elements when not in the job. so i used getElementData and if not this data then destroy this element but there is an error saying : bad argument @destroyElements and sometime it says bad argument @getElementData ( argument 3 ) got string "seadelivery" .. here is the code and i hope someone can help. Thanks addEventHandler ( "onClientRender", getRootElement(), function( ) local notdutyplayers = getElementsByType("player") if (#notdutyplayers > 0) then for k,player in ipairs(notdutyplayers) do local pData = getElementData ( player, 'job', "seadelivery" ) if not pData then triggerEvent ( "destroyonleave", localPlayer ) end end end end) and here is the destroyonleave event >> addEvent ( "destroyonleave", true ) function destroyonleave () destroyElement ( deliveryMarker ) destroyElement ( deliveryBlip ) end addEventHandler ( "destroyonleave", getRootElement (), destroyonleave ) Regards ,,
  22. i used the same code in this script but there is a problem, left is now = right and right is now = left but there is problem with accelerate and brake. when i press up the car not going back but it still stop and steering and the same when i press down. and here is what i used > function wineveh() left=false right=false up=false down=false local keys = getBoundKeys ('vehicle_left') local data = getElementData ( localPlayer, "drunk", true ) if keys and data then tmpLeft = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) and data then tmpLeft=true end end if tmpLeft and data then left=true right=false end end local keys = getBoundKeys ('vehicle_right') if keys and data then tmpRight = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) and data then tmpRight=true end end if tmpRight and data then left=false right=true end end if (left) and data then setControlState('vehicle_left', false) setControlState('vehicle_right', true) elseif (right) and data then setControlState('vehicle_right', false) setControlState('vehicle_left', true) else setControlState('vehicle_right', false) setControlState('vehicle_left', false) end local keys = getBoundKeys ('accelerate') if keys and data then tmpUp = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) and data then tmpUp=true end end if tmpUp and data then down=false up=true end end local keys = getBoundKeys ('brake_reverse') if keys and data then tmpDown = false for keyName, state in pairs(keys) do if (getKeyState(keyName)) and data then tmpDown=true end end if tmpDown and data then down=true up=false end end if (up) and data then setControlState('accelerate', false) setControlState('brake_reverse', true) elseif (down) and data then setControlState('brake_reverse', false) setControlState('accelerate', true) else setControlState('brake_reverse', false) setControlState('accelerate', false) end end addEventHandler ( "onClientRender", root, wineveh )
  23. Here is the functions u can go with > --Server isElementMoving -- to check if the element is moving --Client dxDrawImage -- to draw an image on the player's head isElementMoving : Click here dxDrawImage : Click here
×
×
  • Create New...