-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
No not showcol, that is just for custom cols. These are the functions you probably need to use: https://wiki.multitheftauto.com/wiki/DxDrawLine3D https://wiki.multitheftauto.com/wiki/Ge ... oundingBox
-
It is more that I already created some stuff. - Gamemode, anti control binding, animations. - Anti lagg, server damage and controlling player sync's - Vehicle weapons. But they can conflict each other and now I try to minimize that. Problem solved by exporting animation progress from script to script.
-
Yes possible I was also thinking about that, but I don't want to damage my very stable data management of my gamemode. It hurts me every time when elementdata is a answer on a question while designing a lagg free gamemode, you know what I mean? I have seen what elementdata did to some servers and I don't get happy about it. Like as sample the server mini missions, I have no idea how much they use it, but I get the feeling that it is a lot. Teleporting players all the time. -_-"
-
ok, to bad. thanks for the replies.
-
How can I check if a player doing an animation. With server side, without triggering, because I need to know it at that moment. -- client https://wiki.multitheftauto.com/wiki/GetPedAnimation
-
This is why:
-
indeed, you should not post the whole script. I also don't post my scripts, only help with some mta tricks to improve the performance of the code. But you can't expect from somebody, that he can fix something that isn't in the posted script.
-
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.
-
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.
-
Zie pm.
-
now you got both
-
lol scripts or functions O_o
-
These are functions, did you ever made your functions local? (like the sample from a both)
-
"The only question that I have been asking my self, are local functions faster .?.?.?." then just a trigger,
-
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)
-
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
-
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
-
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)
-
ok, vanavond.
-
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.
-
dubbel op, hoeft ook weer niet. Ik heb hier al antwoord opgegeven.
-
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.
-
pls /debugscript 3 "object[source]" table does exist?
-
XML maybe for client data, but not for server data.
