Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 16/02/22 in all areas

  1. That could be a solution as well. I don't know the way you made your script since you didn't post it. But I would say that with my example you wouldn't need to check spamming with the onPlayerCommand event, I think it would make things easier. Also, the timer in my example is not necessary, I thought you would like to add 2.5 seconds delay to destroy the object, for some reason. But yes, in my opinion, if you are using this table method it would make things much easier for you to handle. Here's a little bit simpler version without the 'delay' timer, you could test it to see the difference for yourself. local SMOKERS = {} function isPlayerSmoking(player) if SMOKERS[player] then return true end return false end function startSmoking(player) if isPlayerSmoking(player) then outputChatBox("You already have a cigarette.") return false end SMOKERS[player] = {} SMOKERS[player].cigarette = createObject(...) -- fill this with the correct data setPedAnimation(player, "-", "-",false,false,false,false) -- set anim to smoking, you have to correct this exports["pAttach"]:attach(SMOKERS[player].cigarette, player) -- some more stuff you have to do, fill the bone positions and more return true end function stopSmoking(player) if not isPlayerSmoking(player) then outputChatBox("You don't have a lit cigarette.") return false end setPedAnimation(player) exports["pAttach"]:detach(SMOKERS[player].cigarette, player) destroyElement(SMOKERS[player].cigarette) SMOKERS[player] = nil -- i don't think you need spam protection if you are using the table method, because the player can only start to smoke again if we set the table value of him to nil return true end Also, this way each player has their "own" cigarette. If you were using local variables for the object, and have 2 players, you couldn't destroy player 1's cigarette because the variable gets a new userdata value when you are creating the cigarette object for player 2. I hope I was understandable with my statements.? Note that I didn't test the script in game!
    1 point
  2. شوف الحين مسوي لوحة مسابقة اسئلة كل مرا تكتب سؤال واجابه بالادبت بوكس وتجاوب تاخد مال وبعدها وقت انشئ سؤال تاني اخد فلوس تاني اظن وصلت بس انا مسوي الـ nil وباخد مال مرا وحده وبس طيب مشكلتي انه وقت انشئ سؤال جديد مافيني اخد مال تاني كفوووووووو اخي سورس الله يعطيك الففف عافيه ??
    1 point
  3. Client addEventHandler("onClientGUIClick", adminproot, function() local qus = guiGetText( que ) -- ايديت السؤال local ansr = guiGetText( ans ) -- ايديت الاجابه local mmans = guiGetText( mans ) -- ايديت الجائزه if source == btn then -- حط اسم الزر حقك if qus == "" then outputChatBox( "#ff0000 Please Write The Question ! ", 0, 0, 0, true ) return end if ansr == "" then outputChatBox( "#ff0000 Please Write The Answer ! ", 0, 0, 0, true ) return end if mmans == "" then outputChatBox( "#ff0000 Please Write The Prize ! ", 0, 0, 0, true ) return end if string.len( qus ) > 0 and string.len( ansr ) > 0 and string.len( mmans ) > 0 and tonumber( mmans ) then triggerServerEvent( "onAsk", localPlayer, qus, ansr, mmans ) end end end ) Server sst = false ansr = nil mmans = 0 addEvent("onAsk", true) addEventHandler("onAsk", root, function( qus, ansr, mmans ) sst = true ans = ansr mans = mmans outputChatBox( "Question Is : [ ".. qus .." ] ", root, 255, 0, 0, true ) outputChatBox( "Prize Is [ ".. mans .." $ ] ", root, 255, 0, 0, true ) end ) addEventHandler("onPlayerChat", root, function( msg ) if sst == true then if msg == ans then givePlayerMoney( source, mans ) outputChatBox( " #6960EC# Player [ #00ff00".. getPlayerName( source ) .."#6960EC ] Win [ #00ff00".. mans .." $#6960EC ] And The Answer Was [#00ff00 ".. ans .."#6960EC ] ", root, 0, 0, 0, true ) sst = false ansr = nil mmans = 0 end end end )
    1 point
  4. Hi. This is my new model that I want to share with you. I hope you like it ?
    1 point
  5. RELEASE DATE POSTPONED TO : March 27! 2012 due to a minor bug.Stay tuned! *NOTE: THIS IS NOT A ZOMBIE GAMEMODE but ZOMBIES CAN BE FOUND IN LV MODAT ROLEPLAY 1.1 The script we are using is 100% made from scratch.This script was released on mta community last time but it was compiled, this time we going to release it without compiling it plus its a new version. This makes it so that you will find a lot of unique features.Some examples are our hunger system, Vehicle System, Factions, House system, Business System and a lot more. More information about the script is down below. The script is not the only thing that makes one of the best roleplay servers around Features: Dynamic House System Dynamic Business System Dynamic Building System Dynamic Gang HQ System Dynamic Faction Vehicles System Dynamic Vehicles System Dynamic Point System Dynamic Families System Dynamic Car Dealership Dynamic GPS System Realistic Fishing GPS System: Zombie Skils - Zombies can use a new skill every level up. - Factions - We have apocalyptic based faction. - Searching - We have a searching function you're able to search inside certain interiors for items and weapons. - Cities - We have 4 "safe cities" you're able to build up reputation to open the gates of the city to purchase weapons and items or roleplay inside of them. - Human Skills - We have certain skills you can base your character off of and build up your skills. Such as Aim skill, Luck Skill, and Mechanical Skill. - Mapping - We have over 40,000 objects. - Talent Skills - At registration you have a choice of 5 talents you may choose from. - Crafting - You may craft weapons and items from materials or wood you have gathered. - Mining - We have a mining skill that allows you to mine ores at the quarry. - Wood Cutting - We have a wood cutting skill that allows you to collect wood for craftable items. - Permanent Zombie - Players that break the rules, generally not knowing how to roleplay, or they come into the server with a non-rp name will be turned into a permanent zombie meaning they may not switch back to the human class. Clothing Accessories Hats,bandanas,masks,glasses Clothes Arcade Games,Pool Fast foods Command:/eat Casino Commands:/bet,/gamble,more soon Restaurant Just a restaurant Weapon Shop A little weapon shop with expensive stock. Cyber Caffe General cyber cafe RP area Electronic Shop Buy phone,phone things... Lock Shop Buy vehicle alarms,vehicle related things. Bank Just a bank! Lounge Caffes Caffe,bars,etc. Gym Faction List: Police Department US Marshalls Medical Departments Senate Weazel News Taxi Cab Company Kind Of Businesses: 24-7 Tools R Us Clothes Store Club Casino Restaurant Real Economy: Realistic Currency. Realistic Paycheck System Jobs: Detective Lawyer Whore Drug Dealer Mechanic Garbage Collector Weapon Crafting Boxer Drug Farmer Drug Smuggler Robber [being Remade - Unique System] Pizza Boy Stuntman [Exclusive to our script] Hacker [All New and Unique] More Jobs Coming Soon!
    0 points
×
×
  • Create New...