-
Posts
1,803 -
Joined
-
Last visited
-
Days Won
8
Everything posted by Citizen
-
Me too but without "and when had questions/errors posted on the Scripting section"
-
Mmmm maybe it's a stupid question but do you have installed a mysql server ? ( like wamp, easyPHP, ... ) Because without that, you can't make any mysql functions
-
We don't care abaout it because it's a local variables so when the function is ended, those variables are deleted.
-
So try to use this function setElementStreamable and turn it to false And when a player join, then apply the animation to this ped
-
Maybe because the 'kick' cmd is a cmd from MTA ( so it's already exist ) but I'm not really sure
-
Why do you need a setElementData ?? just make a global at the top of you script for exemple PLAYERSCOUNT = getPlayerCount() but don't forget to update it because when the server is starting, there are no players so PLAYERSCOUNT = 0 If you want a setElementData then create a useless object under the map then make your setElementData on it.
-
local Rzone1 = createColSphere(354.43, 2028.49, 22.4141, 100.0) function boemRadius(player, a) local x,y,z = getElementPosition(player) if (z >= 30) then local target = getPedOccupiedVehicle(player) local bom = createProjectile(player, 20, 354.43, 2028.49, 25.4141, 1.0, target ) setTimer( boemRadius, 4000, 1, player ) end end addEventHandler("onClientColShapeHit", Rzone1, boemRadius) Works ( tested )
-
local block, anim = getPedAnimation( thePlayer ) if ( not( block == "CARRY" and anim == "crry_prtial" ) ) then outputChatBox( "Drop" ) end
-
No because MTA can only support the 1.0 gta's version and the MTA's version is the MTA's version so don't take care about it
-
I have tested it, and it's work ! And it's in client-side
-
You need this functions: getCursorPosition then: getWorldFromScreenPosition then: setElementPosition And use this event: onClientRender or onClientMouseMove
-
Sure, So here, if theStat == cash then the script want to check if theStat is equal to cash ( not the name cash but the value of this variable ), the variable cash is not defined so cash = nil so the script make that: if theStat == nil then Also, you made: addStat(player, points, points) here, you send 2 times the value of the variable points and theStat receive the 1st variable points ( so a number and not the name cash ) (I'm sorry if you don't understand but I can't explain better why your script can't work , but I can explain why my script works )
-
Your .xml or .map: <blabla> <camera lookX="2494.5971679688" lookY="-1673.1807861328" lookZ="13.335947036743" posX="2457.0390625" posY="-1647.9575195313" posZ="48.245067596436"/> </blabla> the code: function getCameraData() local path = "meta.xml" -- maybe it's a .map so replace meta.xml by the correct name local xml = xmlLoadFile( path ) local childs = xmlNodeGetChildren( xml ) local find = false local x,y,z,lx,ly,lz = 0, 0, 0, 0, 0, 0 for k,i in ipairs ( childs ) do if ( xmlNodeGetName ( i ) == "camera" ) then find = true x = xmlNodeGetAttribute( i, "posX" ) y = xmlNodeGetAttribute( i, "posY" ) z = xmlNodeGetAttribute( i, "posZ" ) lx = xmlNodeGetAttribute( i, "lookX" ) ly = xmlNodeGetAttribute( i, "lookY" ) lz = xmlNodeGetAttribute( i, "lookZ" ) end end if ( find ) then return tonumber(x),tonumber(y),tonumber(z),tonumber(lx),tonumber(ly),tonumber(lz) else outputDebugString( "ERROR: Couldn't find any camera node in "..path.." !" ) return false end end --Exemple: function bla() local x,y,z,lx,ly,lz = getCameraData() --the instructions end don't forget your .xml or .map in your meta.xml and type="client" if you want to use it in client-side
-
I knew that, that's why I add the link for the introduction of scripting page
-
As far I know, I don't think that you can make that sorry
-
keyTable = { "mouse1", "mouse2", "mouse3", "mouse4", "mouse5", "mouse_wheel_up", "mouse_wheel_down", "arrow_l", "arrow_u", "arrow_r", "arrow_d", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7", "num_8", "num_9", "num_mul", "num_add", "num_sep", "num_sub", "num_div", "num_dec", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12", "backspace", "tab", "lalt", "ralt", "enter", "space", "pgup", "pgdn", "end", "home", "insert", "delete", "lshift", "rshift", "lctrl", "rctrl", "[", "]", "pause", "capslock", "scroll", ";", ",", "-", ".", "/", "#", "\\", "=" } function keyPressed( ) local lastKey = getElementData( getLocalPlayer(), "PRESSED" ) if ( not (lastKey == "none") ) then if ( not getKeyState( ""..lastKey ) ) then local nlet = string.byte(""..lastKey) if ( nlet >= 97 and nlet <= 122 )then if ( getKeyState( "lshift" ) or getKeyState( "rshift" ) ) then lastKey = string.upper(tostring(lastKey)) end end triggerEvent( "onClientKeyPressed", getRootElement(), lastKey ) setElementData( getLocalPlayer(), "PRESSED", "none" ) end end for k,i in ipairs( keyTable ) do local letter = tostring(keyTable[k]) local state = getKeyState( ""..letter ) if ( state ) then setElementData( getLocalPlayer(), "PRESSED", tostring(letter) ) break end end end addEventHandler( "onClientPreRender", getRootElement(), keyPressed ) function test05( letter ) outputChatBox(""..letter ) end addEventHandler("onClientKeyPressed", getRootElement(), test05 )
-
I don't found this code, I make it my self, and I get all hospitals positions for you ( near 1hour of work in total ) I really don't care about it. maybe 10$ ?
-
function addStat(thePlayer, theStat, theValue) local getActualPoints = getElementData(thePlayer, "Points") local getActualCash = getElementData(thePlayer, "Cash") outputChatBox( "addStat: "..getActualPoints..", "..getActualCash) -- test if theStat == "cash" then setElementData(thePlayer, "Cash", getActualCash + theValue) elseif theStat == "points" then setElementData(thePlayer, "Points", getActualPoints + theValue) end outputChatBox( "Current datas: "..getElementData(thePlayer, "Points")..", "..getElementData(thePlayer, "Cash") )-- test end function onPlayerWins(player) local players = getPlayerCount() local points = players * 1.3 local cash = players * 7 outputChatBox( "onPlayerWins: "..players..", "..points..", "..cash )-- test addStat(player, "points", points) addStat(player, "cash", cash) end
-
anywhere in your sever-side if you don't know what's the server-side, check this link
-
addEvent("onClientKeyPressed", true ) setElementData( getLocalPlayer(), "PRESSED", "none" ) function keyPressed( ) local lastKey = getElementData( getLocalPlayer(), "PRESSED" ) if ( not (lastKey == "none") ) then if ( not getKeyState( ""..lastKey ) ) then triggerEvent( "onClientKeyPressed", getRootElement(), tostring(lastKey) ) setElementData( getLocalPlayer(), "PRESSED", "none" ) end end for k=97, 122 do local letter = string.char(k) local state = getKeyState( ""..letter ) if ( state ) then setElementData( getLocalPlayer(), "PRESSED", tostring(letter) ) break end end end addEventHandler( "onClientPreRender", getRootElement(), keyPressed ) function test05( letter ) outputChatBox(""..letter ) end addEventHandler("onClientKeyPressed", getRootElement(), test05 )
-
Try to make your own event. I already make this event for the 1.0.5 and it's work I can show you if you want
-
Ouai lol je suis sur la partie anglaise du fofo, ici personne n'a besoin d'aide apparemment ^^
-
Yeah maybe but I want to remake the GUI system in directX. Why ? Answer: @NeXTreme: Awesome skin
-
Hehe thanks No problem