Jump to content

help script not working


Kenix

Recommended Posts

Posted

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  ^^^^^^^ 
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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

Learn Lua - Learn to script - GUI scripting

Scripter tools - Find/fix errors yourself(!)

Don't pm me for scripting help, keep it for the Scripting subforum!

Posted
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 :(

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
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

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

where is your compare function?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
where is your compare function?

this is my function as

  
if (skinID == bronezombies  )then 
  

a SDK

  
if (bronezombies[skinID])then 
  

both cases is not working.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

... i'm asking how you use:

if (skinID == bronezombies  )then 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
... i'm asking how you use:
if (skinID == bronezombies  )then 

I compare the current skin with bronezombies.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

HOW?! with a COMMAND OR WHAT?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

not source, nor skinID are defined, pass them as extra arguments in your setTimer call

( would have helped if you showed this part of code as well )

Do not PM me, im not going to read it anyway.

Posted
not source, nor skinID are defined, pass them as extra arguments in your setTimer call

( would have helped if you showed this part of code as well )

here.

  
setTimer ( zombieclasses, 100, 1) 
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

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 
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

SDK, thats why i wanted to know how he using it o_o

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
  
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 ) 
  

Do not PM me, im not going to read it anyway.

Posted
  
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 :(:(:(:(:(:(:(

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

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 
  

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted
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

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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