Jump to content

JR10

Retired Staff
  • Posts

    2,947
  • Joined

  • Last visited

Everything posted by JR10

  1. , it happened again, this time a girl, was sitting, then she stood up, walked around, i attacked her, she kept running.
  2. here: Client side: addEventHandler("onClientPlayerDamage",root, function(attacker) if getElementType(attacker) == "vehicle" then cancelEvent() end end)
  3. JR10

    Killscript

    It's obvious, it's script not file. meta.xml: <meta> <info author="[GCC]^_Nico.de" type="script" /> <script src="kill.lua" type="server" /> </meta>
  4. JR10

    Ped Animation

    Wait wouldn't that give infinite execution, saw a problem caused by that somewhere. For cautions use that: _setPedAnimation = setPedAnimation function setPedAnimation(a,b,c,d,e,f,g,h) if tonumber(d) then setTimer(_setPedAnimation, tonumber(d), 1, a, false) end _setPedAnimation(a,b,c,d,e,f,g,h) end setPedAnimation(source , "ped", "handsup", 5000, false, false, false, false) Same but changed it to _setPedAnimation , because it might give infinite execution.
  5. It just weird that he made a client side script, but he don't know about the meta. Anyway, i'm sorry.
  6. client side only: function attachElementToBone(element,ped,bone) local boneX,boneY,boneZ = getPedBonePosition(ped,bone) setElementPosition(element,boneX,boneY,boneZ) attachRotationAdjusted(element,ped) end function attachRotationAdjusted (from, to) local frPosX, frPosY, frPosZ = getElementPosition(from) local frRotX, frRotY, frRotZ = getElementRotation(from) local toPosX, toPosY, toPosZ = getElementPosition(to) local toRotX, toRotY, toRotZ = getElementRotation(to) local offsetPosX = frPosX - toPosX local offsetPosY = frPosY - toPosY local offsetPosZ = frPosZ - toPosZ local offsetRotX = frRotX - toRotX local offsetRotY = frRotY - toRotY local offsetRotZ = frRotZ - toRotZ offsetPosX, offsetPosY, offsetPosZ = applyInverseRotation (offsetPosX, offsetPosY, offsetPosZ, toRotX, toRotY, toRotZ) attachElements(from, to, offsetPosX, offsetPosY, offsetPosZ, offsetRotX, offsetRotY, offsetRotZ) end function applyInverseRotation (x,y,z, rx,ry,rz) local DEG2RAD = (math.pi * 2) / 360 rx = rx * DEG2RAD ry = ry * DEG2RAD rz = rz * DEG2RAD local tempY = y y = math.cos (rx) * tempY + math.sin (rx) * z z = -math.sin (rx) * tempY + math.cos (rx) * z local tempX = x x = math.cos (ry) * tempX - math.sin (ry) * z z = math.sin (ry) * tempX + math.cos (ry) * z tempX = x x = math.cos (rz) * tempX + math.sin (rz) * y y = -math.sin (rz) * tempX + math.cos (rz) * y return x, y, z end Not sure it will work though, just an idea i came up with.
  7. You could have made one topic instead of two.
  8. So you made a client side script, but you don't know how to add it? Usually that means you stole it.
  9. You mean you stole a client script from a race server. -.-
  10. #define? You used to script for SA-MP. Well it's different local Crazy8 = 474 local Junkyard_Dog = 525 local Brimstone = 576 local Outlaw = 599 local Mr.Grimm = 463 local Roadkill = 541 local Thumper = 474 local Spectre = 475 local Darkside = 514 local Shadow = 442 local Yellow_Jacket = 420 local ManSalughter = 406 local Sweet_Tooth = 423
  11. The ped dropped those dollar pickups(icons). I wasn't doing any thing with peds, the ped was just there.
  12. I didn't script it(i can't anyway), i didn't do anything, and no resources other than mine were running, so it's a bug i guess.
  13. He beat the crap out of me , but yeah was hilarious.
  14. Sorry if it's a wrong section. and sorry for the big pictures. Here is what happened: I changed my resolution to 800x600 to test a gui, i joined my server, and i found a ped sitting on a bench I kept staring at him, he spoke (like in single player) "Look at your clothes", he made fun of me . So i punched him, then he started hunting me Eventually i managed to kill him He dropped money lol, but i couldn't take it , nothing happens when i hit the money pickup. So what the hell is it, a MTA bug? or my server is haunted.
  15. You haven't done anything wrong with mysql functions. And yes every change i did makes sense, removing local is actually critical, because you can't use local on a defined variable, And changing RESOURCE_ROOT is important because why using resourceRoot on the base Element in triggerClientEvent, which is not even defined.
  16. Why don't you understand first, there is already 2 variables called 'username' and 'password' so removing local from username and password is required, and if i'm right it might gives an error. Yes i removed source ~= client because if i'm right source == client if you triggered the server event right. And i also edited your triggerClientEvent replaced RESOURCE_ROOT (which i didn't find a define for it) to source which is the player. Did you even test it?, i'm not a post count seeker, i'm just trying to help.
  17. Are you sure there is databaseConnection() No there isn't you must use "mysql_connect" If it's a custom function you made then try: addEvent("registerRequest", true) function processReqisterRequest(username, password) local databaseNode = databaseConnection() if not databaseNode then return end username = mysql_escape_string(databaseNode, username) local origPassword = password password = mysql_escape_string(databaseNode, password) local accountQuery = mysql_query(databaseNode, "SELECT * FROM accounts WHERE username = '"..string.lower(username).."'") if accountQuery then if mysql_num_rows(accountQuery) == 0 then local serialCheck = mysql_query(databaseNode, "SELECT * FROM accounts WHERE firstSerial = '"..getPlayerSerial(source).."'") if serialCheck then if mysql_num_rows(serialCheck) < 3 then --local newAccount = mysql_query(databaseNode, "INSERT INTO accounts (username, password, registerDate, firstSerial) VALUES ('"..string.lower(username).."', '"..password.."', NOW(), '"..getPlayerSerial(source).."')") local newAccount = true if newAccount then triggerClientEvent(source, "registerSuccess", source, "You have successfully registered an account! You may now login.") mysql_free_result(newAccount) else --ERROR CODE REG1 triggerClientEvent(source, "registerFailure", source, "Unable to perform the registration query! Please contact an admin. [ERROR CODE: REG1]") end else triggerClientEvent(source, "registerFailure", source, "You may only register up to 3 accounts here! Contact [email protected] for account recovery instructions.") return end mysql_free_result(serialCheck) else --ERROR CODE REG2 triggerClientEvent(source, "registerFailure", source, "Unable to perform the registration query! Please contact an admin. [ERROR CODE: REG2]") return end else triggerClientEvent(source, "registerFailure", source, "An account with this name already exists!") end mysql_free_result(accountQuery) else --ERROR CODE REG3 triggerClientEvent(source, "registerFailure", source, "Unable to perform the registration query! Please contact an admin. [ERROR CODE: REG3]") return end end
  18. JR10

    how ?

    Try: function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) function movehim(hitElement) if getElementType(hitElement) ~= "player" then return end setElementInterior(hitElement, 9, 315.48, 984.13, 1959.11 ) end addEventHandler( "onMarkerHit", Marker, movehim ) end addCommandHandler ( "attach", markerattach )
  19. JR10

    how ?

    That's because the marker is local and there is no way else you can get it. Try: function markerattach ( player ) local vehicle = getPedOccupiedVehicle(player) local Marker = createMarker ( 0, 0, 0, "arrow", 1, 255, 0, 0, 170 ) attachElements ( Marker, vehicle, 0, 0, 2 ) addEventHandler("onMarkerHit", Marker, function(hitElement) if getElementType(hitElement) ~= "player" then return end --code to set the player to the anadorma interior end) end addCommandHandler ( "attach", markerattach )
  20. I don't think there is, but you can do it using those functions: killPed fadeCamera setCameraMatrix setCameraTarget setElementAlpha
  21. Did you even read the post?? He's offering help for money and for free, he's not asking for a scripter.
  22. You can only destroy peds created by createPed.
  23. I tested it with/without the freeroam resource, the freeroam resource is what's causing this.
×
×
  • Create New...