Jump to content

ManeXi

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by ManeXi

  1. Buenas a todos, me enorgullezco de presentaros mi nuevo proyecto: Street War, un servidor de TDM con algunos toques de RPG, el servidor está aun en desarrollo pero saldrá pronto a la luz, aquí pueden mirar su trailer. Fecha de salida: 10 Diciembre 14:00 GMT 0 IP del servidor: 164.132.47.13 Registre en nuestro foro y únete a la comunidad! http://streetwartdm.com/
  2. I'm using an scaled skull object as mask, everything goes ok except that if I "Zoom" the camera to the skull, disappiers, the object is scaled by setObjectScale(0.08) The object ID is: 6865 So, is there any way to force player to display the object even if the camera is too nearby to it?
  3. Probably you'll need to create water with this function: createWater ( int x1, int y1, float z1, int x2, int y2, float z2, int x3, int y3, float z3 [, int x4, int y4, float z4 ] [, bool bShallow = false ] ) Take a look to it here: https://wiki.multitheftauto.com/wiki/CreateWater
  4. I have created this while loop that it should add one number each 1 second until 10 for some reason the script crashes saying: ERROR: Aborting; infinite running script in whileLoopTest local n = 0 while (n <= 10) do if not (isTimer(timer)) then timer = setTimer(function() outputChatBox("Number: "..n) n = n + 1 end, 1000, 1) end end for some reason without timer works well local n = 0 while (n < 10) do n = n + 1 outputChatBox("Number: "..n, root, 255, 0, 0) end So... my question is: Is there any way to delay the while loop actions?
  5. function playerCarLock(source) local playeraccount = getPlayerAccount(source) local fac = getAccountData(playeraccount, "Faction") or 0 for vehicles in pairs (pVehicle) do if (tonumber(fac) == 2) then if (getDistanceBetweenPoints3D(getElementPosition(vehicles), getElementPosition(source)) < 6 ) then if not (isVehicleLocked(vehicles)) then setVehicleLocked(vehicles, true) else setVehicleLocked(vehicles, false) end end end end end addCommandHandler("lock", playerCarLock) function engine(source) local playeraccount = getPlayerAccount(source) local fac = getAccountData(playeraccount, "Faction") or 0 for vehicles in pairs (pVehicle) do if (getPedOccupiedVehicle(source) == vehicles) and (tonumber(fac) == 2) then if (getVehicleEngineState(vehicles) == false) then setVehicleEngineState(vehicles, true) else setVehicleEngineState(vehicles, false) end end end end addCommandHandler("engine", engine) If it doesn't work try to change this line: local pVehicle = {} function buildPVehicle() for _, v in ipairs (pVeh) do table.insert(pVehicle, createVehicle(v.model, v.x, v.y, v.z, v.rx, v.ry, v.rz, v.lp)) setVehicleLocked(pVehicle, false) setVehicleColor(pVehicle, v.r, v.g, v.b, v.r2, v.g2, v.b2) end end addEventHandler("onResourceStart", root, buildPVehicle) And if afterall it doesn't work, you should wait for the answer of someone with more knowledge than me cause I'm not very experienced atall.
  6. Yeah, that seems to work, I'm not sure if "[player] = true" it's inside of the table called as playerTable[number], but seems to work. And yes the variable "number" is defined, If not I wouldn't be able to create the second table ("playerTable[number] = {}") Thanks to everyone.
  7. Number is the variable used to call a number, the index of the table that I created, and no "number" can't be a string cause various sub-tables will be added to "playerTable"
  8. you should replace the "Lock" function with this one: function playerCarLock(source) local playeraccount = getPlayerAccount(source) local fac = getAccountData(playeraccount, "Faction") or 0 for _, veh in ipairs (getElementsByType("vehicle", resourceRoot)) do if (tonumber(fac) == 2) then if (getDistanceBetweenPoints3D(getElementPosition(veh), getElementPosition(source)) < 6 ) then if not (isVehicleLocked(veh)) then setVehicleLocked(veh, true) else setVehicleLocked(veh, false) end end end end end addCommandHandler("lock", playerCarLock) I'm pretty sure it will work, if it doesn't it would help if you put the ERROR that pops-up in the debug. note about script: You'll lock every vehicle created by the resource that you posted that is under 6 points of distance function engine(source) local playeraccount = getPlayerAccount(source) local fac = getAccountData(playeraccount, "Faction") or 0 for _, veh in ipairs (getElementsByType("vehicle", resourceRoot)) do if (getPedOccupiedVehicle(source) == veh) and (tonumber(fac) == 2) then if (getVehicleEngineState(veh) == false) then setVehicleEngineState(veh, true) else setVehicleEngineState(veh, false) end end end end addCommandHandler("engine", engine) This is for the engine
  9. I want to add stuff to a table created inside of a table. local playerTable = {} --Some function over here... playerTable[number] = {} --Used this to add the table inside of the table (succesfully added) playerTable.number[player] = true --I don't know how to add with the index "player" the "true" value in the "playerTable[number]" table The error that I get is "attempt to index field 'number' (a nil value)"
  10. I'm not sure it can be the problem but as I see you are installing at "Program Files" and not at "Program Files(x86)", I don't know if you've got 32 Bit OS or 64 OS anyway if you've got 64 Bit OS you should install it at "Program Files(x86)". If you don't have that folder at PC root folder(C:\) I'm pretty sure you've got 32 Bit PC.
  11. It works, lol, now I see my mistake, every time I was executing the event "local n = 0" was set, thanks.
  12. function addNumber() local n = 0 n = n + 1 outputChatBox(n) end addEventHandler("onClientRender", root, addNumber) This should add +1 each time that player renders the game but for any reason it doesn't.
  13. Welcome warrior! = Account: = Password: = Login = Register a new account = Please enter your username! = Please enter your password! = Wrong username and/or password! = Save? = Account created, login with your username/password = Password Confirm: = Register! = Cancel = Please enter an username you would like to register with! = Please enter a password! = Please confirm your password! = Passwords do not match! = An account with this username already exists! = Unknown error! Choose a different username/password and try again. = Please don't fool me, I'll be very thanked if anyone might traslate me those texts
  14. Welcome warrior! = Account: = Password: = Login = Register a new account = Please enter your username! = Please enter your password! = Wrong username and/or password! = Save? = Account created, login with your username/password = Password Confirm: = Register! = Cancel = Please enter an username you would like to register with! = Please enter a password! = Please confirm your password! = Passwords do not match! = An account with this username already exists! = Unknown error! Choose a different username/password and try again. = Please don't fool me, I'll be very thanked if anyone might traslate me those texts
  15. Welcome warrior! = Account: = Password: = Login = Register a new account = Please enter your username! = Please enter your password! = Wrong username and/or password! = Save? = Account created, login with your username/password = Password Confirm: = Register! = Cancel = Please enter an username you would like to register with! = Please enter a password! = Please confirm your password! = Passwords do not match! = An account with this username already exists! = Unknown error! Choose a different username/password and try again. = Please don't fool me, I'll be very thanked if anyone might traslate me those texts
  16. function cancelRob() setElementData(source, "rob", false) exports.GTWtopbar:dm( "Robbery failed because you died, fool!", source, 255, 0, 0 ) setPedAnimation(source, nil, nil) if isTimer(cancelTimers[source]) then killTimer(cancelTimers[source]) end end addEventHandler("onPlayerWasted", root, cancelRob) I'm pretty sure this will stop him robbing, but I've got my doubts about the timer, you should post here how "cancelTimers" adds the client to the timer table
  17. Your solution amazingly worked, but I have alot of doubts about it. #1 Why does work only with pairs? #2 When I use: totalPlayerInEvent[player] = player what's the index and what's the value? (firstly I thought Index was just the player, and the value player(element), now my mind has blown up.) #3 the "player" of the "for" what does refer? to the index? element? value? #4 If I use totalPlayerInEvent[player] = nil will be removed from the table, right? I thought in that but if any player changes nickname throught it something might get bugged and probably any exploit would appier
  18. I need to add a player to a table as index and value, I have tried this: totalPlayerInEvent[player] = player for _, player in ipairs(totalPlayerInEvent) do triggerClientEvent(player, "joinEvent", root) end to clear "player" is the guy who triggered the event that i'm working with, nothing is wrong with it. instead if I use table.insert it works but badly it puts default index(1, 2, 3...) and I need to use [player] as index to be able to manipulate the value (in other words to be able to remove it) PD: I didn't get any error in debug log
  19. I want to attach an event to only 1 certain marker, I have tried this: local eventMarker = createMarker(2031.0009765625, -1417.849609375, 18, "arrow", 2.0, 0, 255, 0, 200) addEventHandler("onPlayerMarkerHit", eventMarker, theFunction) but it doesn't work
×
×
  • Create New...