Jump to content

IIYAMA

Moderators
  • Posts

    6,089
  • Joined

  • Last visited

  • Days Won

    216

Everything posted by IIYAMA

  1. I don't understand your question 100% Read this: https://wiki.multitheftauto.com/wiki/Ge ... antedLevel Normal a player starts without stars. When he did something wrong, he gets a star.... if that is what you mean.
  2. You can find the error your self. Login with admin and write /debugscript 3 You know nothing will happen when you have 1 star? if theWL > 1 then This means that is higher then 1. If the value is 1 nothing will happen, I hope you understand that. (use operator ==, means eagle) Open in notepad ++ to get a full vision of the code. local policeJobTeams = {["Policia"]=true,["SWAT"]=true,["FBI"]=true,["Ejercito"]=true} function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then --theSkin = getElementModel ( attacker ) -- when you don't use it, mark it as diabled. if attackerweapon == 3 and loss > 2 then if policeJobTeams[getTeamName( getPlayerTeam ( attacker ) )] then setElementPosition (source, 3306.1, 1195.7, 945, true) local theName = getPlayerName ( source ) local theCop = getPlayerName ( attacker ) warnText( "Has Sido Encarcelado Por "..theCop.. ".", source ) warnText( "Has Encarcelado a "..theName, attacker ) local playeraccount = getPlayerAccount ( attacker ) local oldArrest = getAccountData(playeraccount, "arrest") local newArrest -- you haven't used this boolean, but will I let it as it is. if oldArrest then newArrest = setAccountData(playeraccount, "arrest", tonumber(oldArrest) + 1 ) else newArrest = setAccountData(playeraccount, "arrest", 1 ) end local theWL = getPlayerWantedLevel ( source ) setPlayerWantedLevel (source, 0) if theWL == 1 then setTimer ( setElementPosition, 20000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 3000 * theWL ) elseif theWL == 2 then setTimer ( setElementPosition, 40000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 6000 * theWL ) elseif theWL == 3 then setTimer ( setElementPosition, 60000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 9000 * theWL ) elseif theWL == 4 then setTimer ( setElementPosition, 80000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 12000 * theWL ) elseif theWL == 5 then setTimer ( setElementPosition, 100000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 15000 * theWL ) elseif theWL == 6 then -- max level is 6........ setTimer ( setElementPosition, 120000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) givePlayerMoney (attacker, 18000 * theWL ) end end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob) Here you unfreeze a player with a timer without any reasons. setTimer ( setElementFrozen, 3000, 1, source, false) Something must freeze this player (if it did), but is isn't in this script.
  3. lol scripts or functions O_o
  4. These are functions, did you ever made your functions local? (like the sample from a both)
  5. "The only question that I have been asking my self, are local functions faster .?.?.?." then just a trigger,
  6. NOT tested..... local myFunctions = {} -- store the functions myFunctions[1]= function (player)--CreateX if player then outputChatBox(getPlayerName(player) .. ", executed: CreateX") else outputChatBox("CreateX") end end myFunctions[2]= function (player)--CreateY if player then outputChatBox(getPlayerName(player) .. ", executed: CreateY") else outputChatBox("CreateY") end end myFunctions[3]= function (player)--CreateZ if player then outputChatBox(getPlayerName(player) .. ", executed: CreateZ") else outputChatBox("CreateZ") end end addEventHandler("onResourceStart",resourceRoot, function () local number = math.random(1,#myFunctions) -- a random number from 1 t/m the amount of functions in the table. myFunctions[number]() end) addEventHandler("onPlayerDamage",root, -- random event....... function () myFunctions[math.random(1,#myFunctions) ](source) -- compressed. end)
  7. 0? is 0 wanted stars? If you want that to check then yes. (elseif) if theWL == 0 then elseif theWL == 1 then -- if [b]not[/b] theWL == 0 then ---------> elseif theWL == 1 then end
  8. if theWL == 1 then elseif theWL == 2 then elseif theWL == 3 then elseif theWL == 4 then elseif theWL == 5 then elseif theWL == 6 then end
  9. if the theWL is higher then 6 then the source(player) will be set 6 times to another locations. + 6 timers running onPlayerDamage. I don't know what the use of that is. if theWL == 1 then This script also is going to overhead your mysql lite data base.(account data) Better to store it in the ram and update it in amount of time. (you are using the event onPlayerDamage)
  10. Ze kunnen wel open zijn. Maar mensen moeten wel binnen de poorten range joinen. @ wesleywillems17 Het hoeft niet in een brief formaat (indeling van je vorige bericht) maar mag wel.
  11. dubbel op, hoeft ook weer niet. Ik heb hier al antwoord opgegeven.
  12. De bovenste poort kan je beter dicht laten en anders moet je zeker een wachtwoord op je server zetten. Plaatjes zijn onleesbaar. Mensen moeten connecten met het ip dat je van (http://www.mijnip.nl) krijgt. Probeer maar te testen en het is aan te raden om niet je ip hier zo maar op een forum neer te zetten.
  13. pls /debugscript 3 "object[source]" table does exist?
  14. XML maybe for client data, but not for server data.
  15. Well maybe you should mind the differences. -- why make a loop at clientside? You can't check other players their packetlossTotal at client side. for player, i in pairs --etc. -- server getNetworkStats(player) -- or player is nill for the server network. -- client getNetworkStats() - HD 7970 - CPU Type QuadCore Intel Core i7, 3700 MHz (37 x 100) (hyperthreading) - Module Name Corsair CML32GX3M4A1600C10 8 GB X 4 I am not laggy at all. Gta san is for that system a pathetic game. I am only play it, because I can modify it. But some people are playing at very weak pc's(especially laptops) . A little bit script performance would be welcome. I already told you that I use getTickCount()! I even use table(tickcount) timers to manage respawn from the players.
  16. pls copie correctly. addEventHandler ( "onPlayerQuit", root, function (quiteType)--onPlayerQuit local playeraccount = getPlayerAccount(source) if not isGuestAccount ( playeraccount) then setAccountData(playeraccount,"number",exports.bone_attach:getElementBoneAttachmentDetails(object[source]) ) end end) addEventHandler ( "onPlayerLogin", root, function ()--onPlayerLogin local playeraccount = getPlayerAccount(source) local playermoney = exports.bone_attach:isElementAttachedToBone(object[source]) local number = getAccountData(playeraccount,"number") if playermoney then end end)
  17. All players have an account, even the ones that did not login. but only people that aren't logged in do have a GuestAccount. (not login) if not isGuestAccount ( account ) then -- check if the player is logged in.
  18. Try this: addEventHandler("onClientPreRender",root, function () local element= getPedContactElement ( localPlayer ) if element and getElementType(element)== "vehicle" and getControlState ("fire") then setControlState ( "fire", false) end end)
  19. yep. https://wiki.multitheftauto.com/wiki/Ge ... actElement
  20. IIYAMA

    Object gravity

    Well there is something new: ( I haven't tried it yet) https://wiki.multitheftauto.com/wiki/SetObjectMass Maybe it helps, I don't think it will work with objects that can't be moved. You also can try: https://wiki.multitheftauto.com/wiki/MoveObject
  21. -- Only check your self. addEventHandler("onClientPlayerDamage", getLocalPlayer(), myFunction) addEventHandler("onClientPlayerDamage", localPlayer, myFunction) -- the same. localPlayer = getLocalPlayer() --Yes getLocalPlayer()/localPlayer is only client. -- Check every single player. addEventHandler("onClientPlayerDamage", getRootElement(), myFunction) addEventHandler("onClientPlayerDamage", root, myFunction) -- the same. root = getRootElement()
  22. You forgot the rotation. spawnPlayer(source,x,y,z+.5,0,tonumber(skin),0) spawnPlayer (thePlayer, x, y, z, rotation, skinID,interior ) Try this: function saveStats() local account = getPlayerAccount(source) if not isGuestAccount (account ) then local Skin = getElementModel(source) setAccountData (account,"CMG2.skin",tostring(Skin) ) local x,y,z = getElementPosition(source) setAccountData ( account, "CMG2.Xpos", x ) setAccountData ( account, "CMG2.Ypos", y ) setAccountData ( account, "CMG2.Zpos", z ) end end addEventHandler("onPlayerLogout",root,saveStats) addEventHandler("onPlayerQuit",root,saveStats) addEventHandler("onPlayerLogin",root, function ()--loadStats local account = getPlayerAccount(source) local skin = getAccountData (account,"CMG2.skin" ) local x,y,z = getAccountData ( account, "CMG2.Xpos" ),getAccountData ( account, "CMG2.Ypos" ),getAccountData ( account, "CMG2.Zpos" ) if x and y and z then spawnPlayer(source,x,y,z + 0.5,0,tonumber(skin) or 0,0) setCameraTarget(source) fadeCamera(source,true,2.5) else --spawnPlayer(source,0,0,999999) --setCameraTarget(source) --fadeCamera(source,true,2.5) end end)
×
×
  • Create New...