Jump to content

Citizen

Moderators
  • Posts

    1,803
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by Citizen

  1. Yeah it's a correct sentence and you can say too: Je parles un peu le français. It's the same. Now stop the "freeposts" ^^ You can add me on msn if you want to write in french or if you need more help... Good night I'm very tired
  2. You'r welcome ^^ Haha Tu vas devenir un vrai français
  3. Of course, so... We create your GUI for the stats and keep the labels empty when the player join the server ( onClientResourceStart ) and we hide it ( guiSetVisible( statWindow, false ) ). Then when a player tape /stats, the client-side ask, to the server-side, the stats of this player and the Server-Side send the datas to the client-side in the function of the SendAccountData. Then we write the stats in the 2 empty labels with guiSetText( theLabel, theStat ) and if the window is hidden, we show this window, but if it's already visible, we hide the window. And why your code doesn't works ? I said it in my latest post: But I can explain again why your code doesn't works if you want.
  4. This is the video of my NPC who walk in LS: https://www.youtube.com/watch?v=T43nQMRyfs0 Thanks for watching and leave comments please EDIT: change NPX to NPC
  5. When you type /stats, it creates the Window so it's visible so when you change his visibilty, the client hides him and when you type again /stats, the client creates another window so it's again visible and the client hides it again ... Try this and I want that you understand my code: function playerStats ( ) triggerServerEvent ( "onShowStats", getLocalPlayer()) end addCommandHandler ( "stats", playerStats ) addEvent( "SendAccountData", true ) addEventHandler( "SendAccountData", getRootElement(), function(cash,deaths,adminlevel) outputChatBox ( "Money: ".. tostring( cash ) ) outputChatBox ( "Deaths: ".. tostring( deaths ) ) outputChatBox ( "Adminlevel: ".. tostring( adminlevel ) ) guiSetText( statWindow_Label1, ""..cash ) -- we change the text in the label guiSetText( statWindow_Label2, ""..deaths )-- we change the text in the label too local visible = guiGetVisible( statWindow ) -- we get if the window is visible (= true ) or if it's not visible (= false ) guiSetVisible( statWindow, not visible ) -- not false = true and not true = false so if is visble(= true ), we hide the window and conversely end) function createStatsWindow() statWindow = guiCreateWindow ( 0.3367,0.0391,0.3352,0.3018, "Stats", true ) guiCreateLabel(0.0676,0.1327,0.0956,0.0550, "Money:", true, statWindow) statWindow_Label1 = guiCreateLabel(0.1702,0.1359,0.2153,0.0518, "" , true, statWindow) guiCreateLabel(0.0676,0.2104,0.0956,0.0583, "Deaths:", true, statWindow) statWindow_Label2 = guiCreateLabel(0.1725,0.2104,0.1538,0.0550, "" , true, statWindow) guiSetVisible( statWindow, false ) end addEventHandler( "onClientResourceStart", getLocalPlayer(), createStatsWindow ) This: if guiGetVisible(statWindow) == false then guiSetVisible(statWindow,true) else guiSetVisible(statWindow,false) end is the same as: local visible = guiGetVisible( statWindow ) guiSetVisible( statWindow, not visible ) Tell me if you don't understand something.
  6. Citizen

    Respawn

    Yeah I think too and I make for you a script which write me all valid Skin: Code EDITED ! invalidSkin={1,2,3,4,5,6,8,42,65,74,86,119,149,208,239,265,266,267,268,269,270,271,272,273} function isAValidSkin( skinID ) for k, i in ipairs( invalidSkin ) do if ( tonumber( skinID ) == tonumber( i ) ) then return false end end return true end function writeTable( txt ) local savefile = fileOpen( "table.txt" ) if ( savefile ) then fileSetPos( savefile, fileGetSize( savefile ) ) fileWrite( savefile, txt.."," ) end fileClose( savefile ) end function createTable( thePlayer, commandName ) for k=0, 273 do if ( isAValidSkin( k ) )then writeTable( k ) end end end addCommandHandler("skinTable", createTable, false, false )) I copy-paste all the numbers in this table: EDIT: Now it's the real valid skins table ! validSkin={0,7,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,66,67,68,69,70,71,72,73,75,76,77,78,79,80,81,82,83,84,85,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264} Enjoy with this big table !
  7. so try to set the state to true and not false and don't forget the "" like this: setPedControlState(theBot, "forwards", true)
  8. Because the setPedControlState function is a Client-only function You have 2 choice : 1- Move your script client-side and it maybe works if you set the state to true and not false or 2 - Stay in server-side and replace this line: ( recommended if you want that every players can see him ) setPedControlState(theBot, forwards, false) by this line: setPedAnimation(theBot, "ped", "WALK_civi", -1, 1, 1, 0) Make your choice
  9. I don't know how to use the linux server sorry Got to this page: Server_Manual#Linux_installation I can't help you
  10. Of course we can do that !! you have to respect this URL form: mtasa://NickName:pass@ip:port so you can make a luncher
  11. No you can't but you can change the skins, and SA:MP can't do that ( and it's not the only thing that he can't do )
  12. Lol I mentioned it in my EDIT and i didn't see your post.
  13. Of course we can do that, it's MTA See this function EngineLoadTXD and There are 2 exemples in this wiki page. Enjoy ! EDIT: But we can just replace the Texture ( TXD ), not the model ( DFF ) and when we replace the CJ skin ( for exemple ) everybody can see this skin. So we can't make a unique skin of CJ for a unique player ( all CJs in the server have the same skin for the player ). Sorry for my bad explanation but I'm french.
  14. No and you ? this is a direct link to this post:
  15. Haha here : https://forum.multitheftauto.com/viewtopic.php?f=91&t=32218#p340795
  16. Sorry but the problem is already solved
  17. Haha thanks now my lua knowledge is 110% I'm kidding, I still learns some things in lua
  18. You don't need a triggerClientEvent to show a text for only one player, In server-side: outputChatBox( " Text for only one player ", thePlayer ) outputChatBox( " Text for all players ") In client-side: outputChatBox( " Text for all players ") -- no need source or something like that In client-side, it's always for the player of this client
  19. You have 2 addEventHandler( "onMarkerHit", ...., .... ) for 2 functions so I think that he creates the new van and setElementData(player,"got.van", TheDV) before the destroyElement( dlvan ) of the second function, so he creates the new van and he destroys it immediatly. Try to make only one function for this system EDIT: Like this: function startMission (player) local dlvan = getElementData( player, "got.van" ) if ( dlvan ) then setElementData (player, "got.van", false ) destroyElement(dlvan) destroyElement(blip0) destroyElement(blip1) destroyElement(blip2) destroyElement(blip3) destroyElement(blip4) outputChatBox("[DELIVERY MAN]Your old van is succesfully destroyed and there is a new Van spawned!",player,0,255,0) end blip0 = createBlip ( 269.329, -220.570, 0.427, 41 ) blip1 = createBlip ( 215.279, 32.975, 1.462, 41 ) blip2 = createBlip ( -60.394, 83.554, 2.136, 41 ) blip3 = createBlip ( -116.719, -319.788, 0.171, 41 ) blip4 = createBlip ( 867.670, -31.795, 62.195, 41 ) setTimer(setElementPosition, 2200, 1, player, 94.952682495117, -162.39546203613, 2.59375 ) setTimer(setElementRotation, 2200, 1, player, 0, 0, 173.87872314453 ) fadeCamera ( player, false, 1.0, 0, 0, 0 ) setTimer ( fadeCamera, 2500, 1, player, true, 1.0 ) local TheDV = createVehicle ( 440, 93.857, -164.925, 2.806 ) setElementRotation( TheDV, 0, 0, 270 ) local dlvan = getElementData(player, "got.van" ) if ( dlvan == false ) then setElementData(player,"got.van", TheDV) outputChatBox ( "[DELIVERY MAN]You are now a Delivery man!", player, 0, 255, 0, true ) outputChatBox ( "[DELIVERY MAN]Drive trough the markers to deliver the crates, And earn money.", player, 255, 255, 0, true ) outputChatBox ( "[DELIVERY MAN]Use /quitjob to quit this job.", player, 255, 255, 0, true ) end end addEventHandler( "onMarkerHit", DJmarker, startMission )
  20. Maybe here 93.857, -164.925, 2.806 ? IDK No errors or warnings ?
  21. Sorry but what are you trying to do ? Why you put another part of your script ?
  22. It's very simple, at this line you get the Van: local dlvan = getElementData( player, "got.van" ) So the van to destroy is dlvan yeah ? So why you try to destroy TheDV ? : destroyElement(TheDV) replace by this: destroyElement(dlvan) Be careful with the name of your variables
  23. Yeah but you have to setElementData in the server-side before
  24. Maybe, it's in LS ? If it's in LS, you can move the camera near the VINEWOOD sign ? and maybe near the police station ?
×
×
  • Create New...