Jump to content

Skream

Members
  • Posts

    47
  • Joined

  • Last visited

Everything posted by Skream

  1. try ped handsup for example sorry I can't copy n past its not that simple cuz I load peds from database they have a default animation (as I said most case unique, database stored) and it changes based with the situation I could record it do you have discord?
  2. I have a large IA system for NPCs. They use different animations, at least 30 different animations (100+ peds). It seems to not work at all. I'm using the 1.5.6 version on mta.sa They even respond to certain situations like aiming at them or shooting, getting injured or getting close so animations changes constantly I'm using the gta v ped.ifp that comes with ifp_demo
  3. function initAnimations() for animBlock, animsTable in pairs(animData) do engineLoadIFP(':rio-modpack/animation/ifp/' .. animBlock .. '.ifp', animBlock) end local playersPool, pedsPool = getElementsByType('player'), getElementsByType('ped') replaceAnimations(localPlayer) for _, thePlayer in pairs(playersPool) do if getElementData(thePlayer, 'character:logged_in') then replaceAnimations(thePlayer) end end for _, thePed in pairs(pedsPool) do replaceAnimations(thePed) end end addEventHandler('onClientResourceStart', resourceRoot, initAnimations) function replaceAnimations(theElement) for animBlock, animsTable in pairs(animData) do for _, animName in pairs(animsTable) do engineReplaceAnimation(theElement, animBlock, animName, animBlock, animName) end end end I also tried to do this either addEventHandler('onClientElementStreamIn', root, function() local elemType = getElementType(source) if elemType == 'ped' or elemType == 'player' then replaceAnimations(source) end end) it works fine for players but ped doesn't
  4. Is it just me or engineReplaceAnimation don't work for peds at moment? Worked fine for me for players. I'm just asking it here to make sure before report it as a bug in github I also tried to replace the animation everytime the ped streamIn but still nothing.
  5. Can you be more specific? I tried setting setPedCameraRotation same as angleFromCoords before but it didn't work for me (same moonwalk ocurring) I tried setting it that angle + 180 and still same problem @edit thanks man found this https://bugs.mtasa.com/view.php?id=7349
  6. I have the following code local angleFromCoords = (-math.deg(math.atan2(targetX - sourceX, targetY - sourceY))) % 360 setElementRotation(thePed, 0, 0, angleFromCoords) setPedAimTarget(thePed, targetX, targetY, targetZ + .2) setPedLookAt(thePed, targetX, targetY, targetZ + .2) the ped points to my player and fire all fine. The problem is if I use setPedControlState forwards it just runs like a michael jacksons moonwalk even still lookin to my player
  7. https://wiki.multitheftauto.com/wiki/CreateColPolygon wiki says: Tip: To visualize a colshape when writing scripts, use the client console command showcol You just made me curious, can I ask what are you trying to do with that area?
  8. I'm not sure but maybe createColPolygon() would fit better what you intend. If its not the case try with getTickCount() just use getTickCount after he leaves the colshape and check the time diff after he enters the new one I was thinking about it again and I think a bettter approach that would detect would be use onClientRender and loop through all your shapes. If hes not inside of one of those then he just leaved. You don't have to trigger a function for this all the time, just when he enters. If hes not inside of any of those shapes then you remove it. When he enters one of those you add it again. Thats more efficient
  9. Is there a way to detect if the player has a microphone or not?
  10. Guys, Saml1er was almost correct. I find it looking it on wiki the problem was in fetchRemote I had to pass client as a table after my function thank you guys for all your help I appreaciated it
  11. They're the same thing as wiki says. Source doesn't work either. Its funny cuz in my character creation script I passed the variable the same as I do in login and it works fine.
  12. still not working same expected element at argument 1 got nil The only way it works is if I do this local theSource = client and use theSource as the element
  13. As my code show I'm already doing it at least as I understood it says serverside
  14. addEvent('browser:onClientTryLogin', true) addEventHandler('browser:onClientTryLogin', resourceRoot, function(username, password) triggerServerEvent('server:onClientTryLogin', localPlayer, username, password) end) this is my code clientside this is my code serverside function tryLogin(username, password) local formOptions = { method = 'POST', formFields = { ['username'] = username, ['password'] = password, } } fetchRemote(loginURL['login'], formOptions, function(data, info) if info.statusCode == 200 then local fetchData = fromJSON(data) local errorCode = tonumber(fetchData['response_code']) if errorCode ~= 0 then triggerClientEvent(client, 'client:onClientLoginFail', client, authErrors[errorCode]) triggerEvent('server:onClientLoginFail', client, authErrors[errorCode]) else setElementData(client, 'account:id', tonumber(fetchData['account']['id'])) setElementData(client, 'account:username', tostring(fetchData['account']['username'])) end end end ) end addEvent('server:onClientTryLogin', true) addEventHandler('server:onClientTryLogin', root, tryLogin) it prints me bad argument @setElementData expected element got nil but even if I print client ou source as a string I get the same userdata I tried to pass localPlayer as another var and it worked but I think it is not supposed to be like that
  15. I think it makes no difference if you divide gettickcount for 20 or 1000 because % is going to reset the number every 360. getTickCount gets computer uptime isn't? its not going to make a diff because onClientRender doesn't trigger every ms. It triggers more like every 5 ms I think (getTickCount() % 360) / 20 I think this may do what you said. But still it wouldn't make a 360 rotation like he said cuz the max rotation would be like 18deg
  16. I think that / 20 makes no diff
  17. Man you gotta really good ones there. I found a 2700x2700 and fits it pretty well to my propouse. Thank you guys for your replies I appreciate it.
  18. Someone have a 3000x3000 version of atlas map? I really need it I wasn't sure if this is the wrong area to ask this but I have no idea where to ask I didn't find it on google image search either
  19. understood, thanks mate. Oh, sorry for the addEvent I wasn't paying attention to it.
  20. this is just like bacon, AWESOME. I was missing some group system in LUA. Hey, if I was going to call the group in a diff resource I should use getElementsByType or retrieve it with getElementById? and how is the right way to remove a element from a group? local charGroup = createElement('groupCharacter', 'character_group') setElementParent(charGroup, getElementById('account_group')) addEvent('server_onCharacterLogin', function() setElementParent(source, charGroup) end) addEvent('server_onCharacterLogout', function() setElementParent(source, nil) end) My code seems correct?
  21. nvm worked with .ogg files (mp4 doesn't work)
  22. Skream

    gsub

    found a solution here https://wiki.multitheftauto.com/wiki/PregReplace thank you @MrTasty
  23. Skream

    gsub

    I tried your example here and I got a negative number output
  24. Skream

    gsub

    i gotta the following code $cpf = "09551130401"; $returnValue = preg_replace('/^(\\d{3})(\\d{3})(\\d{3})(\\d{2})/', '$1.$2.$3-$4', $cpf, -1); and this works fine I've tried to do the same in lua but it doenst work local cpf = tostring(09551130401) print(string.gsub(cpf, '/^(\\d{3})(\\d{3})(\\d{3})(\\d{2})/', '$1.$2.$3-$4')) print(cpf)
  25. k my friend I'll do my job here. Thanks for your help. Yeah, bindkey seems a bad idea for this.
×
×
  • Create New...