Jump to content

Rettox

Members
  • Posts

    7
  • Joined

  • Last visited

Details

  • Location
    LS
  • Occupation
    Developer
  • Interests
    Programming

Recent Profile Visitors

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

Rettox's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Hello community, I have CrystalMV's traffic system and i need to make it responsive - peds will respond to being aimed at, will jump out of path of car, will get angry if attacked (not always) and will check for collisions, so if they hit something or someone they simply go around it and continue it's path. They're just dumb as hell. I'm willing to pay up to 20$ (for now). (PaySafeCard or another payment option). Thanks!
  2. Thank you! I was really confused about it.
  3. Hello people, I need your help. I was getting "Attempting to index global (nil value)" a lot in past, but i have solved them, somehow. I really don't know why those errors appear. I even separated each event to single files, doesn't help anyway. Code: function loadWeaponsOnSpawn() local ped = source local account = getPlayerAccount(source) local weapon0 = getAccountData(account,"weapon0") local weapon1 = getAccountData(account,"weapon1") local weapon2 = getAccountData(account,"weapon2") local weapon3 = getAccountData(account,"weapon3") local weapon4 = getAccountData(account,"weapon4") local weapon5 = getAccountData(account,"weapon5") local weapon6 = getAccountData(account,"weapon6") local weapon7 = getAccountData(account,"weapon7") local weapon8 = getAccountData(account,"weapon8") local weapon9 = getAccountData(account,"weapon9") local weapon10 = getAccountData(account,"weapon10") local weapon11 = getAccountData(account,"weapon11") local weapon12 = getAccountData(account,"weapon12") local ammo0 = getAccountData(account,"ammo0") local ammo1 = getAccountData(account,"ammo1") local ammo2 = getAccountData(account,"ammo2") local ammo3 = getAccountData(account,"ammo3") local ammo4 = getAccountData(account,"ammo4") local ammo5 = getAccountData(account,"ammo5") local ammo6 = getAccountData(account,"ammo6") local ammo7 = getAccountData(account,"ammo7") local ammo8 = getAccountData(account,"ammo8") local ammo9 = getAccountData(account,"ammo9") local ammo10 = getAccountData(account,"ammo10") local ammo11 = getAccountData(account,"ammo11") local ammo12 = getAccountData(account,"ammo12") local cloth1 = getAccountData(account,"cloth1") local cloth2 = getAccountData(account,"cloth2") local cloth3 = getAccountData(account,"cloth3") local cloth4 = getAccountData(account,"cloth4") local cloth5 = getAccountData(account,"cloth5") local cloth6 = getAccountData(account,"cloth6") local cloth7 = getAccountData(account,"cloth7") local cloth8 = getAccountData(account,"cloth8") local cloth9 = getAccountData(account,"cloth9") local cloth10 = getAccountData(account,"cloth10") local cloth11 = getAccountData(account,"cloth11") local cloth12 = getAccountData(account,"cloth12") local cloth13 = getAccountData(account,"cloth13") local cloth14 = getAccountData(account,"cloth14") local cloth15 = getAccountData(account,"cloth15") local cloth16 = getAccountData(account,"cloth16") local cloth17 = getAccountData(account,"cloth17") if (weapon0) and (weapon1) and (weapon2) and (weapon3) and (weapon4) and (weapon5) and (weapon6) and (weapon7) and (weapon8) and (weapon9) and (weapon10) and (weapon11) and (weapon12) and (ammo0) and (ammo1) and (ammo2) and (ammo3) and (ammo4) and (ammo5) and (ammo6) and (ammo7) and (ammo8) and (ammo9) and (ammo10) and (ammo11) and (ammo12) then giveWeapon(source,weapon0,ammo0) giveWeapon(source,weapon1,ammo1) giveWeapon(source,weapon2,ammo2) giveWeapon(source,weapon3,ammo3) giveWeapon(source,weapon4,ammo4) giveWeapon(source,weapon5,ammo5) giveWeapon(source,weapon6,ammo6) giveWeapon(source,weapon7,ammo7) giveWeapon(source,weapon8,ammo8) giveWeapon(source,weapon9,ammo9) giveWeapon(source,weapon10,ammo10) giveWeapon(source,weapon11,ammo11) giveWeapon(source,weapon12,ammo12) setPedClothes(ped, 4, cloth4) setPedClothes(ped, 5, cloth5) setPedClothes(ped, 6, cloth6) setPedClothes(ped, 7, cloth7) setPedClothes(ped, 8, cloth8) setPedClothes(ped, 9, cloth9) setPedClothes(ped, 10, cloth10) setPedClothes(ped, 11, cloth11) setPedClothes(ped, 12, cloth12) setPedClothes(ped, 13, cloth13) setPedClothes(ped, 14, cloth14) setPedClothes(ped, 15, cloth15) setPedClothes(ped, 16, cloth16) setPedClothes(ped, 17, cloth17) end end addEventHandler("onPlayerSpawn",root,loadWeaponsOnSpawn) Any help appreciated. Thanks I have more scripts like that, nothing helped and I'm not sure what's :Oing cause of this :Oing bull:~ error. ):-( error: [17:24:16] ERROR: [gamemodes]/[play]/play/save2.lua:29: attempt to call global 'getPedClothesID' (a nil value) [17:24:21] ERROR: [gamemodes]/[play]/play/save1.lua:61: attempt to call global 'setPedClothes' (a nil value) Note: It works on death, even after error message, that's what's even more weird
  4. Hello there, can anyone provide me list of peds scream voices? I combined my AI, slothbot and crystalmv's ai system to make one great lol And i really need people to scream :))
  5. I have solved it. On some line i had a variable that was not a local one, so it was calling it (i don't know why it was even doing it lol) (the global variable).
  6. Hello guys... I have big problem with my em... Mr. Error.... A weird error occurs when checking for player level (comparing player's wanted level with number. But huh. tonumber(wl) doesn't work either, where wl stands for player's level...) Basically, im going to paste full police code for all servers, so you can use it on your server (after fixing it, of course) criminals = createTeam ("Criminals", 255, 0, 0 ) citizens = createTeam ("Citizens", 0, 0, 255 ) -- Instruções para eles não atacarem-se entre si (ou não) setTeamFriendlyFire (getTeamFromName("Citizens"), false ) setTeamFriendlyFire (getTeamFromName("Criminals"), false ) -- função que cria o policial patrulhando a cada 4min setTimer(function() if getPlayerCount() > 0 then for i, players in ipairs(getElementsByType("player")) do if getPlayerWantedLevel(players) == 6 then x, y, z = getElementPosition(players) dim = getElementDimension(players) addx = math.random(-15,15) addy = math.random(-15,15) spawnCops(x+addx,y+addy,z,players) end end end end,30000,0) function spawnCops(x,y,z,thePlayer) local dim = 0 call(getResourceFromName("slothbot"), "spawnBot") cop1 = exports.slothbot:spawnBot (x, y, z, 90, 265, 0, dim, getTeamFromName("Citizens"), 22) call(getResourceFromName("slothbot"), "setBotChase") cp1 = exports.slothbot:setBotChase (cop1, thePlayer) end setTimer(function() if getPlayerCount() > 0 then -- checa se tem alguém jogando local players = getElementsByType ( "player" ) -- get a table of all the players in the server for theKey,thePlayer in ipairs(players) do local wlevel = getPlayerWantedLevel(thePlayer) wlevel = wlevel - 1 setPlayerWantedLevel(thePlayer, tonumber(wlevel)) end end end, 60000,0) setTimer(function() local peds = getElementsByType ( "ped" ) -- get a table of all the players in the server for theKey,thePed in ipairs(peds) do call(getResourceFromName("slothbot"), "isPedBot") is = exports.slothbot:isPedBot(thePed) if is then killPed(thePed) end end end, 150000, 0) also i have no idea why the code is shaped so weirdly in here... ERROR: [string "?"]:15: attempt to call global 'type' (a number value) - WTF? What does that mean? To which line it applies? Why it appears? WTF???!
×
×
  • Create New...