-
Posts
814 -
Joined
-
Last visited
Everything posted by Wei
-
addEventHandler("onResourceStart", getRootElement(), teamgui) onResourceStart is server-side event!
-
You must calculate it. https://forum.multitheftauto.com/viewtopic.php?f=91&t=69692
-
waitTimer = {} waitTime = 5000 -- time in miliseconds function giveCar ( thePlayer, commandName ) if getElementType ( thePlayer ) == "player" then if (waitTimer[thePlayer]) then return -- add here outputChatBox if you want it! end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) local x, y, z = getElementPosition(thePlayer) if isObjectInACLGroup ("user."..accName, aclGetGroup ("VIP")) then local comet = createVehicle ( 480, x, y, z+0.5 ) warpPlayerIntoVehicle ( thePlayer, comet ) waitTimer[thePlayer] = setTimer(waitTime, 1, function() end) else outputChatBox("You are not a VIP.",thePlayer,255,60,60) end end end addCommandHandler ( "pc", giveCar ) I know you can use getTickCount but this is easyer
-
screenWidth/2 - 1229 maybe because of this ?
-
I am scripting for like realy long time, and I still don't understand how to calculate dx draws for all resolutions ? like i want a reactangle at 300 300 300 300 at my resolution (1024/768). How would I make that player wich has bigger resolution would have in same place? (it would be more than 300) Thanks, Wei
-
You must script it with fetchRemote. You have all information on wiki.
-
function cancelPedDamage ( attacker ) cancelEvent() -- cancel any damage done to peds end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage )
-
function removeOneVSOneWeapon ( markerhit, matchingDimension ) if ( markerhit == outOneVSOneMarkertoPrincipalInterior ) then takeWeapon ( thePlayer, 2 ) takeWeapon ( thePlayer, 4 ) takeWeapon ( thePlayer, 5 ) takeWeapon ( thePlayer, 6 ) takeWeapon ( thePlayer, 8 ) takeWeapon ( thePlayer, 9 ) takeWeapon ( thePlayer, 10 ) end end addEventHandler ( "onPlayerMarkerHit", getRootElement(), removeOneVSOneWeapon ) You've defined markerhit, but you used makerHit
-
addEventHandler("onClientGUIClick", buttton, function, false) -- False must be at the end of event handler!
-
Still same, yeah I will fix that later...
-
local storWeapon = fromJSON(getElementData(housePickup[houseID], "IGChousing.storedweapons")) if (type(storWeapon) == "table") then local tableWeapon = storWeapon if tableWeapon[getSlotFromWeapon(weapon)] then tableWeapon[getSlotFromWeapon(weapon)] = weapon..","..tableWeapon[getSlotFromWeapon(weapon)]+ammo setElementData(housePickup[houseID], "IGChousing.storedweapons", toJSON(tableWeapon)) outputChatBox("In") else table.insert(tableWeapon, getSlotFromWeapon(weapon), weapon..","..ammo) setElementData(housePickup[houseID], "IGChousing.storedweapons", toJSON(tableWeapon)) outputChatBox("NotIn") end Chatbox allways outputs NotIn. No debug!
-
Yes it is, but you can't use it if you wanna have it on element like source or parameter... From where you wanna get the vehicle element ?
-
Your parameters are wrong, every event has difrend parameters!
-
replace the function attemptRegister in s_account.lua with this one function attemptRegister(thePlayer, username, password) if ( username ~= "" and password ~= "" ) then local success, error = exports.sql:query_free("INSERT INTO `accounts` VALUES('', '".. tostring(username) .."', '".. md5( tostring( password ) ) .."', '".. getPlayerSerial(thePlayer) .."', '0','0')") if ( error ) then return outputDebugString( error ) else return outputChatBox("Successfully registered your account!", thePlayer, 100, 0, 100) end end end
