Jump to content

Snaik

Members
  • Posts

    33
  • Joined

  • Last visited

Everything posted by Snaik

  1. Snaik

    Help me

    I never saw that event"onClientExplosion", let see what i can do then I created a safe zone, but grenades can explode inside it and i dont want that to happen ._.
  2. Snaik

    Help me

    Well.. Thanks for the info .
  3. Snaik

    Help me

    I want to cancel a grenade explode when it hits a marker. Is it possible? If yes then what should i do? Thanks in advance
  4. Snaik

    A question

    Thank you again .
  5. Snaik

    A question

    How do i get a variable from another resource ?
  6. This will open/close that gate only if the player is in the team called "police" : policegate = createObject(10184,-1631.4000244141,688.5,8.6999998092651,0,0,270) function policeo (thePlayer) local theTeam=getPlayerTeam(thePlayer) if theTeam then if getTeamName(theTeam)=="police" then moveObject ( policegate, 300, -1631.4000244141,688.5,13) end end end addCommandHandler("op",policeo) function policec (thePlayer) local theTeam=getPlayerTeam(thePlayer) if theTeam then if getTeamName(theTeam)=="police" then moveObject ( policegate, 300, -1631.4000244141,688.5,8.6999998092651) end end end addCommandHandler("cp",policec)
  7. Snaik

    Disabled CJ run

    Explain more please
  8. Snaik

    Disabled CJ run

    Well, toggleControl (thePlayer, "sprint", false ) will make the "thePlayer" not able to run
  9. Snaik

    Disabled CJ run

    Yes, you can use setControlState https://wiki.multitheftauto.com/wiki/SetControlState
  10. well i think it should work now cuz u said the team name is "Gen" not "gen" addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () local aTimer=setTimer ( genPayDay, 10000, 0 ) end ) function genPayDay() for i, player in ipairs(getElementsByType("player")) do local theTeam=getPlayerTeam(player) if theTeam then if getTeamName(theTeam)=="Gen" then outputChatBox ( "*------------ payday ------------", player, 0, 255, 0) outputChatBox ( "*text1", player, 0, 255, 0) outputChatBox ( "*text2", player, 0, 255, 0) outputChatBox ( "*text3", player, 0, 255, 0) givePlayerMoney ( player, 500 ) end end end end
  11. try this : (edited) addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function () local aTimer=setTimer ( genPayDay, 10000, 0 ) end ) function genPayDay() for i, player in ipairs(getElementsByType("player")) do local theTeam=getPlayerTeam(player) if theTeam then if getTeamName(theTeam)=="gen" then outputChatBox ( "*------------ payday ------------", player, 0, 255, 0) outputChatBox ( "*text1", player, 0, 255, 0) outputChatBox ( "*text2", player, 0, 255, 0) outputChatBox ( "*text3", player, 0, 255, 0) givePlayerMoney ( player, 500 ) end end end end
  12. I want to get a divided results to only show two numbers after the coma. how do i do that ? like : 9 divided by 7 = 1,28571429 i only want it to show "1,28". Sorry for asking too much questions .
  13. Snaik

    get

    Well, how do i use "get" function to get a setting but from another resource?
  14. I totaly forgot about it , so sorry.
  15. Alright, take a look at this zombie kill/death counter : exports.scoreboard:addScoreboardColumn('Zombie kills') exports.scoreboard:addScoreboardColumn('Zombie deaths') addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function (killer) addPlayerZombieKills(killer) givePlayerMoney(killer,25) end) function deathsByZombies(ammo,killer,weapon,bodypart) if (killer) then if (getElementData(killer, "zombie") == true) then addPlayerZombieDeaths(source) outputChatBox("Oh no, a zombie killed you..",source,255,0,0) end end end addEventHandler("onPlayerWasted",getRootElement(),deathsByZombies) function addPlayerZombieKills(killer) local account = getPlayerAccount(killer) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if not zombieKills then setAccountData(account,"Zombie kills",0) end setAccountData(account,"Zombie kills",tonumber(zombieKills)+1) end addEventHandler("onPlayerLogin",root, function () local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieKills = getAccountData(account,"Zombie kills") if zombieKills then setElementData(source,"Zombie kills",tostring(zombieKills)) else setElementData(source,"Zombie kills",0) end local zombieDeaths = getAccountData(account,"Zombie deaths") if zombieDeaths then setElementData(source,"Zombie deaths",tostring(zombieDeaths)) else setElementData(source,"Zombie deaths",0) end end) function addPlayerZombieDeaths(source) local account = getPlayerAccount(source) if isGuestAccount(account) then return end local zombieDeaths = getAccountData(account,"Zombie deaths") if not zombieDeaths then setAccountData(account,"Zombie deaths",0) end setAccountData(account,"Zombie deaths",tonumber(zombieDeaths)+1) end addEventHandler( "onZombieWasted", getRootElement(), function (killer) killerName = getPlayerName(killer) weapon = getPedWeapon(killer) wr, wg, wb = getPlayerNametagColor(killer) exports.killmessages:outputMessage ( {killerName,{"padding",width=3},{"icon",id=weapon or 0},{"padding",width=3},{"color",r=162,g=2,b=2},"Zombie"},getRootElement(),wr,wg,wb ) end) The problem is when i get killed by a zombie , the scorboard "zombie death"(killed by a zombie) doesn't show up that i got killed by a zombie, but it does when i reLogin. Any help ?
  16. Snaik

    Access denied

    Thank you. How do you launch a votemap from a script ?
  17. Snaik

    Access denied

    Well, i created a script and used the function "restartResource" in it, when i tested it i get a message(from console) that says : access denied @ "restartRecource" how can i fix that ?
  18. Snaik

    How ?

    Thanks for the great help man!
  19. Snaik

    How ?

    Sorry to be annoying but, how i can make zombies ignore me (don't attack me) ?
  20. Snaik

    How ?

    I want to loop trough every zombie in the server, how can i do that?
  21. Snaik

    Help

    Alright, i got that, thx alot.
×
×
  • Create New...