Jump to content

Saml1er

Retired Staff
  • Posts

    1,058
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Saml1er

  1. function spawnVehs() for k, v in ipairs (getElementsByType("veh")) do to function spawnVehs() for k, v in ipairs (getElementsByType("veh",resourceRoot) ) do
  2. getElementsByType("vehicle",resourceRoot)
  3. unmuteTimer[player] = setTimer ( function (player) local timeLeft = tonumber ( getElementData ( player, "mt" ) ); ---- this line if ( timeLeft == 0 ) then killTimer(unmuteTimer[player]) outputDebugString ( "0 sec left" ); if ( getElementData ( player, "mute" ) ) then outputDebugString ( "is muted" ); setPlayerMuted ( player, false ); setElementData ( player, "mt", 0 ); setElementData ( player, "mute", false ); outputChatBox ( "Your time of being muted has expired.", player, 0, 255, 0 ); outputChatBox ( getPlayerName ( player ) .."'s mute has expired", root, 0, 255, 0 ); unmuteTimer[player] = nil; end else if ( getElementData ( player, "mute" ) ) then -------------- and this line setElementData ( player, "mt", timeLeft - 1 ); end end end, 1000, -1, player ); You must also add this: local quiter = function () if isTimer(unmuteTimer[source]) then killTimer(unmuteTimer[source]) unmuteTimer[source] = nil end end addEventHandler("onPlayerQuit", root, quiter)
  4. I actually copied this code from Anubav and I just found a typo there. Try this. local quiter = function () if isTimer(unmuteTimer[source]) then killTimer(unmuteTimer[source]) unmuteTimer[source] = nil end end addEventHandler("onPlayerQuit", root, quiter)
  5. Oh thanks, I was looking for something like this for my lobby script because players were able to open F8 console and chat. I had no idea how to disable it, once again thanks.
  6. They just don't know how it works. Whenever a resource starts the the event is triggered. I think they don't really care about script performance, they simply wanna make it work.
  7. Check your acl maybe you removed moderator or smod group.
  8. You are wrong here. root uses more cpu usage bzcaause it's sending message to all elements and resourceRoot will send message to elements within resource. resourceRoot is better.
  9. local quiter = function () if isTimer(unmuteTimer[source) then killTimer(unmuteTimer[source]) unmuteTimer[source] = nil end end addEventHandler("onPlayerQuit", root, quiter)
  10. Saml1er

    save problem

    addEventHandler ( "onPlayerSpawn", root, function () local theAccount = getPlayerAccount ( source ); -- weapon if not theAccount then return end local weapon0 = tonumber (getAccountData ( theAccount, "weapons.weapon0" ) ) or 0 -- ammo local ammo0 = tonumber (getAccountData ( theAccount, "weapons.ammo0" ) ) or 0 if not weapon0 or not ammo0 then return end[code][/code] -- give the weapons if ( weapon0 > 0 ) then giveWeapon ( source, weapon0, ammo0 ); end end );
  11. Bohat zyada waqiat hain. Agar aik aik ko pochna shorou kerloon thou shayad ye discussion ka topic arguements mein badhal jayega. Behtar hoga ke aise sawalat yaha nahee poocho.
  12. Not work! When the im removed the arguements on triggerServerEvent; Like this: local onMouseTable = {{personality, "personality", "Personality"}, {pistol, "pistol", "Pistol"}, {deagle, "deagle", "Deagle"}, {uzi, "uzi", "UZI"}, {shotgun, "shotgun", "Shotgun"}, {ak47, "ak47", "AK-47"}, {m4, "m4", "M4"}} function onClickSkill(btn, state, aX, aY) for k=1,#onMouseTable do local weap = onMouseTable[k][1] for i=1,#weap.image do if source == weap.image[i] or source == weap.label[i] then if lockedSkills(onMouseTable[k][2], onMouseTable[k][3], i) then triggerServerEvent("giveSkill", gMe) outputChatBox("Test 1", 255, 168, 0) end break end end end end Server-Side is give this error: ERROR: test\test_s.lua:3: attempt to index local 'skillCosts' (a nil value) addEvent("giveSkill", true) addEventHandler("giveSkill", getRootElement(), function(player, skillCosts, skillName, skillLevel, image) local amount = skillCosts[skillName][skillLevel][1] -- Line 3 local skillMoney = skillCosts[skillName][skillLevel][2] local skillStat = skillCosts[skillName][skillLevel][3] outputChatBox("Test 2", player, 255, 168, 0) if skillName == "personality" then outputChatBox("Test 3", player, 255, 168, 0) local spawnArmor = skillCosts[skillName][skillLevel][4] takePlayerMoney(player, skillMoney) setElementData(player, skillName, skillLevel) setPedStat(player, 24, skillStat) callClientFunction(player, "boughtSkill", image) end end) So triggerServerEvent is work. But i dont understand this problem. Pff Where is the problem? Just like I told you already use resourceRoot. Where is skillCosts defined?
  13. triggerServerEvent("giveSkill", resourceRoot,localPlayer, skillCosts, onMouseTable[k][2], i, weap.image[i]) local player as source uses more memory. If client and server files are within same resource then using resourceRoot is more efficient.
  14. A mgm for free. Forget it. There's ni way you can get something like that without paying someone.
  15. Omg no plz don't expose bonsai's secret
  16. Kuch khas nahi bas soch raha tha ke ye sub-forum band na hojaye.
  17. local runningSpeed = 5. -- you can modify this setWeaponProperty("m4","pro","move_speed",runningSpeed )
  18. Saml1er

    HS Rockets

    Attach an object ( diable the collisions of the object using setElementCollisionsEnabled(object,false) ) to the rocket that was launched. I'm not sure if this will help but you can try.
  19. Phir bhi sab apni marzi ke malik hain. Agar rules break kiye toh punish bho honge aur agar koi help scripting mein chahiye toh new topic banake post kerlo. Aur jitna sahi se explain keroge utha acha help milega
  20. Let me give you the answer: "/No"
  21. probably some other resource is running that is canceling onClientPlayerDamage évent.
  22. Functions are like variables ( talking about access ). If you add local before a function then you can't access it from another file even if it's the same resource. It's lua so doesn't matter if it's server or client side. It's the same for both.
  23. Saml1er

    exports :3

    Call fails because there is an error in the exported function. Show us the part where you defined those tables.
×
×
  • Create New...