-
Posts
1,803 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Citizen
-
It's set the size of a 'rectangle' ( the bounding box ). This 'rectangle' is needed if you want to use this arguments: And if you want to center the text to the middle, left or right of this 'rectangle'. I think you don't want to use it so you can use sxx and syy.
-
yeah but you can use guiStaticImageLoadImage or guiSetPosition or guiSetSize etc, so it's not really 'static' like you said. For me, it's just the problem of the nos with the GUI system that the dx system doesn't have
-
So if you ask a sytem to respawn the player to the nearest hospital ( like the single ) use this ( I just finished to make it ) spawnsHospitals = {{X,Y,Z,RZ}} spawnsHospitals[1] = {X=1177.4658203125,Y=-1323.8505859375,Z=14.072093963623,RZ=272.34698486328} spawnsHospitals[2] = {X=2033.337890625,Y=-1415.2353515625,Z=16.9921875,RZ=136.29571533203} spawnsHospitals[3] = {X=-2660.431640625,Y=633.8486328125,Z=14.453125,RZ=181.82925415039} spawnsHospitals[4] = {X=1578.947265625,Y=1768.3779296875,Z=10.8203125,RZ=93.712066650391} spawnsHospitals[5] = {X=1876.330078125,Y=2237.36328125,Z=11.125,RZ=5.7651672363281} spawnsHospitals[6] = {X=1244.9228515625,Y=332.85546875,Z=19.5546875,RZ=339.0514831543} spawnsHospitals[7] = {X=-321.7744140625,Y=1057.1728515625,Z=19.7421875,RZ=310.25588989258} spawnsHospitals[8] = {X=-1514.6015625,Y=2525.173828125,Z=55.780910491943,RZ=4.556640625} function playerKilled( ) setTimer( respawnToNearestHospital, 5000, 1, source ) end addEventHandler("onPlayerWasted", getRootElement(), playerKilled ) function respawnToNearestHospital( thePlayer ) local x, y, z = getElementPosition( thePlayer ) tableDist = {{index,dist}} for k,i in ipairs ( spawnsHospitals ) do local x2 = spawnsHospitals[k]["X"] local y2 = spawnsHospitals[k]["Y"] local dis = getDistanceBetweenPoints2D( x, y, x2, y2 ) tableDist[k] = {index=k,dist=dis} end local goodK = -1 for l,j in ipairs( tableDist ) do if ( l == 1 ) then goodK = 1 else local DIST1 = tableDist[goodK]["dist"] local DIST2 = tableDist[l]["dist"] if ( DIST2 < DIST1 ) then goodK = l end end end if ( goodK == -1 ) then return end spawnPlayer( thePlayer, spawnsHospitals[goodK]["X"], spawnsHospitals[goodK]["Y"], spawnsHospitals[goodK]["Z"] ) setPedRotation( thePlayer, spawnsHospitals[goodK]["RZ"] ) end I already tested it and it works very well !
-
the sxx-50 don't have the same effect in 800*600 and in1024*768 You have to convert the absolute position x, y to a relative position, then convert the relative position to the absolute position ( but for the player screen size ) drawColor ? ( custom function ? ) drawColor("#2EFE2EEG #FFFFFF24/7 RACE DD/DM", (754/1024)*sxx-50, (228/768)*syy-210, (732/1024)*sxx, (258/768)*syy, tocolor(0,0,0,255), (sxx/1024)*0.8, "bankgothic") As you can see, the blue is not at the good place ! All positions modifications need to be before the relative conversion ( like this ): (754-50/1024)*sxx => (704/1024)*sxx (228-210/768)*syy => (18/768)*sxx I supposed that in in 1024*768 the text is at the good place so try whit this. (It's more easy with colors isn't it ? )
-
Yeah you have to use your real ip ! You can find it here => http://www.monip.org/
-
I really understand this guy like this other post
-
What do you mean ?
-
I will make a system that the player can choose an interface and all peoples can make his own CDX.png ( it's the name of CGUI.png in my resource ) Yes ! Every DD/Race server want it because when you use the GUI system and you spectate another player, when this player starts the nos, the GUI disappears from the screen ! Do the test. So for the 1st release, it will make exactly the same than the GUI system but all servers can replace the CDX.png by his own CDX.png. Do you understand ? ( Sorry for my poor english )
-
No problem ( the default color is white so 255, 255, 255 instead of 0, 0, 0 )
-
dxDrawImage( 0, 0, 960, 540, "./ressources/gfx/hud.bmp", 0, 0, 0, tocolor ( 255, 255, 255, 125 ) ) -- 127 is the alpha ( 50% )
-
Download Notepad++ and create a new file, try this and then just save as ... Lua Source File (*.lua)
-
Nice vEnom This is the list of functions/events that I have scripted (since last week ): element dxCreateStaticImage ( float x, float y, float width, float height, string path, bool relative, [element parent = nil] ) bool dxSetPosition ( element dxElement, float x, float y, bool relative ) float, float dxGetPosition ( element dxElement, bool relative ) bool dxSetSize ( element dxElement, float width, float height, bool relative ) float, float dxGetSize ( element dxElement, bool relative ) bool dxStaticImageLoadImage ( element dxElement, string filename ) string dxGetStaticImage( element dxElement ) -- return the filepath bool dxGetVisible ( element dxElement ) bool dxSetVisible ( element dxElement, bool state ) bool dxSetAlpha ( element dxelement, float alpha ) int dxGetAlpha ( element dxElement ) onClientDXClick => Parameters: string button, string state, int absoluteX, int absoluteY onClientDXDoubleClick => Parameters: string button, string state, int absoluteX, int absoluteY ( only "up" is send for the state ) The parent and the relative system works. Now I will make the window, button, edit, checkboxes etc with the CGUI.png (all images used by the gui system is in this pictures ) The goal: to make the same system than the gui with the same design, functions and events => just replace 'gui' by 'dx' and 'GUI' by 'DX' and it will works !
-
Do you use 127.0.0.1 or localhost when you join your server ? Use your ip ( you cand find it here http://www.monip.org/ ) mmm I don't know why sorry.
-
Hi, I making a resource to convert every gui functions in directX functions. Exemple: -- FUNCTIONS: dxCreateStaticImage( x, y, sx, sy, path, relative, parent ) dxSetPosition( dxElement, x, y , relative) dxGetPosition( dxElement, relative ) dxSetSize( dxElement, sx, sy , relative) dxGetSize( dxElement, relative ) -- EVENTS: onClientDXClick I start to create this system last week. At this time, all functions and the event works ( and the parent/children system too ). I will upload my resource on the community when the basics gui functions are done for the 1st version then I will add other functions from the gui system. But the tabs and the scoll system will be very hard To change all your gui's in directX => replace all 'gui' by 'dx'
-
Hi, Try to delete de ; at the end.
-
I can't understand you, you want that this bot follow you but he attacks you instead ??
-
Sorry but I can't understand you Please show the code here and tell us what's the problem. Thanks in advance
-
Or try this great resource https://community.multitheftauto.com/index.php?p=resources&s=details&id=461
-
Can you give us the full client-side please ? Because there are a lot of parts everywhere. Thanks in advance
-
In TXD Workshop: You have to edit the cj_house.txd ( I didn't found it ) like you want then save it. Then export the cj_house.txd to your server folder. After that, you have to find the model_id of the cj's house ( you can find it in MED application but it don't work on windows 7 if I'm right ). Then you can load it like the exemple in the Wiki
-
CODE EDITED: I had badly understood
-
Because clientGet function doesn't exist
-
Mmm it's what I made not ?
-
Maybe this ? ( uncomment the correct line ): CODE EDITED: Use isVehicleOnGround in client-side local playerVehicleTimer = { } local playerCaught = { } local maxSpeedList = { 160, -- Landstalker (and so on and on and on in a proper order) } function detectSpeedMod(thePlayer) if isElement(thePlayer) then if (playerCaught[thePlayer] == false) then local theVehicle = getPedOccupiedVehicle(thePlayer) if (theVehicle == false) then playerCaught[thePlayer] = false if (playerVehicleTimer[source] ~= false and playerVehicleTimer[source] ~= nil) then killTimer(playerVehicleTimer[thePlayer]) end playerVehicleTimer[thePlayer] = nil return end local id = getElementModel(theVehicle) local speedX, speedY, speedZ = getElementVelocity(theVehicle) local actualSpeed = math.floor(((speedX ^ 2 + speedY ^ 2 + speedZ ^ 2) ^ (0.5)) * 100 * 1.61) if ( not IsVehicleOnGround( theVehicle ) ) then return end local i = (id - 399) local percentage = math.floor(((actualSpeed * 100) / maxSpeedList[i]) - 100) if (percentage >= 21) then -- The player is using speedmod or has a modified handling.cfg. -- We report it. triggerEvent("reportToStaffLog", getRootElement(), thePlayer, "Speedmod / Modified handling", getVehicleName(theVehicle) .. " (+" .. tostring(percentage) .. "%)") playerCaught[thePlayer] = true return end playerVehicleTimer[thePlayer] = setTimer(detectSpeedMod, 5000, 1, thePlayer) end end end
-
Salut Black Kite, Alors pour les serveurs RP, t'as celui de dragonofdark mais apparemment il utilise un GM tout fait ( Paradise ) qui est anglais à la base, mais d'après ce qu'il a dit, c'est un semi-RP. Après tu as peut être le server de Benox.exe mais je ne crois pas que ce soit un RPG. Ou alors tu attends notre server ( Famas et moi-même ) scripté de A à Z depuis Novembre 2009 qui ouvre ses portes au mois de juillet