-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
well i dont see your nametag anyway.
-
1. what is the end at line 9? 2. there is a ~= operator, you know (if thePlayer ~= localPlayer then) 3. why you do return if its not a local player anyway? nevermind that, i misread the post. PS: and since there is a predefined variable localPlayer, it's better to use it, than call getLocalPlayer() function every time. --WANTED LEVEL if thePlayer == localPlayer then -- do the following only if player is local player local level = getPlayerWantedLevel(thePlayer) if level >= 1 then -- should be 1 here for i=1,level do dxDrawImage ( X - 33.5+8*i, Y - 46, 10, 10, 'star.png', 0, 0, 0 ) end end end
-
пример есть тут: https://wiki.multitheftauto.com/wiki/IsGuestAccount
-
-- пример: function joinEventHandlerFunction() -- функция, которая обрабатывает эвент onPlayerJoin -- внутри этой функции "source" будет содержать источник эвента -- в данном случае источник - игрок, зашедший на сервер: outputChatBox(getPlayerName(source) .. " has joined our awesum serbar!") end addEventHandler("onPlayerJoin", root, joinEventHandlerFunction)
-
из них "константа" (и то не константа, а предопределенная переменная) только source. source в функциях-обработчиках событий содержит элемент-источник события. остальное просто названия переменных от балды. а популярность именно таких названий обычно обусловлена тем, что "в вики так написано в примере кода".
-
внимательно читаем вики triggerClientEvent: Almost any data types can be passed as expected, including elements and complex nested tables. Non-element MTA data types like xmlNodes or resource pointers will not be able to be passed as they do not necessarily have a valid representation on the client.
-
you need to check if the element that hit the marker is the local player: marker2 = createMarker(2797.5, -1465.6, 19.218, "cylinder", 1.1, 255, 255, 225, 255) function m2(hitplayer) if hitplayer == localPlayer then playSound("soundshop/hi.mp3") end end addEventHandler("onClientMarkerHit", marker2, m2)
-
click playSound in your script and read wiki page about playSound function.
-
suggestion: isObjectInACLGroup, hasObjectPermissionTo
-
if you dont want to learn yourself and want people to "answer with lua codes", you should ask with money.
-
press F8 and type "debugscript 3" and doing this: setElementInterior ( hitPlayer, bgcenter, 1888.3000488281,-2623.1999511719,481.89999389648 ) is not helping, ^Dev-PoinT^ doesnt know even the basics of scripting. this is just random shit (passing a bgcenter function as an interior ID, really?)
-
actually it will error with "attempt to concatenate boolean", since the element data contains true, and not a team name. Team = createTeam( "Police", 0, 0, 255 ) addCommandHandler( "duty", function( thePlayer, cmd ) setElementData( thePlayer, "SubTeam", "Sheriff" ) setPlayerTeam( thePlayer, Team ) end ) addCommandHandler( "check", function( thePlayer, cmd ) local SubTeam = getElementData( thePlayer, "SubTeam" ) or "None" local MainTeam = getTeamName( getPlayerTeam( thePlayer ) ) outputChatBox( "Your Mainteam is: "..MainTeam..", and your Subteam is: "..SubTeam..".", thePlayer, 0, 0, 255 ) end )
-
i weep at the degradation of the scripting section.
-
because account is not an element
-
goddamit, this is not about who's the author of this particular script. but about the whole situation with people (without even basic scripting knowledge) making "frankenstein" scripts from copy-pasted parts, posting them here and asking "i wrote this script dont works how fix me thx". it's sad. you won't learn by copy-pasting.
-
for the last time: this is not your script, not a single line here is yours, not even these: if curBarLen < 20 then dxDrawImage(crackX, crackY, crackW, crackH, "crack1.png", crackR, 0, 0, white, false) end which are all you've "added" to draw crack1.png image. but it doesn't work because you didn't even bother to change/define the variables used. and no. this is not my script. and my "edits" doesn't make me the author. if community was up i'd find the original to show it to you. alas.
-
DDC doesn't even use this speedometer for a long time already. but even when it was there, it was never compiled and the author in meta.xml was left intact. i just don't get it, how can you copy one line of code and lose the others needed for that line to work.
-
ok let me tell you something. 1. this script is probably the oldest public (if not the first) one used to draw a speedometer with rotating image as a needle. i can't rememebr who's the author. (though it says author="d0c" in my meta.xml, i believe that's the guy). if you change few numbers here and there — it doesn't make you legally the author. 2. "crack" showing on the screen was added by me for the first DDC speedometer (and it was popping up on community with images changed a few times). guess why the image is called crack1.png? because there should be more cracks, but i didn't make them. i didn't release it because it was a minor edit and i'm not the author. but other people (like you) think its fine to take it, change images and/or few lines and put on community as your own. above said, you're not the author of a single thing here. and it doesn't work because your script is missing some globals needed for crack image positioning. you would've noticed that yourself if you'd know how to script/debug. because people don't just put in a line full of variables that are never defined anywhere and then ask about it on forums. that's the main symptom of a copy-paste disorder.
-
ok people wrap it up, this is not the place. topic locked. anyone who wishes to script, feel free to PM FrankBlack.
-
i bet it's all "top-secret-ultra-original-closed-source-code" there, but still: single line of code is pretty much useless for people to try and figure what is going wrong in your case. also do you have any idea of how database works? right now you're inserting a row every time. if your "name" column is not unique, you'll end up with several records with the same name.
-
stop fixing scripts for someone who doesnt want to learn. he just dump the random shit on you and you people fix it for him. this guy will never learn anything.
