![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
pa3ck
Members-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
7
Everything posted by pa3ck
-
When I needed a colshape I used cuboid instead of rectangle. Try the cuboid one. createColCuboid ( float fX, float fY, float fZ, float fWidth, float fDepth, float fHeight ) fX, fY, fZ = positions Width = width of the cuboid Depth = the size of the cuboid from the position Z going downwards Height = the size of the cuboid from the position Z going upwards ( For the rectangle you can not specify its height and its depth, its going all the way up... )
-
You just have to copy and paste the whole thing I guess, then call the smothMoveCamera and set its arguments. Try it.
-
As far as I know, no, there's no such function.
-
getPedOccupiedVehicle(getLocalPlayer())
-
Mine was not an attempt, its working, i tried it. He just never said he wants the player to spawn to a random position. Yours is just full of stupid things like repeat until, you have not specified any arguments for spawnPlayer, you have restartMapInfo() I dont even know why etc... No offense tho... The code is: function randomSpawn() local tplayer = source spawnPlaces = { {10, 10, 10 }, -- Change them, you can also add more if you want to {20, 20, 10 }, {30, 30, 10 }, } local randomPlace = math.random(1, #spawnPlaces) setTimer( function() spawnPlayer(tplayer, spawnPlaces[randomPlace][1],spawnPlaces[randomPlace][2], spawnPlaces[randomPlace][3]) end, 5000, 1) end addEventHandler('onPlayerWasted', getRootElement(), randomSpawn)
-
@mint3d that's a complete mess...
-
setCameraMatrix ( player thePlayer, float positionX, float positionY, float positionZ [, float lookAtX, float lookAtY, float lookAtZ, float roll = 0, float fov = 70 ] ) https://wiki.multitheftauto.com/wiki/SetCameraMatrix setCameraMatrix is not the one you need ( it wont move ), you can set its position and the position you want to be looking at.
-
BTW I think wiki is always up-to-date.
-
You're my man! Thank you!
-
Ohh, okay, thank you. Can I set one of them invisible ( actually the one that fires )? Is there any function for that? And I used onClientRender to check if the key is pressed down this was the simpliest solution I thought of
-
No problem.
-
addEventHandler("onPlayerWasted",root,function () saveWeaponStats(source) end) -- saves it when he dies addEventHandler("onPlayerSpawn",root,function () loadWeaponStats(source) end) -- loads it when he spawns
-
This is a server side code, do you have that in meta.xml? Like : <meta> <script src="s_name.lua" type="server"/> </meta>
-
Is it working properly? You just want to add a function which saves then loads the stats when someone dies? Right?
-
I made this little code, but the minigun's fire is a bit weird. Its not shooting straight... Here's the pic of it: http://s8.postimg.org/gdg1sstlv/gta_sa_ ... _00_34.png The code is the following: addEventHandler('onClientResourceStart', getResourceRootElement(getThisResource()), function() local tp = getLocalPlayer() local veh = getPedOccupiedVehicle(tp) local vx, vy, vz = getElementPosition(veh) local x, y, z = getElementPosition(tp) local minigun1 = createWeapon('minigun', vx, vy, vz) local minigun2 = createWeapon('minigun', vx, vy, vz) attachElements(minigun1, veh, 0.8, 1.3, 0.7, 20, 30, 90) attachElements(minigun2, veh, -0.57, 1.3, 0.7, 20, 30, 90) function fire() if getKeyState("num_6") == true then fireWeapon(minigun1) elseif getKeyState("num_4") == true then fireWeapon(minigun2) end end addEventHandler('onClientRender', getRootElement(), fire) end)
-
Like you give a good number number of co-ordinates then spawn a player to one of them?
-
I think he wants this: https://wiki.multitheftauto.com/wiki/StartResource
-
I dont get what youre tryna say there... What do you want now?
-
Then you gotta edit the freeroam resource itself.
-
I think he wants the colors of the rainbow, like FFS has, not math.random. Thats why he would need timers.
-
You dont need to change anything. This is the full code. Just put it into you resources folder. I'm not sure now, as far as I know you have to retrieve a bot with a command then it will spawn to your position. About LUA, I used this website: http://lua-users.org/wiki/LuaTutorial
-
[HELP] Element is a Player And Is on vehicle
pa3ck replied to CobbTheWarriorsRPG's topic in Scripting
addEventHandler ( "onViolate", secu, secuServer ) change to: addEventHandler ( "onViolate", getRootElement(), secuServer ) And outputChatBox ( "No Perteneces a Este Clan", player, 255, 0, 0, true ) to: outputChatBox ( "No Perteneces a Este Clan", source, 255, 0, 0, true ) -
Wouldn't it make more sense to use onClientRender? It would be much smoother. You would still need timers...