unkwn

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About unkwn

  • Rank
    Newbie
  1. Thanks so much, guys! You helped me a lot
  2. Oh, I didn't think it was that bad... Okay, thanks for the answer Can you tell us more about tracking loaded players and sending messages to this segment?
  3. Yes, I have already made this definition. Thanks. But after the fix, another error occurred: server triggered clientside event Zomb_STFU, but event is not added clientside. Although I seem to have added an event: addEvent( "Zomb_STFU", true ) function Zstfu ( ped ) if (isElement(ped)) then setPedVoice(ped, "PED_TYPE_DISABLED") end end addEventHandler( "Zomb_STFU", getRootElement(), Zstfu )
  4. Hello. There is an error in the script. What could be the problem? ERROR: [gameplay]/zombies/zombie_server. Lua:428: attempt to compare number with nil addEvent( "onZombieSpawn", true ) function RanSpawn_Z ( gx, gy, gz, rot, zombieType, row ) local safezone = 0 local allradars = getElementsByType("radararea") for theKey,theradar in ipairs(allradars) do if getElementData(theradar, "zombieProof") == true then if isInsideRadarArea ( theradar, gx, gy ) then safezone = 1 end end end if safezone == 0 then if table.getn ( everyZombie ) < newZombieLimit then --428 line if not rot then rot = math.random (1,359) end local ZombiePedSkins = false; if (zombieType == 1) or (zombieType == 2) then ZombiePedSkins = {10} elseif (zombieType == 3) then ZombiePedSkins = {11} end if (ZombiePedSkins) then local randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), gx, gy, gz ) if (zomb ~= false) then setElementData( zomb, "zombie:type", zombieType ) if zombieType == 1 then setElementData( zomb, "head:n", 1) setElementData( zomb, "head:now", 0 ) elseif zombieType == 2 then exports.extra_health:setElementExtraHealth ( zomb, 400 ) setElementData( zomb, "head:n", 3 ) setElementData( zomb, "head:now", 0 ) elseif zombieType == 3 then setElementData( zomb, "respawn:zombie", row ) exports.extra_health:setElementExtraHealth ( zomb, 800 ) end setElementData ( zomb, "zombie", true ) table.insert( everyZombie, zomb ) setTimer ( function (zomb, rot) if ( isElement ( zomb ) ) then setPedRotation ( zomb, rot ) end end, 500, 1, zomb, rot ) local chaseanim, checkspeed = getZombieType ( zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setPedAnimation ( zomb, "ped", chaseanim, -1, true, true, true ) end end, 1000, 1, zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "status", "idle" ) end end, 2000, 1, zomb ) triggerClientEvent ( "Zomb_STFU", getRootElement(), zomb ) end end end end end addEventHandler( "onZombieSpawn", getRootElement(), RanSpawn_Z )
  5. unkwn

    Bot spawn

    Yes, it really helped, thank you. Can you help me with another error in the same lines? ERROR: [gameplay]/zombies/zombie_server. Lua:428: attempt to compare number with nil if safezone == 0 then if table.getn ( everyZombie ) < newZombieLimit then --428 line if not rot then rot = math.random (1,359) end
  6. unkwn

    Bot spawn

    Hello. Prescribed the issuance of skins to bots by "levels". But I ran into a problem: the first bot will spawn with a random skin, and then there is a spawn on the levels. addEvent( "onZombieSpawn", true ) function RanSpawn_Z ( gx, gy, gz, rot, zombieType, row ) local safezone = 0 local allradars = getElementsByType("radararea") for theKey,theradar in ipairs(allradars) do if getElementData(theradar, "zombieProof") == true then if isInsideRadarArea ( theradar, gx, gy ) then safezone = 1 end end end if safezone == 0 then if table.getn ( everyZombie ) < newZombieLimit then if not rot then rot = math.random (1,359) end randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), gx, gy, gz ) setElementData( zomb, "zombie:type", zombieType ) if zombieType == 1 then ZombiePedSkins = {10} local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), gx, gy, gz ) setElementData( zomb, "head:n", 1) setElementData( zomb, "head:now", 0 ) elseif zombieType == 2 then ZombiePedSkins = {10} exports.extra_health:setElementExtraHealth ( zomb, 400 ) setElementData( zomb, "head:n", 3 ) setElementData( zomb, "head:now", 0 ) elseif zombieType == 3 then ZombiePedSkins = {11} setElementData( zomb, "respawn:zombie", row ) exports.extra_health:setElementExtraHealth ( zomb, 800 ) end if zomb ~= false then setElementData ( zomb, "zombie", true ) table.insert( everyZombie, zomb ) setTimer ( function (zomb, rot) if ( isElement ( zomb ) ) then setPedRotation ( zomb, rot ) end end, 500, 1, zomb, rot ) local chaseanim, checkspeed = getZombieType ( zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setPedAnimation ( zomb, "ped", chaseanim, -1, true, true, true ) end end, 1000, 1, zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "status", "idle" ) end end, 2000, 1, zomb ) triggerClientEvent ( "Zomb_STFU", getRootElement(), zomb ) end end end end addEventHandler( "onZombieSpawn", getRootElement(), RanSpawn_Z ) I think it's related to these lines: randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) local zomb = createPed( tonumber( ZombiePedSkins[randomZskin] ), gx, gy, gz ) setElementData( zomb, "zombie:type", zombieType )