Jump to content

DhrJay

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by DhrJay

  1. Hahaha! you see... I'm a newbie...! Thanks man...Won't bother you any longer (for today )...
  2. Like this? outputChatBox ( "#EE0000 Only army members can drive this car!, true", thePlayer )
  3. Strange...But thanks anyways...! Do you know how I could add colors to the message? #EE0000
  4. YOU F****ING MADE IT! HOW DO YOU KNOW THESE THINGS...! I made it a ZIP file, and now it works... Really, where did you learn all this? I really want to start learning scripting too... But it's very hard for me to understand it... Do you have any URL where I could start? (Exept for the MTA scripting tutorials.. ) (PS: Why does it make such a big difference between a normal folder?!) Tnkx, Jay
  5. \Well, that's the problem... It doesn't say anything at all... It says: start: Resource could not be found. Maybee it's my META: <meta> <script src="server.lua"/> </meta>
  6. Hey man! Thanks! This still doesnt work though... The server doesnt even find the resource... -Jay
  7. Thanks all! I have this now..But it still doesn't work... carristriction.lua: armySkins = { 287, 217 } armycars = { 432, 520, 425, 548 } function enterVehicle ( theVehicle, seat, jacked ) if ( armycars[getElementModel ( theVehicle )] ) and ( not armySkins[getElementModel ( source )] ) and (seat == 0) then cancelEvent() outputChatBox ( "Only army members can drive this car!", source ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) -- this is the event. Meta.xml <meta> <script src="carristriction.lua" /> </meta>
  8. I changed it to 5000... Nothing really changed! Any ideas?
  9. Hi! Yeah, I really am trying to learn from the Wiki... I just don't know where everything should be in the script... Tnks anyways! You're awesome!
  10. YES! YES, I do! Nice! But how do I put this in the script? local url = "http://www.di.fm/mp3/hardstyle.pls" function playTheSound(x, y, z, vehicle) sound = playSound3D(url, x, y, z) setSoundMaxDistance (url,20) if (isElement(vehicle)) then attachElements(sound, vehicle) end end addEvent("playTheSound", true) addEventHandler("playTheSound", root, playTheSound) function stopTheSound(x, y, z) stopSound(sound) end addEvent("stopTheSound", true) addEventHandler("stopTheSound", root, stopTheSound) -- 181 FM: [url=http://www.181.fm/winamp.pls?station=18]http://www.181.fm/winamp.pls?station=18[/url] ... 0(Top%2040)&file=181-power.pls -- The Hitz channel: [url=http://www.in.com/music/radio/977-the-h]http://www.in.com/music/radio/977-the-h[/url] ... el-15.html Just change the 20 to any number you want. Thanks man! You rock!
  11. Hi! I want to add dimention and interiour to this script... I made it like this: What did I do wrong? function changePos( attacker, weapon, bodypart, loss ) if (weapon == 5) then setElementPosition(source, -2616.5964, -2823.8984, 5.7695) interior=0 dimention=0 end end addEventHandler("onPlayerDamage", root, changePos)
  12. YES! YES, I do! Nice! But how do I put this in the script?
  13. Hi Guys! I found this script, and I wanted to expand the reach of the stream. the resource works perfectly, but you can only hear the music when you move your camera to the speaker... Does anyone know how to change this? Client: local url = "http://www.di.fm/mp3/hardstyle.pls" function playTheSound(x, y, z, vehicle) sound = playSound3D(url, x, y, z) if (isElement(vehicle)) then attachElements(sound, vehicle) end end addEvent("playTheSound", true) addEventHandler("playTheSound", root, playTheSound) function stopTheSound(x, y, z) stopSound(sound) end addEvent("stopTheSound", true) addEventHandler("stopTheSound", root, stopTheSound) -- 181 FM: [url=http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040]http://www.181.fm/winamp.pls?station=18 ... 0(Top%2040[/url])&file=181-power.pls -- The Hitz channel: [url=http://www.in.com/music/radio/977-the-hitz-channel-15.html]http://www.in.com/music/radio/977-the-h ... el-15.html[/url] Server: function createSpeaker(thePlayer) local x, y, z = getElementPosition(thePlayer) speakerObject = createObject(2229, x, y, z-4) outputChatBox("You have Succesfully created a speaker!", thePlayer, 0, 250, 0) if (isPedInVehicle(thePlayer)) then local vehicle = getPedOccupiedVehicle(thePlayer) attachElements(speakerObject, vehicle) triggerClientEvent(root, "playTheSound", root, x, y, z, vehicle) else triggerClientEvent(root, "playTheSound", root, x, y, z) end end addCommandHandler("placespeaker", createSpeaker) function deleteSpeaker(thePlayer) if (isElement(speakerObject)) then destroyElement(speakerObject) outputChatBox("You have Succesfully destroyed the Speaker!", thePlayer, 0, 0, 255) triggerClientEvent("stopTheSound", root) else outputChatBox("Speaker is not created!", thePlayer, 250, 0, 0) end end addCommandHandler("destroyspeaker", deleteSpeaker)
  14. addEvent( 'onClientRobberMenu',true ) addEvent( 'onSoundRobbery',true ) addEvent( 'onSoundRobberyStop',true ) local bankWindow = guiCreateWindow( 0.3184,0.3568,0.3809,0.306,"Bank Robbery",true ) local buttonYes = guiCreateButton( 36,147,89,46,"Start",false,bankWindow ) local buttonNo = guiCreateButton( 251,147,89,46,"Close",false,bankWindow ) guiSetVisible( bankWindow,false ) guiSetAlpha( bankwindow,0.4 ) addEventHandler( "onSoundRobbery",root, function( ) sound = playSound3D ( "alarm.mp3", 347.32162475586,164.73616027832,1014.1875, true ) setSoundMaxDistance ( sound, 250 ) end ) addEventHandler( "onSoundRobberyStop",root, function( ) if isElement( sound ) then stopSound( sound ) end end ) addEventHandler( 'onClientRobberMenu',localPlayer, function( ) showCursor( true ) guiSetVisible( bankWindow,true ) addEventHandler ( "onClientGUIClick", buttonYes, function( ) showCursor( false ) guiSetVisible( bankWindow,false ) outputChatBox( "Bank Robbery: Stay in the bank till your robbing is done!",255,0,0 ) outputChatBox( "Bank Robbery: Whatch out cops are comming!",255,0,0 ) triggerServerEvent( 'onStartRobber',localPlayer ) end ,false ) addEventHandler ( "onClientGUIClick", buttonNo, function ( ) showCursor( false ) guiSetVisible( bankWindow,false ) end ,false ) end )
  15. Hi! Tnkx 4 the feedback man! So it's like this?: addEvent( 'onStartRobber',true ) addEvent( 'onEndRobber',true ) local timer,timerOpenBank local bankMarker = createMarker( 347.30355834961,165.21884155273,1014.1875,"cylinder",3,150,0,0,255 ) setElementInterior( bankMarker,3,347.30355834961,165.21884155273,1014.1875 ) local bankColshape = createColCircle ( 347.30355834961,165.21884155273,1014.1875 ) function findMarker( source ) if isElement( source ) then local ret = false for _,v in pairs( getElementsByType 'marker' ) do if getElementData( v,'attack' ) == source then ret = v end end return ret end return false end function resetRobber( ) setElementData( bankMarker,'attack',nil ) setElementData( bankColshape,'attackShape',nil ) end function setRobberDefault( ) if isTimer( timerOpenBank ) then killTimer( timerOpenBank ) end if isTimer( timer ) then killTimer( timer ) end setElementData( bankMarker,'attack',nil ) setElementData( bankColshape,'attackShape',nil ) setElementAlpha( bankMarker,255 ) setElementData( bankMarker,'protected',nil ) setElementData( bankColshape,'protectedShape',nil ) triggerClientEvent( 'onSoundRobberyStop',root ) end addEventHandler( 'onColShapeLeave',bankColshape, function( LeaveElement,dim ) if getElementType( LeaveElement ) == 'player' then if getElementData( source,'attackShape' ) == LeaveElement then outputChatBox( "Bank Robbery: Complete",LeaveElement,255,0,0 ) setRobberDefault( ) end end end ) addEventHandler( 'onPlayerWasted',root, function( ) if findMarker( source ) then outputChatBox( "Bank Robbery: Failed",source,255,0,0 ) setRobberDefault( ) end end ) addEventHandler( 'onPlayerQuit',root, function( ) if findMarker( source ) then setRobberDefault( ) end end ) addEventHandler( "onMarkerHit",bankMarker, function( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' then if not getElementData( source,'attack' ) and not getElementData( source,'protected' ) then triggerClientEvent( hitElement,'onClientRobberMenu',hitElement,source ) else outputChatBox( 'Bank Robbery: You are robbing the bank!',hitElement,255,0,0 ) end end end ) addEventHandler( 'onEndRobber',root, function( marker ) setElementData( bankMarker,'protected','y' ) setElementData( bankColshape,'protectedShape','y' ) if isTimer( timerOpenBank ) then killTimer( timerOpenBank ) end timerOpenBank = setTimer( setRobberDefault,5,1 ) -- ????? ????? ??????? ???? ????? ????? ????? ???????? end ) addEventHandler( 'onStartRobber',root, function( ) setElementAlpha( bankMarker, 0 ) setElementData( bankMarker,'attack',source ) setElementData( bankColshape,'attackShape',source ) setPlayerWantedLevel( source,6 ) triggerClientEvent( 'onSoundRobbery',root ) if isTimer( timer ) then killTimer( timer ) end timer = setTimer( function( player,mark ) outputChatBox( "Bank Robbery: Complete",player,0,30,255 ) resetRobber( ) givePlayerMoney( player,624837 ) triggerClientEvent( 'onSoundRobberyStop',root ) triggerEvent( 'onEndRobber',player,mark ) function changePos( player ) if (onEndRobber) then setElementPosition(source, player) end end addEventHandler("onEndRobber", root, changePos) end, 60000,1,source,bankMarker ) end )
  16. WOW! Too much information at once...! What do you mean by all this?
  17. Hi guys! I made this script, but I want the robbers to warp to an other location after they successfully robbed the bank... Does anyone know what i did wrong? -- Bank rob donated to SAMG:RPG -- -- Made by Nabz0rkingz0r -- addEvent( 'onStartRobber',true ) addEvent( 'onEndRobber',true ) local timer,timerOpenBank local bankMarker = createMarker( 347.30355834961,165.21884155273,1014.1875,"cylinder",3,150,0,0,255 ) setElementInterior( bankMarker,3,347.30355834961,165.21884155273,1014.1875 ) local bankColshape = createColCircle ( 347.30355834961,165.21884155273,1014.1875 ) function findMarker( source ) if isElement( source ) then local ret = false for _,v in pairs( getElementsByType 'marker' ) do if getElementData( v,'attack' ) == source then ret = v end end return ret end return false end function resetRobber( ) setElementData( bankMarker,'attack',nil ) setElementData( bankColshape,'attackShape',nil ) end function setRobberDefault( ) if isTimer( timerOpenBank ) then killTimer( timerOpenBank ) end if isTimer( timer ) then killTimer( timer ) end setElementData( bankMarker,'attack',nil ) setElementData( bankColshape,'attackShape',nil ) setElementAlpha( bankMarker,255 ) setElementData( bankMarker,'protected',nil ) setElementData( bankColshape,'protectedShape',nil ) triggerClientEvent( 'onSoundRobberyStop',root ) end addEventHandler( 'onColShapeLeave',bankColshape, function( LeaveElement,dim ) if getElementType( LeaveElement ) == 'player' then if getElementData( source,'attackShape' ) == LeaveElement then outputChatBox( "Bank Robbery: Complete",LeaveElement,255,0,0 ) setRobberDefault( ) end end end ) addEventHandler( 'onPlayerWasted',root, function( ) if findMarker( source ) then outputChatBox( "Bank Robbery: Failed",source,255,0,0 ) setRobberDefault( ) end end ) addEventHandler( 'onPlayerQuit',root, function( ) if findMarker( source ) then setRobberDefault( ) end end ) addEventHandler( "onMarkerHit",bankMarker, function( hitElement, matchingDimension ) if getElementType( hitElement ) == 'player' then if not getElementData( source,'attack' ) and not getElementData( source,'protected' ) then triggerClientEvent( hitElement,'onClientRobberMenu',hitElement,source ) else outputChatBox( 'Bank Robbery: You are robbing the bank!',hitElement,255,0,0 ) end end end ) addEventHandler( 'onEndRobber',root, function( marker ) setElementData( bankMarker,'protected','y' ) setElementData( bankColshape,'protectedShape','y' ) if isTimer( timerOpenBank ) then killTimer( timerOpenBank ) end timerOpenBank = setTimer( setRobberDefault,5,1 ) -- ????? ????? ??????? ???? ????? ????? ????? ???????? end ) addEventHandler( 'onStartRobber',root, function( ) setElementAlpha( bankMarker, 0 ) setElementData( bankMarker,'attack',source ) setElementData( bankColshape,'attackShape',source ) setPlayerWantedLevel( source,6 ) triggerClientEvent( 'onSoundRobbery',root ) if isTimer( timer ) then killTimer( timer ) end timer = setTimer( function( player,mark ) outputChatBox( "Bank Robbery: Complete",player,0,30,255 ) resetRobber( ) givePlayerMoney( player,624837 ) triggerClientEvent( 'onSoundRobberyStop',root ) triggerEvent( 'onEndRobber',player,mark ) function changePos( attacker, weapon, bodypart, loss ) if (onEndRobber) then setElementPosition(source, -2616.5964, -2823.8984, 5.7695) end end addEventHandler("onEndRobber", root, changePos) end, 60000,1,source,bankMarker ) end )
  18. Hey! Thanks for the quick reply... But the first line says: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), What's the right way to do it? I'm learning LUA so, be patient please...
  19. Hey guys! Can someone please tell me what I did wrong? This is my carristriction.lua: addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() armySkins = { [287]=true, [217]=true} armycars = { [432]=true, [520]=true, [425]=true, [548]=true } end ) function enterVehicle ( thePlayer, seat, jacked ) if ( armycars[getElementModel ( source )] ) and ( not armySkins[getElementModel ( thePlayer )] ) and (seat == 0) then cancelEvent() outputChatBox ( "Only army members can drive this car!", thePlayer ) end end This is my meta.xml: <meta> <script src="rrtrucker_server.lua" /> </meta>
  20. Ahhhaaa... thanks for the quick reply mate! -Jay
  21. Hii guys! Found this resource on the web... I think it's broken or something... Does anyone know how to make it ''readable''?! I will just post a little piece of the script because it's freakin' huge! -Jay ‘ E@ € ÁÀ AA  \€€G EÀ …  € \@€E …  \@€E@ € ÁÀ AA ‚ Å \@€EÀ € ÁÀ AA  \€ G€ E@ …€ Á€ A \@€EÀ …€ Á \@€E@ …€ Á \@ E€ …€ ÁÀ \@€EÀ @ ÁÀ AA  \€ G E@ … Á€ A \@€EÀ … Á \@€E@ … ÁÀ \@ E€ … ÁÀ \@€EÀ € Á@ A Á  \€ G E@ … Á€ A \@€EÀ … Á \@€E@ … Á \@ E@ € ÁÀ A A  \€ G E€ … ÁÀ \@€E@ À Á Á AÁ A  \€ G€ E@ Á Á AÁ Á  \€ G€ E@ @ Á Á AÁ  \€ G E@ À Á Á AÁ A  \€ GÀ E@ Á Á AÁ Á  \€ G€ E@ @ Á Á AÁ A  \€ G E@ À ÁÀ Á AÁ  \€ G€ E@ ÁÀ Á AÁ  \€ G@ E@ @ ÁÀ Á AÁ  \€ GÀ E@ À Á€ Á AÁ Á  \€ G@ E@ Á€ Á AÁ A  \€ G E@ @ Á€ Á AÁ Á  \€ G€ E …  \@€d G@ E€ À Å A B \@€E€ À Å A B \@€E€ À Å€ A B \@€E€ À Å€ A B \@€E€ À Å A B \@€E€ À ÅÀ A B \@€E€ À Å€ A B \@€E€ À Å A B \@€E€ À Å€ A B \@€E€ À Å@ A B \@€E€ À ÅÀ A B \@€E€ À Å€ A B \@€d@ G d€ G@ dÀ G€ EÀ  € \@€E€ Å@ Ü€€ \@ d G€ EÀ À  € \@€E€ À Å@ Ü€€ \@ d@ G EÀ @  € \@€E€ @ Å@ Ü€€ \@ E€ € ÅÀ Ü€€ $ \@ dÀ G EÀ @  € \@€E€ @ Å@ Ü€€ \@ d G€ EÀ €  € \@€E€ € ÅÀ \@ d@ G EÀ  € \@€E€ ÅÀ \@ € Y keypad guiCreateWindow |@ p@ x@ €@ Security Keypad guiWindowSetMovable guiWindowSetSizable guiCreateGridList M@ @S@ Ðp@ €I@
  22. Wow, this is really good information... But I don't really know where to start... Isn't there any youtube vid. where i could just see how to script? -Jay I gave you a working tutorial, you just need to read. Yeah thats right... But there are two things...! One, they dont start from the ground up... From scratch... And two, i've got dislection...! Reading is hard for me...Especially when things don't make sense...! I will try, thanks anyways! -Jay
  23. Relax man... I was trying...! I've never scripted before...but I want to learn how to do it. Saw it in an other resource's meta...Toughed it needed to be there. I will remove it, thanks... -Jay
  24. Thanks dude! Saved this as a .lua + I made a meta file like this: <meta> <script src="warpobat.lua"/> <export function="changePos" type="server" /> <export function="setElementPosition" type="server"/> <export function="addEventHandler" type="server"/> </meta> And saved it as meta.xml Is this the right way? -Jay
×
×
  • Create New...