-
Posts
2,947 -
Joined
-
Last visited
Everything posted by JR10
-
function moveThePlayer() local playerexp = getElementData(source, "Exp") if not playerexp then setElementData(source, "Exp", 0) playerexp = 0 end if (playerexp) <= 500 then setElementData(source, "JOB", "POLICININKAS") setElementModel(source, 280) outputChatBox ( "Sveikiname jus nuo siol esate pareigunas. Dirbkite atsakingai!", source) else outputChatBox ( "Jus neturite pakankamai patirties!", source) end end -- define our custom event, and allow it to be triggered from the client ('true') addEvent("giveJob",true) -- add an event handler so that when movePlayerToPosition is triggered, the function moveThePlayer is called addEventHandler("giveJob",root,moveThePlayer)
-
What do you mean? Perhaps this: getTickCount
-
function yakuza(thePlayer) local account = getPlayerAccount ( thePlayer ) if not isGuestAccount(account) and getAccountName(account) == "yakuza" then respawnVehicle ( vehicle1 ) else outputChatBox ( "You cant make this use", thePlayer, 255, 200, 0 ) end end addCommandHandler("respawnmycar", yakuza) Is vehicle1 a global variable?
-
That's up to you, you should pick something easy to practise with.
-
DarkLink lol, check the date before posting man. And only admins can create houses.
-
ابي اتعلم (العلم نور والجهل ظلام) شباب تكفون ادخلو
JR10 replied to faisl2002's topic in Arabic / العربية
اهلا بيك الموضوع صعب فى الأول, لكن باذن الله يبقى أسهل بالمحاولة أنصحك بالويكى كبداية, و استفسر هنا https://wiki.multitheftauto.com/wiki/Main_Page -
How can you have an mp3 file in a map? Anyway, since it's in the meta as a file, it will be downloaded.
-
That's not a problem or a bug, the client sided scripts and client files are downloaded and saved. The maps are downloaded, but not saved, so the client will download it over and over again. You can't compile a map file, so with what you want, everyone will download the maps and use them personally.
-
DarkLink, check the date again.
-
addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then cancelEvent() end end) function meCommand(player, cmd, ...) local wordsTable = {...} local msg = table.concat(wordsTable, " ") if msg and #wordsTable > 0 then local posX, posY, posZ = getElementPosition(player) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(player) .. ' ' .. msg, _player, 194, 162, 218) end end else outputChatBox('NAUDOJIMAS: /me [tekstas]', player, 255, 255, 255) end end addCommandHandler('me', meCommand) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
-
Try this: addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then cancelEvent() end end) function meCommand(player, cmd, ...) local msg = table.concat({...}, " ") if msg and #{...} > 0 then local posX, posY, posZ = getElementPosition(player) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(player) .. ' ' .. msg, _player, 194, 162, 218) end end else outputChatBox('NAUDOJIMAS: /me [tekstas]', player, 255, 255, 255) end end addCommandHandler('me', meCommand) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
-
addEventHandler('onPlayerChat', getRootElement(), function(message, messageType) if (messageType == 1) then cancelEvent() end end) function meCommand(player, cmd, ...) local msg = table.concat({...}, " ") if msg then local posX, posY, posZ = getElementPosition(player) for index , _player in pairs ( getElementsByType ( "player" ) ) do if isPlayerInRangeOfPoint ( _player , posX , posY , posZ , 20 ) then outputChatBox('* ' .. getPlayerName(player) .. ' ' .. msg, _player, 194, 162, 218) end end else outputChatBox('NAUDOJIMAS: /me [tekstas]', player, 255, 255, 255) end end addCommandHandler('me', meCommand) function isPlayerInRangeOfPoint ( player , posX , posY , posZ , range ) local _posX , _posY , _posZ = getElementPosition ( player ) return ( ( posX - _posX ) ^ 2 + ( posY - _posY ) ^ 2 + ( posZ - _posZ ) ^ 2 ) ^ 0.5 <= range end
-
What would be a correct script for a teleporting system
JR10 replied to stormchaser206's topic in Scripting
Why the hurry, learn first then start making scripts. -
And 'source' shouldn't be in the function arguments. And fileDelete thing for client sided scripts doesn't work, I tried it, if you disconnect, it will remain.
-
Nice tutorial. White is a bad choice for a color. I think you got it wrong, this is for compiling MTA:SA from source. Not for compiling Lua scripts.
-
I've never used MySQL, perhaps I will learn it soon and post a tut.
-
What does it say in debugscript?
-
Dude, you need to use guiSetText correctly, and many times to change each GUI element's text to Arabic. See guiSetText wiki page.
-
Does the drift resource have an exported function so you can get the drift?
-
He already copied that script and edited the name of the column. You need to edit the scoreboard resource, so it draws image instead of text.
-
function findRotation ( posX , posY , _posX , _posY ) return 360 - ( math.deg ( math.atan2 ( _posX - posX , _posY - posY ) ) % 360 ) end Will get you the rotation to x,y,z addEventHandler("onClientClick", getRootElement(), function( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) if(button == "left")then if(state == "down")then local x, y, z = worldX, worldY, worldZ if x and y and z then local posx , posy , posz = getElementPosition ( localPlayer ) local rot = findRotation ( posx , posy , x , y ) setPedRotation ( localPlayer , rot ) setControlState ( "forwards" , true ) end end end end) function findRotation ( startx , starty , endx , endy ) return 360 - ( math.deg ( math.atan2 ( endx - startx , endy - starty ) ) % 360 ) end Now you need to work something out for stopping him when he arrive. And prevent him from stopping due to obstacles.