
Vercetti1010
Members-
Posts
109 -
Joined
-
Last visited
Everything posted by Vercetti1010
-
hmm, that sounds good, a loop. im guessing i can just have it do like a setTimer. how could i get that to stop so they arent constantly being shot at while in the server
-
here it is. edit it to your use serverside local deathSphere = createColSphere ( X, Y, Z, Radius ) --Triggers rockets local warningSphere = createColSphere ( X, Y, Z, Radius ) --Triggers warning function enableSam ( thePlayer ) setElementPosition ( deathSphere, X, Y, Z ) setElementPosition ( warningSphere, X, Y, Z ) outputChatBox ( "You have enabled the SAM sites at (put place here)", thePlayer, 255, 0, 0 ) end function disableSam ( thePlayer ) setElementPosition ( deathSphere, 0, 0, -9999 ) setElementPosition ( warningSphere, 0, 0, -9999 ) outputChatBox ( "You have disabled the SAM sites at(place here)", thePlayer, 255, 0, 0 ) end function samSite ( thePlayer, matchingDimension ) veh = getPlayerOccupiedVehicle ( thePlayer ) id = getVehicleID ( veh ) if ( id == 592 or id == 577 or id == 511 or id == 548 or id == 512 or id == 593 or id == 425 or id == 520 or id == 417 or id == 487 or id == 553 or id == 488 or id == 497 or id == 563 or id == 476 or id == 447 or id == 519 or id == 460 or id == 469 or id == 513 or id == 464 or id == 501 or id == 465 ) then triggerClientEvent ( thePlayer, "onSamTrigger", getRootElement() ) outputChatBox ( "Surface to air missiles have been fired!", thePlayer, 255, 0, 0 ) end end function samWarn ( thePlayer, matchingDimension ) veh = getPlayerOccupiedVehicle ( thePlayer ) id = getVehicleID ( veh ) if ( id == 592 or id == 577 or id == 511 or id == 548 or id == 512 or id == 593 or id == 425 or id == 520 or id == 417 or id == 487 or id == 553 or id == 488 or id == 497 or id == 563 or id == 476 or id == 447 or id == 519 or id == 460 or id == 469 or id == 513 or id == 464 or id == 501 or id == 465 ) then outputChatBox ( "Warning! (place here) has SAM sites activated! Turn back!", thePlayer, 255, 0, 0 ) end end function jetpackTrigger ( thePlayer, matchingDimension ) if ( doesPlayerHaveJetPack ( thePlayer ) ) then outputChatBox ( "Warning! (place here) will kill you with telepathy if you go in with a jetpack!", thePlayer, 255, 0, 0 ) end end function jetpackWarn ( thePlayer, matchingDimension ) if ( doesPlayerHaveJetPack ( thePlayer ) ) then triggerClientEvent ( thePlayer, "onSamTrigger", getRootElement() ) outputChatBox ( "I wasn't lying about the telepathy death. Enjoy the fireworks!", thePlayer, 255, 0, 0 ) killPlayer ( thePlayer ) end end addCommandHandler ( "activatesam", enableSam ) addCommandHandler ( "deactivatesam", disableSam ) addEventHandler ( "onColShapeHit", deathSphere, samSite ) addEventHandler ( "onColShapeHit", warningSphere, samWarn ) addEventHandler ( "onColShapeHit", deathSphere, jetpackWarn ) addEventHandler ( "onColShapeHit", warningSphere, jetpackTrigger ) clientside: function samTrigger ( thePlayer ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) createProjectile ( getLocalPlayer(), 20, X, Y, Z, 50, getLocalPlayer() ) end addEvent ( "onSamTrigger", true ) addEventHandler ( "onSamTrigger", getRootElement(), samTrigger )
-
i figured it out. the clientside was ok but the serverside was messed up. i mistakenly mixed the event handler with the functions. it works now
-
hypocrite much? weren't you the one originally showing disrespect to KWKSND? Practice what you preach friend.
-
has anyone noticed that you cant set your skin to woozie or tenpenny or any main game character? that should be available in DP3. does anyone know if you can in DP3 or not? if they are available then how do you set your skin to that character
-
I would modify it. im guessing i can just follow the format of the commands already there. we definatley need this. our secret commands keep leaking out to the public somehow lol. nobody says a word and everyone in the server can get into area 51. i had a look at the acl.xml and i notice a pattern. i think i understanf how to add commands to a group. is there a way to have it look for an admins nickname. or more likely how do i add someone to a group.
-
ok, that sounds promising. i can ask for the xml from my fellow administrators. how does acl work? i checked on the wiki but it wasnt very comprehensive, it just showed what it does. say i never made an acl.xml file or looked at one ever. after looking at one, what do i do next?
-
our admin system is not like a ususal one and i am not the maker of it nor do i understand it remotely. acl probably will not work for anyone except the top level admins. is there another way i could do this?
-
is there a way to restrict a command to only some people? we have our group of admins in our server but we often have to keep some commands secret, such as the opening of our gates at area 51 becasue we do not know how to restritct them. this question comes up becasue I have a perfect jail script, but this absolutley cannot be accessbile to anyone. how might i go about restricting the usage to admins only? just fyi, i do not own the server, i am a scripter for it, so it has to be a way that i can do it without editing the servers files. here is an example of the script i want to restrict. function jailPlayer(thePlayer, commandName, jailTarget) theNoob = getPlayerFromNick(jailTarget) if (theNoob) then setElementInterior ( theNoob, 10 ) setElementPosition (theNoob, 215.24324035645, 110.02223205566, 999.015625) setElementDimension ( theNoob, 10 ) toggleAllControls ( theNoob, false ) outputChatBox ( "You have been jailed", theNoob, 193, 13, 13 ) outputChatBox ( "You jailed a player", thePlayer, 193, 13, 13 ) else outputChatBox ("Error: This player doesn't exist", thePlayer, 193, 13, 13) end end function unJail (thePlayer, commandName, jailTarget) theNoob = getPlayerFromNick(jailTarget) if (theNoob) then setElementInterior ( theNoob, 0) setElementPosition (theNoob, 2290.2666015625, 2431.1103515625, 10.8203125) setElementDimension ( theNoob, 0 ) toggleAllControls (theNoob, true) outputChatBox ("You've been released, please behave next time", theNoob, 193, 13, 13) outputChatBox ("You released a player", thePlayer, 193, 13, 13) else outputChatBox ("Error: This player doesn't exist", thePlayer, 193, 13, 13 ) end end addCommandHandler("jail", jailPlayer) addCommandHandler("unjail", unJail )
-
I have a weird issue with my chat box. it is bigger than usual, the text is bigger and slightly blurry and i cant see as much conversation. how do i fix this? i reinstalled mta a few times and the first time i run it, its fine, but after i srestart mta the chatbox is messed up again
-
since I am the maker of this script i can shed some light about how to do it. im not copying and pasting becasue teh script is huge and you would need to have our map file for it to appear normal. what you need to do is this open map editor (mtasa race) and place objects that do not move place the gates in a closed position and note the object ID and the xyz coorinates do the same for the open position make a function that creates the gates (i.e. gate = createObject ( ObjectID, X, Y, Z )) make a function that moves the gates to an open poition and do the same for closed ( moveObject ( gate, time, openX, openY, openZ ) ) then put it in the way you want to trigger it, if command put addCommandHandler ( "opensesame", openGate ) or maybe if you are feeling crafty make a colSphere so it opens when you enter it and closes when you leave it. it is all up to you. just check the wiki for info if you are stuck.
-
im not calling you five year olds, im just saying that those words confuse me. all i am asking is to talk in simpler words
-
still nothing happens and still no errors. I dont know what the deal is. please someone give me info that i understand, not insert varialbe into the root element and setnode mumbojumbo. just please help me in english. serverside function samOn ( thePlayer ) deathSphere = createColSphere ( 188.28005981445, 1941.6798095703, 17.673742294312, 100 ) outputChatBox ( "You have activated the Area 69 SAM sites", thePlayer, 255, 0, 0 ) end function samOff ( thePlayer ) destroyElement ( deathSphere ) outputChatBox ( "You have disabled the Area 69 SAM sites", thePlayer, 255, 0, 0 ) end addCommandHandler ( "samon", samOn ) addCommandHandler ( "samoff", samOff ) clientside function onClientColShapeHit ( deathSphere, true ) target = getLocalPlayer() playervehicle = getPlayerOccupiedVehicle ( target ) id = getVehicleID ( playervehicle ) if ( target ) then if ( playervehicle ) then if ( id == 592 or id == 577 or id == 511 or id == 548 or id == 512 or id == 593 or id == 417 or id == 487 or id == 553 or id == 488 or id == 497 or id == 563 or id == 476 or id == 447 or id == 519 or id == 460 or id == 469 or id == 513 or id == 441 or id == 501 or id == 465 ) then createProjectile ( target, 20, 15.58650970459, 1719.0345458984, 26.134944915771, 500, playervehicle ) createProjectile ( target, 20, 237.6640625, 1696.4927978516, 26.089979171753, 500, playervehicle ) createProjectile ( target, 20, 354.64459228516, 2028.2109375, 26.094778060913, 500, playervehicle ) createProjectile ( target, 20, 188.35180664063, 2081.2719726563, 26.120576858521, 500, playervehicle ) outputChatBox ( "Warning! SAM collision iminent!", target, 255, 0, 0 ) end else if ( doesPlayerHaveJetpack ( target ) ) then createProjectile ( target, 20, 15.58650970459, 1719.0345458984, 26.134944915771, 500, target ) createProjectile ( target, 20, 237.6640625, 1696.4927978516, 26.089979171753, 500, target ) createProjectile ( target, 20, 354.64459228516, 2028.2109375, 26.094778060913, 500, target ) createProjectile ( target, 20, 188.35180664063, 2081.2719726563, 26.120576858521, 500, target ) outputChatBox ( "Warning! SAM collision iminent!", target, 255, 0, 0 ) end end end end
-
i think i kinda understand more about it now. but, i want to make the sams able to turn off and on. if i make that decision clientside then it will be up to the client to set up the colShpere, and im sure they dont want to get blown up when trying to intrude on the base lol. can you call something from another script in the resource?
-
still doesnt work. and aslo, still no errors. function onClientColShapeHit ( target, playervehicle, id ) target = getLocalPlayer() playervehicle = getPlayerOccupiedVehicle ( target ) id = getVehicleID ( playervehicle ) if ( target ) then if ( playervehicle ) then if ( id == 592 or id == 577 or id == 511 or id == 548 or id == 512 or id == 593 or id == 417 or id == 487 or id == 553 or id == 488 or id == 497 or id == 563 or id == 476 or id == 447 or id == 519 or id == 460 or id == 469 or id == 513 or id == 441 or id == 501 or id == 465 ) then createProjectile ( target, 20, 15.58650970459, 1719.0345458984, 26.134944915771, 500, playervehicle ) createProjectile ( target, 20, 237.6640625, 1696.4927978516, 26.089979171753, 500, playervehicle ) createProjectile ( target, 20, 354.64459228516, 2028.2109375, 26.094778060913, 500, playervehicle ) createProjectile ( target, 20, 188.35180664063, 2081.2719726563, 26.120576858521, 500, playervehicle ) outputChatBox ( "Warning! SAM collision iminent!", target, 255, 0, 0 ) end else if ( doesPlayerHaveJetpack ( target ) ) then createProjectile ( target, 20, 15.58650970459, 1719.0345458984, 26.134944915771, 500, target ) createProjectile ( target, 20, 237.6640625, 1696.4927978516, 26.089979171753, 500, target ) createProjectile ( target, 20, 354.64459228516, 2028.2109375, 26.094778060913, 500, target ) createProjectile ( target, 20, 188.35180664063, 2081.2719726563, 26.120576858521, 500, target ) outputChatBox ( "Warning! SAM collision iminent!", target, 255, 0, 0 ) end end end end addEventHandler ( "onClientColShapeHit", deathSphere, true )
-
it says addEventHandler ( "onClientColShapeHit", thePlayer, true ) that matches the thing. and the thing you said after that is gibberish to me.
-
hello again. sorry to ask aa question again so soon, but this is bugign the hell out of me. this script is supposed to create a collision sphere serverside and initiate rockets at clientside that lock on to an intruder in a jetpack or flying vehicle that is not a hunter or a hydra. however, all it does is give me the chatbox messages. other than that nothing happens. there are no errors either. can someone point me to the right direction? SERVERSIDE: function samOn ( thePlayer ) deathSphere = createColSphere ( 188.28005981445, 1941.6798095703, 17.673742294312, 100 ) outputChatBox ( "You have activated the Area 69 SAM sites", thePlayer, 255, 0, 0 ) end function samOff ( thePlayer ) destroyElement ( deathSphere ) outputChatBox ( "You have disabled the Area 69 SAM sites", thePlayer, 255, 0, 0 ) end addCommandHandler ( "samon", samOn ) addCommandHandler ( "samoff", samOff ) CLIENTSIDE: function onClientColShapeHit ( thePlayer, playervehicle, id ) playervehicle = getPlayerOccupiedVehicle ( thePlayer ) id = getVehicleID ( playervehicle ) if ( playervehicle ) then if ( id == 592 or id == 577 or id == 511 or id == 548 or id == 512 or id == 593 or id == 417 or id == 487 or id == 553 or id == 488 or id == 497 or id == 563 or id == 476 or id == 447 or id == 519 or id == 460 or id == 469 or id == 513 or id == 441 or id == 501 or id == 465 ) then createProjectile ( getLocalPlayer(), 20, 15.58650970459, 1719.0345458984, 26.134944915771, 500, playervehicle ) createProjectile ( getLocalPlayer(), 20, 237.6640625, 1696.4927978516, 26.089979171753, 500, playervehicle ) createProjectile ( getLocalPlayer(), 20, 354.64459228516, 2028.2109375, 26.094778060913, 500, playervehicle ) createProjectile ( getLocalPlayer(), 20, 188.35180664063, 2081.2719726563, 26.120576858521, 500, playervehicle ) outputChatBox ( "Warning! SAM collision iminent!", thePlayer, 255, 0, 0 ) end else if ( doesPlayerHaveJetpack ( thePlayer ) ) then createProjectile ( getLocalPlayer(), 20, 15.58650970459, 1719.0345458984, 26.134944915771, 500, thePlayer ) createProjectile ( getLocalPlayer(), 20, 237.6640625, 1696.4927978516, 26.089979171753, 500, thePlayer ) createProjectile ( getLocalPlayer(), 20, 354.64459228516, 2028.2109375, 26.094778060913, 500, thePlayer ) createProjectile ( getLocalPlayer(), 20, 188.35180664063, 2081.2719726563, 26.120576858521, 500, thePlayer ) outputChatBox ( "Warning! SAM collision iminent!", thePlayer, 255, 0, 0 ) end end end addEventHandler ( "onClientColShapeHit", thePlayer, true ) XML: <meta> <info author="MasterOfPuppets" description="Intruders go Kaboom" version="1" type="script" /> <script src="sam.lua" type="client" /> <script src="samserver.lua" type="server" /> </meta> any help is very appreciated
-
I got it working. since you guys were so kind i will shaw it with you. to jail a person, use /jail playername to free a person use /free playername (if you feel the need to jail yourself, to get out of it, use the console and type unjail yourname ) the noob gets warped to a SFPD jail cell and when freed, gets warped outside the LVPD HQ (yes, i know, the cities are different, but SFPD has better jail cells, and the reason that you are freed at LVPD is becasue that is close to the spawnpoint, you can change the script if you feel inclined to, i dont really mind. just dont claim this as your own) function jailPlayer(thePlayer, commandName, jailTarget) theNoob = getPlayerFromNick(jailTarget) if (theNoob) then setElementInterior ( theNoob, 10 ) setElementPosition (theNoob, 215.24324035645, 110.02223205566, 999.015625) setElementDimension ( theNoob, 10 ) toggleAllControls ( theNoob, false ) outputChatBox ( "You have been jailed", theNoob, 193, 13, 13 ) outputChatBox ( "You jailed a player", thePlayer, 193, 13, 13 ) else outputChatBox ("Error: This player doesn't exist", thePlayer, 193, 13, 13) end end function unJail (thePlayer, commandName, jailTarget) theNoob = getPlayerFromNick(jailTarget) if (theNoob) then setElementInterior ( theNoob, 0) setElementPosition (theNoob, 2290.2666015625, 2431.1103515625, 10.8203125) setElementDimension ( theNoob, 0 ) toggleAllControls (theNoob, true) outputChatBox ("You've been released, please behave next time", theNoob, 193, 13, 13) outputChatBox ("You released a player", thePlayer, 193, 13, 13) end end addCommandHandler("jail", jailPlayer) addCommandHandler("unjail", unJail ) cheers!
-
I am fancying the unjail instead of the timer myself, i had to pick a function to check ( the cursor, since there is no isPlayerJailed lol ) i am going to test this script real quick and see if it works. I appreciate the help guys.
-
i am trying to make a script that jails people for being noobs. i will let you know firsthand that x,y,z and interiornumber is something that i will figure out later, im too lazy to check now lol. i need to figure out how to make this syntax work. /jail playername. does anyone have any pointers? my aim is to have the person warped to a jail cell and released in two minutes. function jailPlayer ( thePlayer ) setElementInterior ( thePlayer, interiorNumber ) setElementPostion ( thePlayer, x, y, z ) toggleAllControls ( thePlayer, false ) showCursor ( thePlayer, true ) outputChatBox ( "You have been jailed and will be released in two minutes", thePlayer, 255, 0, 0 ) end function freePlayer ( thePlayer ) if isCursorShowing ( thePlayer, true ) then setElementPosition ( thePlayer, x, y, z ) setElementInterior ( thePlayer, 0 ) toggleAllControls ( thePlayer, true ) showCursor ( thePlayer, false ) outputChatBox ( "You have been released, behave next time", thePlayer, 255, 0, 0 ) end end addCommandHandler ( "jail", jailPlayer ) setTimer ( freePlayer, 120000, 0 )
-
well, it seems that it would make sense to do that, but it was giving me errors with basic things like "id == 123" which works on other stuff i make. this is no issue however, i already made a vehicle parking script in the past but i was just trying to make it more user friendly and let everyone use it. the current version doesnt work on boats and vehicles with big wheels like the monster ( game doesnt see them as on the ground ) and all the functions are command based therefore it is for admins only ( for things like parking a dangerous vehicle in area 69 ). you can look into it if you feel like it. im just saying dont feel obligated to fix my problems if you dont have to.
-
at first it says it needs a parenthese around setelementdata. i got rid of local then it said that if was not supposed to be there. i got rid of if and it said == was not supposed to be there. by then i got pissed and gave up. its like when i try to define a colSphere in another script. i do it like the wiki says and it doesnt work
-
i give up on it, i get a bunch of other errors when i fix one thing and its just giving me a headache
-
ugh, a different error now. it ways INFO: loading script failed park.lua:11: ")" expected near "," function publicPark ( thePlayer ) playervehicle = getPlayerOccupiedVehicle ( thePlayer ) playername = getVehicleOccupant ( playervehicle, 0 ) id = getVehicleID ( playervehicle ) if ( playervehicle ) then if id == 444 or id == 556 or id == 557 or id == 406 or id == 472 or id == 473 or id == 493 or id == 595 or id == 484 or id == 430 or id == 453 or id == 452 or id == 446 or id == 454 then setVehicleFrozen ( playervehicle, true ) setVehicleDamageProof ( playervehicle, true ) setVehicleOverrideLights ( playervehicle, 1 ) setVehicleEngineState ( playervehicle, false ) local setElementData ( playervehicle, "parkedby", playername ) outputChatBox ( "Vehicle Parked", thePlayer, 255, 0, 0 ) else if ( playervehicle ) then if isVehicleOnGround ( playervehicle ) then setVehicleFrozen ( playervehicle, true ) setVehicleDamageProof ( playervehicle, true ) setVehicleOverrideLights ( playervehicle, 1 ) setVehicleEngineState ( playervehicle, false ) local setElementData ( playervehicle, "parkedby", playername ) outputChatBox ( "Vehicle Parked", thePlayer, 255, 0, 0 ) end end end end end function playerExpel ( thePlayer ) playervehicle = getPlayerOccupiedVehicle ( thePlayer ) playername = getVehicleOccupant ( playervehicle, 0 ) if isVehicleFrozen ( playervehicle ) then if ( local getElementData ( playervehicle, "parkedby" ) == playername ) then setVehicleFrozen ( playervehicle, false ) setVehicleDamageProof ( playervehicle, false ) setVehicleOverrideLights ( playervehicle, 0 ) setVehicleEngineState ( playervehicle, true ) outputChatBox ( "Vehicle Started", thePlayer, 255, 0, 0 ) else removePlayerFromVehicle ( thePlayer ) outputChatBox ( "This is not your vehicle!", thePlayer, 255, 0, 0 ) end end end addCommandHandler ( "parkcar", publicPark ) addEventHandler ( "onVehicleEnter", getRootElement(), playerExpel )
-
function lockcar(thePlayer) playervehicle=getPlayerOccupiedVehicle(thePlayer); if(playervehicle) then if(isVehicleLocked(playervehicle)) then setVehicleLocked(playervehicle,false); outputChatBox("Vehicle Unlocked",thePlayer,255,0,0); else setVehicleLocked(playervehicle,true); outputChatBox("Vehicle Locked",thePlayer,255,0,0); end end end function exit(player,seat,jacked) if(isVehicleLocked(source)) then setVehicleLocked(source,false); outputChatBox("Vehicle Unlocked",player,255,0,0); end end addCommandHandler("lock",lockcar); addEventHandler("onVehicleExit",getRootElement(),exit);