K4stic Posted February 16, 2013 Share Posted February 16, 2013 (edited) i hope this Video help you enough Guys sorry because i forgot add info then i making it i add it at last moment so i give you link of code in this tut with all info => http://pastebin.com/M181Tbf5 Edited February 18, 2013 by Guest Link to comment
Anderl Posted February 16, 2013 Share Posted February 16, 2013 Simply showing yourself creating such simple scripts doesn't help at all, begginers won't understand it. Link to comment
K4stic Posted February 17, 2013 Author Share Posted February 17, 2013 ye i just just forgot add info i add it at finnish that because in youtube i post and link of code Link to comment
Baseplate Posted February 19, 2013 Share Posted February 19, 2013 addCommandHandler('kill', function ( player ) setTimer(killPed,5000,1, player) -- then player type /kill timer start and he must wait 5 seconds to die setElementFrozen( player, true) -- freeze player outputChatBox(" You'll die in 5 seconds!", player, 255, 255, 255, false) end ) function unfroze(player) serElementFrozen( player, false) -- unfroze player after spawn end addEventHandler("onPlayerRespawn", player, unfroze) Give credits to their real owners, the last part won't work and you got it from Scripting subforums Link to comment
K4stic Posted February 19, 2013 Author Share Posted February 19, 2013 NO is easy and simple script because i'm try be better scripter why other's need say me stealer -.-" Link to comment
Baseplate Posted February 20, 2013 Share Posted February 20, 2013 It won't work addCommandHandler('kill', function ( player ) setTimer(killPed,5000,1, player) -- then player type /kill timer start and he must wait 5 seconds to die setElementFrozen( player, true) -- freeze player outputChatBox(" You'll die in 5 seconds!", player, 255, 255, 255, false) end ) function unfroze() setElementFrozen( source, false) end addEventHandler("onPlayerSpawn", root, unfroze) Link to comment
K4stic Posted February 20, 2013 Author Share Posted February 20, 2013 just test it -.- Link to comment
PaiN^ Posted March 2, 2013 Share Posted March 2, 2013 You typed ser instead of set at line 13 .. Link to comment
bradio10 Posted March 4, 2013 Share Posted March 4, 2013 Nice, I really like these scripts. Simple and quite easy to make. Thanks. The first 2 work fine. A few errors, but most of them still worked. I wasn't able to test the 3rd one because I didn't have a friend with me. Also, with the drop wep script, I found it really annoying because when it creates, it creates right where you are, so I modified it so it creates 3 steps in front of you. function drop( player, cmd, amount) local x,y,z = getElementPosition( player) -- Get player pozition local weapon = getPedWeapon( player ) -- get player weapon local ammo = getPedTotalAmmo( player ) -- get amount of ammo who you have local amount = tonumber(amount) -- get the amount if ammo > amount then -- it look's if player have more ammo of that who he won drop takeWeapon( player, weapon, amount) --take's the ammo for player to create pickup setElementID(createPickup(x,y+3,z,2,weapon,5000,amount),"weaponpickup") -- create's pickup with element id outputChatBox(" You have Droped "..amount.." Ammo for weapon : "..getWeaponNameFromID(weapid).."", player, 200, 100, 0, true) else outputChatBox(" You Don't Have enough Ammo in that weapon to Drop", player, 255, 0, 0, true) end end addCommandHandler("drop",drop) addEventHandler("onPickupHit", root, function ( player ) if getElementID ( source ) == "weaponpickup" then local weapid = getPickupWeapon ( source ) -- get the weapon id after hit on pickup local wepammo = getPickupAmmo ( source ) -- get the weapon ammo after hit on pickup setTimer(destroyElement,50,1,source) -- destroy the pickup after hit outputChatBox(" You pickedup "..wepammo.." Ammo for Weapon ID: "..getWeaponNameFromID(weapid).."", player, 200, 100, 0, true) end end) FYI, the modification was made here: setElementID(createPickup(x,y+3,z,2,weapon,5000,amount),"weaponpickup") -- create's pickup with element id So as you can see, I just added +3 to the y co-ordinate. Also, the outputChatBox where it says how much you have dropped to the player who has dropped the ammo. That didn't work. So I fixed it and here is the fix. outputChatBox(" You have Droped "..amount.." Ammo for weapon : "..getWeaponNameFromID(weapon).."", player, 200, 100, 0, true) The problem was, where I have put weapon in getWeaponNameFromID, you put weapid which is in the next function. Where as in this function, it was named weapon. Thanks and good work. Link to comment
K4stic Posted March 4, 2013 Author Share Posted March 4, 2013 realy thx and thx for report bugs code fixed: http://pastebin.com/M181Tbf5 Link to comment
Recommended Posts