Jump to content

help script not working


Kenix

Recommended Posts

please help I made a script to check on the skins, and Euclidean certain abilities zombie.

server side

  
bronezombies = { 167, 277, 264 }  -- бронерованные зомби 
noheadzombies = { 70, 108, 128, 188, 259 }  -- без головные зомби 
speedzombies = { 92, 162, 206, 209, 212, 229, 230 }     -- скоростные зомби 
firezombies = { 105, 107, 127, 280, 287 }  -- огненные зомби 
  
--                  zombie skins ^^^^^^ 
  
  
  
function zombieclasses () 
if (skinID == bronezombies  )then  
 setPedStat (source, 24, 2000)  -- много хп 
        getGameSpeed (0.7)   -- побочные действия бег медленнее 
        setGravity (0.009)   -- побочные действия меньше прыжки 
        end 
     
if (skinID == noheadzombies  )then  
 setPedHeadless(source, true) 
        end  
if (skinID == speedzombies  )then  
 getGameSpeed (1.3)   -- быстрее бег 
        setPedStat (source, 24, 500)  -- но меньше жизек 
        end  
if (skinID == firezombies  )then  
  setPedOnFire ( source, true )  -- зомби в огне 
        end  
end           
  
--    ability for each class of zombie  ^^^^^^^ 
  

Link to comment
  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Assuming skinID is a number and source is a ped

server side

  
bronezombies = { [167]=true, [277]=true, [264]=true } 
noheadzombies = { [70]=true, [108]=true, [128]=true, [188]=true, [259]=true } 
speedzombies = { [92]=true, [162]=true, [206]=true, [209]=true, [212]=true, [229]=true, [230]=true } 
firezombies = { [105]=true, [107]=true, [127]=true, [280]=true, [287]=true } 
  
function zombieclasses () 
        if (bronezombies[skinID])then  
                setPedStat (source, 24, 2000) 
                setPedGravity (source, 0.009) 
        elseif (noheadzombies[skinID]  )then  
                setPedHeadless(source, true) 
        elseif (speedzombies[skinID]  )then  
                setPedStat (source, 24, 500) 
        elseif (firezombies [skinID] )then  
                setPedOnFire ( source, true ) 
        end  
end           
   

To make them walk faster/slower, you can't use get/setGameSpeed. Maybe blendPedAnimation will help

Link to comment
Assuming skinID is a number and source is a ped

server side

  
bronezombies = { [167]=true, [277]=true, [264]=true } 
noheadzombies = { [70]=true, [108]=true, [128]=true, [188]=true, [259]=true } 
speedzombies = { [92]=true, [162]=true, [206]=true, [209]=true, [212]=true, [229]=true, [230]=true } 
firezombies = { [105]=true, [107]=true, [127]=true, [280]=true, [287]=true } 
  
function zombieclasses () 
        if (bronezombies[skinID])then  
                setPedStat (source, 24, 2000) 
                setPedGravity (source, 0.009) 
        elseif (noheadzombies[skinID]  )then  
                setPedHeadless(source, true) 
        elseif (speedzombies[skinID]  )then  
                setPedStat (source, 24, 500) 
        elseif (firezombies [skinID] )then  
                setPedOnFire ( source, true ) 
        end  
end           
   

To make them walk faster/slower, you can't use get/setGameSpeed. Maybe blendPedAnimation will help

not working :(

Link to comment
You need to finish the script yourself, me or other people can't help if you don't give more info about what you did

I want it to compare with the table skinid skins if == then

go beyond classes

p.s comparison, how-to

Link to comment
Table comparison? You can't use == for that, and you probably don't need it.

Post the rest of the relevant code please, it's too incomplete to make sense.

Shoot, I do not know how well are explained but I'd like to for example the skin 70 I want to compare it with the fact that lower

  
bronezombies = {[167] = true, [277] = true, [264] = true} 
noheadzombies = {[70] = true, [108] = true, [128] = true, [188] = true, [259] = true} 
speedzombies = {[92] = true, [162] = true, [206] = true, [209] = true, [212] = true, [229] = true, [230] = true} 
firezombies = {[105] = true, [107] = true, [127] = true, [280] = true, [287] = true} 
  

check if it matches the class fire zombies then give him power.

Zombie fire, and so with everything.

Link to comment

I altered the script but it still does not work.

  
bronezombies = { 167, 277, 264 }  -- бронерованные зомби 
noheadzombies = { 70, 108, 128, 188, 259 }  -- без головные зомби 
speedzombies = { 92, 162, 206, 209, 212, 229, 230 }     -- скоростные зомби 
firezombies = { 105, 107, 127, 280, 287 }  -- огненные зомби 
  
function table.have ( t, value ) 
  
    if type(t) ~= "table" then return false end 
  
    local k, v = next(t) 
    while k do 
        if v == value then return true end 
        k, v = next( t, k ) 
    end 
  
    return false 
  
end  
  
function zombieclasses () 
if table.have( bronezombies, skinID ) then    
 setPedStat (source, 24, 2000)  -- много хп 
        getGameSpeed (source, 0.7)   -- побочные действия бег медленнее 
        setGravity ( source, 0.009)   -- побочные действия меньше прыжки 
elseif table.have( noheadzombies, skinID ) then  
 setPedHeadless(source, true) 
        end  
if table.have( speedzombies, skinID ) then  
 getGameSpeed (source, 1.3)   -- быстрее бег 
        setPedStat (source, 24, 500)  -- но меньше жизек  
elseif table.have( firezombies, skinID ) then  
  setPedOnFire ( source, true )  -- зомби в огне 
        end  
end 
  

Link to comment
  
bronezombies = { 167, 277, 264 }  -- бронерованные зомби 
noheadzombies = { 70, 108, 128, 188, 259 }  -- без головные зомби 
speedzombies = { 92, 162, 206, 209, 212, 229, 230 }     -- скоростные зомби 
firezombies = { 105, 107, 127, 280, 287 }  -- огненные зомби 
  
function table.have ( t, value ) 
  
    if type(t) ~= "table" then return false end 
  
    for k, v in pairs ( t ) do 
      if ( v == value ) then 
          return true 
      end 
    end 
    return false 
  
end  
  
function zombieclasses ( zombie ) 
  local skinID = getPedSkin ( zombie ) 
  if table.have( bronezombies, skinID ) then    
    setPedStat ( zombie, 24, 2000 )  -- много хп 
    getGameSpeed ( zombie, 0.7 )   -- побочные действия бег медленнее 
    setGravity ( zombie, 0.009)   -- побочные действия меньше прыжки 
  elseif table.have( noheadzombies, skinID ) then  
    setPedHeadless( zombie, true ) 
  elseif table.have( speedzombies, skinID ) then  
    getGameSpeed ( zombie, 1.3 )   -- быстрее бег 
    setPedStat ( zombie, 24, 500 )  -- но меньше жизек  
  elseif table.have( firezombies, skinID ) then  
    setPedOnFire ( zombie, true )  -- зомби в огне 
  end  
end 
  

and

  
setTimer ( zombieclasses, 100, 1, source ) 
  

Link to comment
  
bronezombies = { 167, 277, 264 }  -- бронерованные зомби 
noheadzombies = { 70, 108, 128, 188, 259 }  -- без головные зомби 
speedzombies = { 92, 162, 206, 209, 212, 229, 230 }     -- скоростные зомби 
firezombies = { 105, 107, 127, 280, 287 }  -- огненные зомби 
  
function table.have ( t, value ) 
  
    if type(t) ~= "table" then return false end 
  
    for k, v in pairs ( t ) do 
      if ( v == value ) then 
          return true 
      end 
    end 
    return false 
  
end  
  
function zombieclasses ( zombie ) 
  local skinID = getPedSkin ( zombie ) 
  if table.have( bronezombies, skinID ) then    
    setPedStat ( zombie, 24, 2000 )  -- много хп 
    getGameSpeed ( zombie, 0.7 )   -- побочные действия бег медленнее 
    setGravity ( zombie, 0.009)   -- побочные действия меньше прыжки 
  elseif table.have( noheadzombies, skinID ) then  
    setPedHeadless( zombie, true ) 
  elseif table.have( speedzombies, skinID ) then  
    getGameSpeed ( zombie, 1.3 )   -- быстрее бег 
    setPedStat ( zombie, 24, 500 )  -- но меньше жизек  
  elseif table.have( firezombies, skinID ) then  
    setPedOnFire ( zombie, true )  -- зомби в огне 
  end  
end 
  

and

  
setTimer ( zombieclasses, 100, 1, source ) 
  

not work :(:(:(:(:(:(:(

Link to comment

here's some fixed but it still does not work. :(

  
function zombieclasses ( zombie ) 
  
    if not zombie then return end -- если не указано значение - выход 
  
    local skinID = getElementModel(zombie) 
    if not skinID then return end -- если не удалось узнать скин - выход 
  
    if table.have( bronezombies, skinID ) then 
        setPedStat ( zombie, 24, 2000 )  -- много хп 
        getGameSpeed ( zombie, 0.7 )   -- побочные действия бег медленнее 
        setGravity ( zombie, 0.009)   -- побочные действия меньше прыжки 
    elseif table.have( noheadzombies, skinID ) then 
        setPedHeadless( zombie, true ) 
    elseif table.have( speedzombies, skinID ) then 
        getGameSpeed ( zombie, 1.3 )   -- быстрее бег 
        setPedStat ( zombie, 24, 500 )  -- но меньше жизек 
    elseif table.have( firezombies, skinID ) then  
        setPedOnFire ( zombie, true )  -- зомби в огне 
    end  
  
end 
  

Link to comment

getGameSpeed ( zombie, 0.7 ) -- You can't set game speed for peds/zombies, you'll have to use something else for that. (blendPedAnimation has a speed parameter?)

setGravity ( zombie, 0.009) -- needs to be setPedGravity, like I already told you before...

Link to comment
getGameSpeed ( zombie, 0.7 ) -- You can't set game speed for peds/zombies, you'll have to use something else for that. (blendPedAnimation has a speed parameter?)

setGravity ( zombie, 0.009) -- needs to be setPedGravity, like I already told you before...

not a zombie bots and players

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...