-
Posts
1,803 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Citizen
-
The event is not added because you have an error in this script file so it couldn't be loaded or because you didn't add this script in the meta.xml
-
I didn't know that, that's why I asked him to use an output to see if the killer element was nil or if not, the type of this element. So yeah, now I know the killer is nil, then your solution is surely the best workaround I can imagine so far.
-
Not at all, you wanted him to do this code only once (then with onClientResourceStart) but in fact, he surely want it to be executed as many times the player will select a first/new arena.
-
Where did you see getPedMoveState was returning a table ?! It returns a string: if state == "sprint" or state == "walk" or state == "powerwalk" then Also, just wanted to say that this script is resolution dependent. 20 pixels won't be the same percentage of the screen height on all resolutions. The high resolution the player will have, the less the rectangle will shake (almost invisible on really high resolution). Same about X+500 and Y+270
-
Stolen? : o You mean when I download a script so steal? : O: O: O There is a difference between leaked and stolen code. A leaked code is the source code of something that shouldn't be available to the public. A stolen code is a source code that you found on the internet and you just copied and pasted. We sometimes help scripters with stolen code if we know they are getting better by really watching the wiki and if we see he learned the basis. And yeah, this is not your case, you are just stealing code and try to put them on your server without learning at all by creating a new topic on this forum almost twice a day. https://wiki.multitheftauto.com/wiki/Main_Page
-
Why so? if weapon == 19 then I haven't tested it either but I hope it works. I'm sorry but you can survive if the projectile just damage my vehicle but not enough to explode. Even if my car is on fire after that.
-
No. Because the player can switch between arenas. So put this code in a function and call it everytime the player choose/select an arena: function updateCanBeKnockedOffBike() local arena = getElementData(localPlayer, "Arena") if arena == "Stuntage" then setPedCanBeKnockedOffBike(localPlayer, false) else setPedCanBeKnockedOffBike(localPlayer, true) end end Has to be on the client side ofc.
-
They will work only if you aren't in the arena of the corresponding if statement. This code is totally fine. No it's worst because it's more dirty (duplicating code).
-
Haha no. You just have to translate it. It will be a good exercise for a beginner like you.
-
Don't steal code you can't even understand.
-
Harder to know if the driver has been killed by that shot ...
-
Of course you can, Solidsnake told you to use pairs instead of ipairs. Read this: http://www.luafaq.org/#T1.10 No that's not a copy of the marker at all, just a copy of it's reference. So you are destroying the same marker twice because the two references are pointing to the same marker ... And seriously, if more experienced developpers are telling you what's your script doing, just try to understand by reading carefully. Don't say they are wrong without testing it. You didn't even try ! I swear there is an error in debugscript 3 you didn't gave us that occurs at line 8. Regards, Citizen
-
Can you output the type of the killer from the event onPlayerWasted ? Want to see if it's somehing like "player" or "vehicle" or "boolean"
-
No problem, thank you for pointing this lack of precision on this argument out.
-
Made a typo, replace line 44 with this: setElementData(killer, "Reputation.points", kRPoints) Dunno how nor why I stopped to write the end of this line lol
-
I don't want to bypass what Solidsnake is trying to do but here is two hints: getElementsByType ( "player" ) returns a table that contains all players element on the server for index, value in ipairs ( myTable ) do end Is a lua loop that will iterate over myTable. For each loop (1 loop per value in the table) index will contain the position the loop is at in the table (1, 2, 3 ...) and value will contain the value and the position in the table. If it's the 3rd loop, then index = 3 and value will be the 3rd value in the list.
-
K, it took me a lot of time to understand your code since I just came in. First I just wanted to say that medkit3 and 4 are totally useless. As Solidsnake, there is no need to do a table numerical indexed ... And here is the problem. You are first doing this: if v == MedKit3[source] then so v and MedKit3[source] reference the same marker but you want to delete that marker twice: destroyElement(v) destroyElement(MedKit3[source]) So the 2nd call to destroyElement just fail since it's already destroyed so the script just stop there. Also, there is no need to set v to nil since it's a temp variable used by the loop. So just remove the lines 6-7 and 16-17 and it will work just fine.
-
You can use the diff feature: https://wiki.multitheftauto.com/index.p ... ldid=37750
-
EDIT: Oh just spoted a typo I did here: width-2 it's width*2 Try again with that fix above. Original post WTF ?! I really don't get the result you got. Try using dxDrawImage like Bonsai suggested to check something. If it's doing the same shitty corners, then we can't do it with the render target I guess, we will use a mask instead.
-
Sorry, was replying to your initial post. Hum you have to use an element data. Here is how I see it: if the player is hitted by a nightstick used by a cop then get the element data on source for the key "policeHits" or 0 add 1 to the hit count if the hit count >= 2 then --you can change the hit count here send him in jail else save the hit count in the element data in "policeHits" get the element data on source for the key "policeHitsTimer" if the timer ~= false and if the timer we got is a real timer then kill the timer end if set a timer to call a function that will reset the element data "policeHits" to 0 save that timer in the element data under the key "policeHitsTimer" end if end if
-
Really ?! how is that even possible ?! Some math with diff = 0 : alpha = fullAlpha - diff * (fullAlpha-minAlpha) / diffLimit alpha = 255 - 0 * (255-150) / 4 alpha = 255 - 0 * 105 / 4 alpha = 255 - 0 / 4 alpha = 255 - 0 alpha = 255 So the alpha should be 255 ! Please use an output or a dxDrawText to print the alpha value. I'm really curious of what the value could be.