Jump to content

Danz

Members
  • Posts

    34
  • Joined

  • Last visited

About Danz

  • Birthday 22/05/2001

Details

  • Location
    Serbia

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Danz's Achievements

Rat

Rat (9/54)

0

Reputation

  1. local cam1 = createObject ( 1886,1592.1999511719,-1370.0999755859,34.299999237061, 10, 0, 0 ) function gotoCam1( ) local v = getPedOccupiedVehicle(localPlayer) if v and getElementModel(v) == 596 then --596 is Police LS, 597 SF and 598 LV setCameraMatrix ( 1592.1999511719,-1370.0999755859,34.299999237061, 1593.0999755859, -1397.3000488281, 27.799999237061,0,100 ) outputChatBox("Camera 01", 0, 255, 0) else outputChatBox ( 'You are not in a police car.', 255, 0, 0 ) return end end addCommandHandler ( 'cctv1', gotoCam1 ) Here you go, it should work.
  2. Danz

    Help

    You need to also set the Dimension of the Pickup check in your admin panel when you select yourself in what dimension you are, after that use setElementDimension
  3. anyway check my edited post, i've done what you asked
  4. Instead of being a "know-it-all" why don't you help him, give him an example of how to do what he requested when your "Scripting skill is 92%"? Anyway here, this should block all of the weapons you requested (Taken from the Wiki, i just added some more IDs) WeaponID = { [38] = true, --Minigun [35] = true, --Rocket Launcher [36] = true, --HS Rocker Launcher [24] = true, --Deagle [16] = true, --Grenade [27] = true, --Combat Shotgun [33] = true, --Country Rifle [29] = true, --MP5 [32] = true, --Tec9 [30] = true, --AK-47 } function blockWeaponsOnSwitch (previousWeaponID, currentWeaponID) if WeaponID[currentWeaponID] then toggleControl(source, "aim_weapon", false) toggleControl(source, "fire", false) else toggleControl(source, "aim_weapon", true) toggleControl(source, "fire", true) end end addEventHandler("onPlayerWeaponSwitch", root, blockWeaponsOnSwitch) Make sure to place this script in a SERVER-SIDE script/file I could not find a way to block vehicles, do you want to block vehicles from being spawned, or block them from being entered? i want then to only be spawned by admins. i want them enterable if they are spawned though. so basically i want a block on spawning them. and by the way thanks for the script. i add it in like any other resource right? server/mods/deathmatch/resources? Yes, but make sure that resource is Server-Sided in the meta.xml file EDIT: This should do the trick for you function restrictVehicleSpawn (player, command, id) local accountName = getAccountName(getPlayerAccount(player)) if not isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) then outputChatBox("This feature is restricted to Admins only", player, 255, 0, 0) else if not id or not tonumber(id) then outputChatBox("Usage: /createveh ") return false end local id = math.floor(tonumber(id)) --Yet these 2 IDs do not exist, i just used them so that you can spawn the vehicle ID: 400 and 611 if id and id > 399 and id < 612 then local x, y, z = getElementPosition(player) local _, _, rz = getElementRotation(player) vehicle = createVehicle(id, x, y, z, _, _, rz) setVehicleColor(vehicle, 255, 255, 255) warpPedIntoVehicle(player, vehicle) outputChatBox("You have created a "..getVehicleNameFromModel(id).." (ID: "..id..")", player, 0, 255, 0) else outputChatBox("Invalid ID Entered, use IDs from 400 to 611", player, 255, 0, 0) end end end addCommandHandler("createveh", restrictVehicleSpawn) function restrictVehicleEntering (player) local accountName = getAccountName(getPlayerAccount(player)) if not isElement(vehicle) then return end if not isObjectInACLGroup("user."..accountName, aclGetGroup("Admin")) then outputChatBox("You cannot enter this vehicle", player, 255, 0, 0) cancelEvent() end end addEventHandler("onVehicleStartEnter", root, restrictVehicleEntering)
  5. Client function enterveh () triggerServerEvent("check",localPlayer) txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), enterveh ) Server function permission (source) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then end end addEvent("check",true) addEventHandler("check",root,permission) Try this
  6. Instead of being a "know-it-all" why don't you help him, give him an example of how to do what he requested when your "Scripting skill is 92%"? Anyway here, this should block all of the weapons you requested (Taken from the Wiki, i just added some more IDs) WeaponID = { [38] = true, --Minigun [35] = true, --Rocket Launcher [36] = true, --HS Rocker Launcher [24] = true, --Deagle [16] = true, --Grenade [27] = true, --Combat Shotgun [33] = true, --Country Rifle [29] = true, --MP5 [32] = true, --Tec9 [30] = true, --AK-47 } function blockWeaponsOnSwitch (previousWeaponID, currentWeaponID) if WeaponID[currentWeaponID] then toggleControl(source, "aim_weapon", false) toggleControl(source, "fire", false) else toggleControl(source, "aim_weapon", true) toggleControl(source, "fire", true) end end addEventHandler("onPlayerWeaponSwitch", root, blockWeaponsOnSwitch) Make sure to place this script in a SERVER-SIDE script/file I could not find a way to block vehicles, do you want to block vehicles from being spawned, or block them from being entered?
  7. As far as i'm concerned you don't even need the Server-side event to give money, you can give money to the player client-side function panel() w = guiCreateWindow(x,y,w,h,"money",false) b =guiCreateButton(x,y,w,h,"moneyb", true, w) end function trigger () if source == b then givePlayerMoney(10000, localPlayer) end end addEventHandler("onClientGUIClick", guiRoot, trigger) If you have further problems than this, please post the full code
  8. is there any errors in the /debugscript 3?
  9. function rewardOnWasted ( ammo, attacker, weapon, bodypart ) if ( attacker ) then givePlayerMoney ( attacker, 5000 ) else return end end I haven't tested this as i cannot (because my local server doesn't have players)
  10. Danz

    I Need help

    What line is this error on? EDIT: It's line 90 in the code i posted, and the error occurs when i attempt to buy Speed AND Crack together Edited the main post, sorry if i confused you, 226 is the bugged line WITH THE GUI, but this code doesn't have the GUI so, sorry
  11. Danz

    I Need help

    I am attempting to make a drug system to release on the MTA Community but there are some bugs which i cannot for the life of me find, here is the code; When i attempt to buy Heroin and Weed it just doesn't do anything, when i attempt to buy Crack AND Speed, it just says in the debug, "attempt to compare number with nil", and when i buy Steroids and God, it works as it triggers the server-side event (even tho it is not added yet, but works), thank you if you can help me
  12. You should add to the Tables section, an example, how to use tables in a function or something similar i hope you get what i'm trying to say lol
  13. This has been driving me nuts for a long ass time, but the problem that i am facing now is that i'm trying to balance weapons, changing weapons' accuracy, damage etc. Here is the thing, is there a way to change Minigun's accuracy to the point where the your crosshair's size increases, here is an example, i am currently shooting the AK-47, the crosshair increases due to it's weak accuracy, and the bullets "follow" the crosshair making a circle thingy (That probably didn't make sense) but this is not the same case as i'm firing the minigun and the crosshair doesn't increase, AND EVEN IF i use setWeaponProperty("minigun", "pro", "accuracy", 0.4) it only increases the crosshairs size, but the bullets still are in the middle of the cross, they don't "form" a circle like the AK does, this is really hard to explain, but you think what i want, i want to decrease minigun's just like the AK. I see no functions that do this on the MTA Wiki, only thing i saw was setWeaponProperty and that does jack shit, sorry for this kind of behavior, but this is really pissing me off. All i want to know is that, are there any functions that support this?
  14. So i got bored and decided to create the simple Mystery bag script, the way this works is that the bag will spawn around San Andreas (I only made 4 locations in the table for testing purposes, you can always add more locations if you want to (Just press F8, write getpos and press Enter, copy and paste it into the table)) Get it, and you'll get the following rewards; -Random Amount of Health; -Random Amount of Armour; -A Random Gun, and a random amount of ammo for that gun; -A Random wad of cash. NOTE: You are allowed to edit this script to your liking, but please, keep the credits, Thank You. Upcoming Projects; -Hijack Vehicle thingy; (Status: Done) -Briefcase thingy. (Status: Not Yet Done) P.S: I know i was really inactive since my last uploaded resource, but i'll try to keep you updated, cheers! Link: https://community.multitheftauto.com/in ... s&id=11612 --------------------------------------------------------------------------------------------------------------------------------------------- Hijack Vehicle; As promised in my last resource's description https://community.multitheftauto.com/in ... p;id=11612 a "project" was promised which is the "Hijack Vehicle", the way THIS works is that a random vehicle will spawn around San Andreas (20 locations are given in the table), when you enter the vehicle a delivery point will be placed on your map as a little truck (10 delivery locations), you will get rewarded the following; -Just $50,000 ;D although you can add some more rewards to this, it's your choice since you're free to edit this NOTE: You are allowed to edit this script to your liking, but please keep the credits, Thank You! Link: https://community.multitheftauto.com/in ... s&id=11616
×
×
  • Create New...