-
Posts
74 -
Joined
-
Last visited
Details
-
Gang
HoBoS
-
Location
Brazil
|H|TiTanium's Achievements

Transformer (11/54)
0
Reputation
-
It wasn't working, then I tried deleting some spaces between functions and parentheses, and now it works perfectly. Thank you for helping me.
-
Basically when a player presses the "myButton2" button, the three edit boxes should output player's position. Like this: I click on "myButton2" ( which says "Get Pos" ), then the first edit box shows my X cord. the 2nd shows my Y cord, and 3rd shows Z position. Tell me what is wrong please and help me please. function tele() local x = guiGetText ( myEdit2 ) local y = guiGetText ( myEdit3 ) local z = guiGetText ( myEdit4 ) getElementPosition ( localplayer, x, y, z ) guiSetText ( myEdit2, x ) guiSetText ( myEdit3, y ) guiSetText ( myEdit4, z ) end addEventHandler ( "onClientGUIClick", myButton2, tele, false )
-
Basically this thing doesn't work : Probably I'm forgetting something, so this is what I got, and stil the same, Nothing works, no rectangle, and not even ped's health. Client: local x, y = guiGetScreenSize() local tigre1 = nil addEventHandler("onClientRender",getRootElement(), function () if ( isElement ( tigre1 ) ) then local mx, my, mz = getElementPosition(tigre1) local mcx, mcy, mcz = getCameraMatrix() if isLineOfSightClear ( mcx , mcy, mcz, mx, my, mz, true, false, false, true, false, true, false, getLocalPlayer ( )) then local x1,y1,z1 = getElementPosition (getLocalPlayer()) local x2,y2,z2 = getElementPosition (tigre1) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto < 75 then local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+1.45 ) if sx and sy then if y/102-visibleto/5 > 0 then dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14-visibleto,y/146.3-visibleto/10, tocolor(0,0,0,245) ) if getElementHealth(tigre1) > 1 then dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14*getElementHealth(tigre1)/100-visibleto,y/146.3-visibleto/10, tocolor(190,0,0,245) ) end end end end end end end) addEvent ("get:element",true) addEventHandler ( "get:element", root, function (element) tigre1 = element outputChatBox ( "element" ) end) addEventHandler ( "onClientResourceStart", resourceRoot, function() triggerServerEvent ( "ped:clientready", getLocalPlayer(), getLocalPlayer() ) end) Server side: function sendServer(playerToSendTo) triggerClientEvent (playerToSendTo, "get:element", root, tigre1 ) end addEvent ( "ped:clientready", true ) addEventHandler ( "ped:clientready", root, sendServer )
-
Anyone here to tell me what is wrong above ? Ps.: sorry for double post.
-
I'd love playing in a "Far Cry" gamemode. If you need help about mapping just call me and I will be glad helping you. I may not be a pro scripter, but I have excellent mapping skills.
-
If you get many players, you could do something like Need for Speed, then you're free to drive around San Andreas, but to get money, respect, etc. you have to join races, then you go to place, and start the race with others. Be careful, some races will make you wanted, and you'll have to escape from Cops in order to avoid losing your car or paying to don't lose it.
-
I'm using slothbot, so I didn't understand half thing you have made, I'm not that expert as you see .-. Also, I didn't get what denny said, he told me to overwrite/replace/edit something while everything seems to be done for me, probably I'm forgetting something, so this is what I got, and stil the same, Nothing works, no rectangle, and not even ped's health. Client: local x, y = guiGetScreenSize() local tigre1 = nil addEventHandler("onClientRender",getRootElement(), function () if ( isElement ( tigre1 ) ) then local mx, my, mz = getElementPosition(tigre1) local mcx, mcy, mcz = getCameraMatrix() if isLineOfSightClear ( mcx , mcy, mcz, mx, my, mz, true, false, false, true, false, true, false, getLocalPlayer ( )) then local x1,y1,z1 = getElementPosition (getLocalPlayer()) local x2,y2,z2 = getElementPosition (tigre1) local visibleto = getDistanceBetweenPoints3D(x1,y1,z1,x2,y2,z2) if visibleto < 75 then local sx,sy = getScreenFromWorldPosition ( x2,y2,z2+1.45 ) if sx and sy then if y/102-visibleto/5 > 0 then dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14-visibleto,y/146.3-visibleto/10, tocolor(0,0,0,245) ) if getElementHealth(tigre1) > 1 then dxDrawRectangle ( sx-x/14/2+visibleto/2, sy+y/25-visibleto/3, x/14*getElementHealth(tigre1)/100-visibleto,y/146.3-visibleto/10, tocolor(190,0,0,245) ) end end end end end end end) addEvent ("get:element",true) addEventHandler ( "get:element", root, function (element) tigre1 = element outputChatBox ( "element" ) end) addEventHandler ( "onClientResourceStart", resourceRoot, function() triggerServerEvent ( "ped:clientready", getLocalPlayer(), getLocalPlayer() ) end) Server side: function sendServer(playerToSendTo) triggerClientEvent (playerToSendTo, "get:element", root, tigre1 ) end addEvent ( "ped:clientready", true ) addEventHandler ( "ped:clientready", root, sendServer )
-
I'm gonna give a check, thank you
-
Do something like Assassins creed.When logged in, you get a target to kill, and another assassin should kill you. I'm gonna edit as soon as I get more ideas
-
Do you have a good wiki ( better than the limited one from mta ) showing examples, tutorials, full explanation ?
-
but is it possible to show ped's health on a rectangle ? created using dxdrawrectangle
-
I give up, too many things, mta wiki is too limited, it says one thing while I can do another one totally different. Examples are bad, short explanation of how free I'm to use functions.
-
Client side : local x,y = guiGetScreenSize() function PETvida() local sx, sy = getScreenFromWorldPosition (getElementPosition(tigre1)) if sx then dxDrawRectangle( sx, sy, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) end end addEvent( "onGetHealth", true ) addEventHandler( "onGetHealth", getRootElement(), PETvida ) Server side(I think showing the whole function is not needed): tigre1 = call (getResourceFromName("slothbot"), "spawnBot", x+3, y+1, z, rot, skin, interior, dimension, team, weapon, mode, modesubject) setElementData ( tigre1, "pet", cachorro ) setElementExtraHealth ( tigre1, 999 ) triggerClientEvent ( "onGetHealth", getRootElement(), tigre1 ) else outputChatBox("Você não tem dinheiro para criar um PET", thePlayer, 225, 0, 0) end end Is it going to work, so I would "share" variables ... and the first code, is it right ?
-
Even if they are global ? I thought that, but I wasn't sure of how do I do, I'm starting to give up. If you have any tips about how do I do dxDrawRectangle using a server-side variable, please tell me. How do I "share" variables between both sides. Also check this please, tell me if the only thing is wrong is the variable ( I didn't get element health yet ) : local rootElement = getRootElement() local x,y = guiGetScreenSize() function PETvida() local sx, sy = getScreenFromWorldPosition (getElementPosition(tigre1)) if sx then dxDrawRectangle( sx, sy, x/2.02, y/2, tocolor ( 0, 0, 0, 150 ) ) end end function HandleTheRendering() addEventHandler("onClientRender",rootElement, PETvida) end addEventHandler("onBotSpawned",rootElement, HandleTheRendering)
-
And what about the rest of the code ?