Skream

Members
  • Content count

    48
  • Joined

  • Last visited

Community Reputation

4 Neutral

About Skream

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Skream

    engineReplaceAnimation for peds not working

    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. Skream

    engineReplaceAnimation for peds not working

    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. Skream

    engineReplaceAnimation for peds not working

    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. Skream

    ped doesn't go forwards

    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. Skream

    ped doesn't go forwards

    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. Skream

    voice system detect microphone

    Is there a way to detect if the player has a microphone or not?
  10. Skream

    Says localPlayer is not a element serverside

    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. Skream

    Says localPlayer is not a element serverside

    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. Skream

    Says localPlayer is not a element serverside

    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. Skream

    Says localPlayer is not a element serverside

    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. Skream

    [HELP]How to make a image spin

    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