-
Posts
965 -
Joined
-
Last visited
Everything posted by DakiLLa
-
hehe, almost ^^. Well, guys, sry, my bad..i forgot to tell one serious thing I'm making my own mode where you must drive only in one side: to the north. And all checkpoints are located one by one in a row. Thats why i told only about the last checkpoint.. Soo..can anybody tell, why the image on a bar is in wrong place...?
-
uhm? what you mean? i need only the last checkpoint position, not the distance between them... well, i did as said Gamesnert, works perfect, but i got one problem: if i stay at the start point, the position of image on bar is incorrect..it must be in the bottom of line, but it isnt... and if im near finish, image is somewhere over the chat window... Screenshot is here And this is my code: local gMe = getLocalPlayer(); addEventHandler( 'onClientRender', getRootElement(), function () local x, y = guiGetScreenSize(); dxDrawLine( x/10, y/4, x/10, y/1.2, tocolor( 255, 255, 255, 255 ), 8.5 ); local myX, myY = getElementPosition( gMe ); local fiX, fiY = getElementPosition( getElementsByType( 'checkpoint' )[#getElementsByType( 'checkpoint' )] ); local stX, stY = getElementPosition( getElementsByType( 'spawnpoint' )[1] ); local distanceFromPlayerToFinish = getDistanceBetweenPoints2D( myX, myY, fiX, fiY ); local distanceFromStartToFinish = getDistanceBetweenPoints2D( stX, stY, fiX, fiY ); local positionOnBar = distanceFromPlayerToFinish/distanceFromStartToFinish*((y/1.2)-(y/4)); dxDrawImage( x/10, positionOnBar, x/40, y/32, 'images/dot.png', 0, 0, 0, tocolor( 255, 255, 255, 255 ) ); end ); I have taken a t-shirt image from Talidan's teammanager just for test ^^
-
oh, hehe, ok..ill try.. thx for the fast answering
-
uhm, what you mean about 'distanceFromPointToPoint'? Between which points?
-
Hello guys! i got one idea from my friend. I dont know, how to name this thing..but you can take a look on this picture (left side of picture, hehe, there is another images ^^). The line with dots (players) over it. I think you have seen something like this in another games. Not so bad idea for mta, isnt it? Well, i want to make something like that, but dont know, from what i should begin. Could be a nice replacement for a usual radar and also looks cool. I know only that i need to get position betwen player and finish but.. then how can i 'convert' (idk how to say..may be calculate) this value to the pixels of screen to let red dots move up or down over line. Any ideas? Thx for the replies!
-
in client side? there should be 'source' cse the source of your event is player for which was triggered event. local x, y, z = getElementPosition ( source ) But then you should trigger your event only for this player who starts engine of vehicle, so, ignore my previous post.
-
so, you want that those players who stays near car, heared an engine sound, right? then you need to trigger event for all players on server. i think line 14 should be: triggerClientEvent ( getRootElement(), "onCarStart", playerInCar ) well, as i can see on wiki, the first argument is optional, so you can leave it, or put there rootElement, like i did just for explanation, that this event will be triggered for all players
-
LoL! dude, its Mta, not samp. I cant understand, why people who playing samp, going to post on mta forums ...
-
function onPlayerJoin () if ( saveFile ) then local playerName = getClientName( source ) addEventHandler("onClientLogin", getRootElement(), onPlayerJoin) this should works
-
may be it should be: addEventHandler ( "onClientResourceStart", getResourceRootElement( getThisResource() ), pedLoad ) cse as i can see its client side...
-
try to use guiCreateScrollBar, instead of scrollPane i think scroll pane was not what you wanted.. well, i lil bit modified your script: local scX, scY = guiGetScreenSize(); wnd = guiCreateWindow( scX/2-644/2, scY/2-504/2, 644, 504, "Teleport Menu", false ); local scroll = guiCreateScrollBar( 0.05, 0.9, 0.9, 0.05, true, true, wnd ); look, i centralized position of window and reduced its resolution (that was too big window i think ). How i centralized it? I got client screen size, then i take half of it, and subtract the half of width and height of your window. Pretty easy maths, isnt it? Ive made a scroll bar at the bottom of the window..you can place it where you want on your window.. btw, you should use relative coordinates of placement of element you want attach to a window. In your case it was wrong, it was like non-attached element, so you would have two different gui elements instead of one window with attached scroll bar
-
will fail, cse of 'getRootElement', it should be with brackets () getRootElement()
-
pft, i just copied his code, changed something in one place, but forgot to change it in another...
-
What does the third line mean? in your case it means nothing. I think you wanted to check team name, then you should use 'getTeamName' The next code should works: function setPlayerBlipColor() local playerTeam = getPlayerTeam ( source ) if playerTeam then local teamName = getTeamName( playerTeam ) if teamName == "Police" then setPlayerBlipColor ( source, 0, 0, 255 ) --you missed 'source' in your code here, ive added it end end end addEventHandler ( "onPlayerSpawn", getRootElement(), setPlayerBlipColor )
-
#7: i think that Emmet is a 'special' charachter, like Ryder or Sweet etc., and he has non working ID Notes on wiki page
-
well..i think that was a bad idea to upload it.. but i didnt write that "I have made this script" anyway, this theme is closed.
-
https://community.multitheftauto.com/index.php?p= ... ils&id=353 you can take a look on this...
-
i think he just saw the same feature on simbad's server.. as i remember, admins can create their own missions there
-
lol that was fun as always
-
nice, this thing is what i have waited for a lot of time ! thx! btw, is this a final version ?
-
cool! ill get rid of notepad++ immediately when this thing will be released! Good job
-
1) lol i forgot again to add this line >.< 2) so, it should be addEventHandler( "onClientGUIClick", yourButton, function () triggerServerEvent( "fixMyVehicle", getLocalPlayer() ) end , false ) and.. can you explain in details, why i should use 'false' if event is attached? cse i cant understand what wiki says about it :\ (its an offtopic i think..)
-
dorf, idk what you have done in your code, but i think it should be like next: client side: addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), function () --your code with your button-- addEventHandler( "onClientGUIClick", yourButton, function () triggerServerEvent( "fixMyVehicle", getLocalPlayer() ) end ) end ) server-side: addEvent( "fixMyVehicle", true ) function fix() local vehicle = getPlayerOccupiedVehicle( source ) if vehicle then local money = getPlayerMoney( source ) if money >= 200 then fixVehicle( vehicle ) else outputChatBox( "You dont have enough money!", source, 255, 0, 0 ) end end end addEventHandler( "fixMyVehicle", getRootElement(), fix )
-
ahh, ye, thats my usual mistake i always forget to add this line
-
local money = getPlayerMoney( player ) if money >= 200 then fixVehicle( vehicle ) else outputChatBox( "You need 200$ to repair your car", player, 255, 0, 0 ) end something like this...