
tinnetju
Members-
Posts
68 -
Joined
-
Last visited
Everything posted by tinnetju
-
Please man help me, more replys please!
-
Ok, my mistake but he keeps saying the setPedControlState has a bad argument
-
Heey, i got some probs with my RC Car script. I think im done with my script, except setPedControlState, it keeps saying bad argumant in mta sa. I debugged it with the 50p script editor thing and he doesnt say anything. In my script i got a couple of setPedControlState's and he says they are all bad argument... Here are my scripts: Meta.xml: "Tinne_Spoel" version="1.0" type="script" description="A RC race track with rc cars" /> script_s.lua: rccar1=createVehicle(441, -2932.93, 485.22, 4.91, 0, 0, 180) rccar2=createVehicle(441, -2934.93, 485.22, 4.91, 0, 0, 180) rccar3=createVehicle(441, -2936.93, 485.22, 4.91, 0, 0, 180) rccar4=createVehicle(441, -2938.93, 485.22, 4.91, 0, 0, 180) rccarman1=createPed(180, 3500, 485.22, 4.91) rccarman2=createPed(180, 3500, 485.22, 4.91) rccarman3=createPed(180, 3500, 485.22, 4.91) rccarman4=createPed(180, 3500, 485.22, 4.91) setElementID(rccarman1,"rccarman1") setElementID(rccarman2,"rccarman2") setElementID(rccarman3,"rccarman3") setElementID(rccarman4,"rccarman4") warpPedIntoVehicle(rccarman1,rccar1) warpPedIntoVehicle(rccarman2,rccar2) warpPedIntoVehicle(rccarman3,rccar3) warpPedIntoVehicle(rccarman4,rccar4) setVehicleDamageProof(rccar1,true) setVehicleDamageProof(rccar2,true) setVehicleDamageProof(rccar3,true) setVehicleDamageProof(rccar4,true) function replaceModel() txd = engineLoadTXD("rcbandit.txd", 441 ) engineImportTXD(txd, 441) dff = engineLoadDFF("rcbandit.dff", 441 ) engineReplaceModel(dff, 441) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) script_c.lua rccarman1=getElementByID("rccarman1") rccarman2=getElementByID("rccarman2") rccarman3=getElementByID("rccarman3") rccarman4=getElementByID("rccarman4") rccarman1controls={accelerate="w",brake_reverse="s",vehicle_left="a",vehicle_right="d",handbrake="space"} rccarman2controls={accelerate="w",brake_reverse="s",vehicle_left="a",vehicle_right="d",handbrake="space"} rccarman3controls={accelerate="w",brake_reverse="s",vehicle_left="a",vehicle_right="d",handbrake="space"} rccarman4controls={accelerate="w",brake_reverse="s",vehicle_left="a",vehicle_right="d",handbrake="space"} function ctrlrccarman1() for ctrl,key in pairs(rccarman1controls) do setPedControlState(rccarman1,ctrl,getKeyState(key)) end end function ctrlrccarman2() for ctrl,key in pairs(rccarman2controls) do setPedControlState(rccarman2,ctrl,getKeyState(key)) end end function ctrlrccarman3() for ctrl,key in pairs(rccarman3controls) do setPedControlState(rccarman3,ctrl,getKeyState(key)) end end function ctrlrccarman4() for ctrl,key in pairs(rccarman4controls) do setPedControlState(rccarman4,ctrl,getKeyState(key)) end end addEventHandler("onClientPreRender",getRootElement(),ctrlrccarman1) addEventHandler("onClientPreRender",getRootElement(),ctrlrccarman2) addEventHandler("onClientPreRender",getRootElement(),ctrlrccarman3) addEventHandler("onClientPreRender",getRootElement(),ctrlrccarman4) I hope you guys can help me! And sorry for my bad english, im just a dutch person.
-
What do you mean by that? You can't have giveWeapon client-side, since it's a server-side only function. To move the ped and have him attack, you need setPedControlState. But let me tell you that this is quite a complicated thing to do. You need a client to calcute the ped's movement (like turning into the victims direction and of course running) and the attacking and then sync it to the server. So, you actually have to write a mini AI, which isn't an easy task even for quite good programmers, let alone beginners. And there is also math involved, so you should know your sinus and cosinus. oowwh soz i ment .txd and to bad its that hard :l
-
Ive tried, but i still don't understand why he can use createPed in client!
-
Hello, I wanted to make a little Myth script with a man thats in a train tunnel with MANY many health and a chainsaw. I already got the .txt file and the replace file and that working. The spawn .lua is server sided, but the setpedstat and give weapon stuff is client sided, how do i connect them? And i also can't find how to make him attack you with the chainsaw running (you know, when the chainsaw says HIIIIIIIIIIIIIINNNNGGGG) Here is the client side: txd = engineLoadTXD("126.txd") engineImportTXD(txd, 126) function pedLoad ( pedLoad ) setPedStat( ped,24,2000) setPedStat( ped,164,2000) giveWeapon ( source, 2, 1 ) setPedWeaponSlot ( ped, 1 ) end addEventHandler ( "onResourceStart", getRootElement(), pedLoad ) And here is the server side: createPed ( 126, 871.64227294922, 2720.6179199219, 20.586917877197 ) I debugged it and it says no errors or something,
-
So, i need help with my join script. If a player joins he sees a nice hotel, and some information in the chatbox. And if you log in, you go to the pirateship if this is the first time you visit the server or spawn where you quited your last visit. Buy everytime i start/restart a script, you get back to the hotel vieuw! And every 80+/- sec you automatically see the hotel vieuw! Can someone please help me? addEventHandler( "onClientResourceStart", getRootElement(), function(startedRes) OnPlayerJoinToServer(getLocalPlayer()) -- use the local player as first parameter end ); function OnPlayerJoinToServer(theplayer) local player = theplayer or source outputChatBox ( "Welcome to the FOBI RPG/Freeroam server!", getRootElement(), 0, 0, 255 ) outputChatBox ( "In FOBI you have to register with /register [Password] and /login [Password]", getRootElement(), 0, 0, 255 ) outputChatBox ( "But be careful! Always use the same name! Otherwise the server wont recognize you!", getRootElement(), 0, 0, 255 ) outputChatBox ( "You are now ready to join the server. Play fair, be nice and have fun!", getRootElement(), 0, 0, 255 ) fadeCamera(true) setCameraTarget(getLocalPlayer()) setCameraMatrix(2051.3527832031, 1343.1384277344, 19.391807556152, 1981.9815673828, 1343.0343017578, 12.447468757629) -- end addEventHandler("onClientPlayerJoin", getRootElement(), OnPlayerJoinToServer)
-
So a... like this: ----------------------------------------------------UFO----------------------------------------------------- function ufo0() setTimer ( ufo1, 20000, 1 ) obj = createObject ( 3065, 1816.2037353516, 2984.2958984375, 18.470184326172, 0.0, 0.0, 180.0 ) end function ufo1 () moveObject ( obj, 30000, 1819.6104736328, 2972.0537109375, 2972.0537109375 ) setTimer ( ufo2, 10000, 1 ) end function ufo2 () moveObject ( obj, 30000, 2143.0268554688, 1934.6469726563, 50.037300109863 ) setTimer ( ufo3, 10000, 1 ) end function ufo3 () moveObject ( obj, 30000, 2043.7503662109, 1484.8260498047, 37.90535736084 ) setTimer ( ufo4, 10000, 1 ) end function ufo4 () moveObject ( obj, 6000, 1968.7268066406, 1556.1391601563, 47.898307800293 ) setTimer ( ufo5, 10000, 1 ) end function ufo5 () moveObject ( obj, 90000, 35.0500831604, 2239.6882324219, 126.6796875848 ) And what has to be here? Just ufo 6 when ufo 6 doesnt exist? Or just setTimer ( ufo5, 10000, 1 ) setTimer ( ufo6, 10000, 1 ) end And this has to be like this?: addEventHandler ( "onResourceStart", getRootElement(), ufo0 )
-
What is separately...? Im from holland i don't understand expensive words... And why can i create only 2 ufo objects?
-
Oké, guys i made a flying UFO that flies over Los Santos. But when i run the script, nothing happens! Just nothing, i debugged the script and also nothing. Here are my files: meta.xml <meta> <info author="Tinnetju" type="script" version="1.0" /> <script src="script.lua" type="client" /> <script src="replacescript.lua" type="client" /> <file src="kmb_skip.dff" /> <file src="kmb_skip.txd" /> meta> replacescript.lua function replaceModel() txd = engineLoadTXD("kmb_skip.txd", 3065 ) engineImportTXD(txd, 3065) dff = engineLoadDFF("kmb_skip.dff", 3065 ) engineReplaceModel(dff, 3065) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceModel) script.lua ----------------------------------------------------UFO----------------------------------------------------- function ufo0() setTimer ( ufo1, 20000, 1 ) obj = createObject ( 3065, 1816.2037353516, 2984.2958984375, 18.470184326172, 0.0, 0.0, 180.0 ) end function ufo1 () moveObject ( obj, 30000, 1819.6104736328, 2972.0537109375, 2972.0537109375 ) end function ufo2 () moveObject ( obj, 30000, 2143.0268554688, 1934.6469726563, 50.037300109863 ) end function ufo3 () moveObject ( obj, 30000, 2043.7503662109, 1484.8260498047, 37.90535736084 ) end function ufo4 () moveObject ( obj, 6000, 1968.7268066406, 1556.1391601563, 47.898307800293 ) setTimer ( ufo5, 10000, 1 ) end function ufo5 () moveObject ( obj, 90000, 35.0500831604, 2239.6882324219, 126.6796875848 ) end function ufo6 () moveObject ( obj, 90000, -2002.2766113281, 2833.1345214844, 159.09712219238 ) end function ufo7 () moveObject ( obj, 70000, -692.3271484375, 2835.298828125, 82.780288696289 ) end function ufo8 () moveObject ( obj, 48000, -150.60882568359, 2807.0397949219, 94.384284973145 ) end function ufo9 () moveObject ( obj, 45000, 376.03628540039, 2774.7685546875, 87.456558227539 ) end function ufo10 () moveObject ( obj, 38000, 706.92327880859, 2796.0771484375, 89.685066223145 ) end function ufo11 () moveObject ( obj, 80000, 1815.8771972656, 2980.8264160156, 101.33991241455 ) end function ufo12 () moveObject ( obj, 8000, 1815.8771972656, 2980.8264160156, 18.361310958862 ) end addEventHandler ( "onResourceStart", getRootElement(), ufo0 )
-
Lol fail, it works =D I filled in at the meta.xml file Server but it had to be client. Thanks for your help guys ! =D
-
Wait a second... Is my script Server side or client side?
-
You had to back-up
-
Im affraid, i dont understand... I don't get it...
-
Because you missed my post? What doesn't work? You said: Did you mean there is no problem with the script? oowh nonono i was replying sebas' post, and then the same time you posted your post. I gonna check your post right now,
-
No. setTimer ( explosions1, 3, 3 ) That's wrong.. Like the wiki says: "The minimum accepted interval is 50ms." Working version: setTimer ( explosions1, 50, 3 ) And still it doesnt work... Why does this stupid script don't work?!
-
Ok 50P, i wanted to make a stage with fireworks and stuff, a little that looks like this. And this is the code: function recourse_says_hai () explosions1 () end addEventHandler ( "onClientResourceStart", getRootElement(), recourse_says_hai ) function explosions1 () setTimer ( explosions1, 3000, 3 ) createExplosion ( -2094.9040527344, 1419.5814208984, 15.529975891113, 12, false ) createExplosion ( -2061.7202148438, 1419.6507568359, 15.529975891113, 11, false ) createExplosion ( -2061.6442871094, 1437.0441894531, 15.529975891113, 0, false ) createExplosion ( -2094.9599609375, 1437.4919433594, 15.529975891113, 2, false ) end addEventHandler ( "onResourceStart", getRootElement(), pedLoad ) function pedLoad ( createPed ) createPed ( 164, -2093.9348144531, 1416.8395996094, 7.1006660461426, 180 ) end But when i run the script, he doesn't give any problems. And the debugscript only says that line 13 is wrong, the addEvendHandler... But how could that possibly be wrong when i got it from the wiki? Can you please help me?
-
Ok, ok, wait i am also trying to make a ped script...
-
Lol, hi 50P And, ye they are helping me, but the script still doesn't work... And i really want it to let it work... So can you be one of the people that are helping me?
-
Isnt there anything wrong if this? function recourse_says_hai () explosions1 () end addEventHandler ( "onClientResourceStart", getRootElement(), recourse_says_hai ) function explosions1 () Like explosions1 or resource_says_hi ? And why doesnt 50p or little toady answers my question?
-
aaawh shit... Anyone else any suggestions?
-
Anyone else? Does it has to be "true" instead of "false" ?
-
So, the explosions has to be turned to true, and then the script works?
-
Ohh, and by the way. Why is do i see at the end of this line, false...? Doesn't that has to be true? createExplosion ( -2094.9040527344, 1419.5814208984, 15.529975891113, 12, false )