Kenix Posted January 6, 2011 Share Posted January 6, 2011 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
SDK Posted January 6, 2011 Share Posted January 6, 2011 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
Kenix Posted January 6, 2011 Author Share Posted January 6, 2011 Assuming skinID is a number and source is a pedserver 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
SDK Posted January 6, 2011 Share Posted January 6, 2011 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 Link to comment
Kenix Posted January 6, 2011 Author Share Posted January 6, 2011 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
SDK Posted January 6, 2011 Share Posted January 6, 2011 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. Link to comment
Kenix Posted January 6, 2011 Author Share Posted January 6, 2011 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
Castillo Posted January 7, 2011 Share Posted January 7, 2011 where is your compare function? Link to comment
Kenix Posted January 7, 2011 Author Share Posted January 7, 2011 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. Link to comment
Castillo Posted January 7, 2011 Share Posted January 7, 2011 ... i'm asking how you use: if (skinID == bronezombies )then Link to comment
Kenix Posted January 7, 2011 Author Share Posted January 7, 2011 ... i'm asking how you use: if (skinID == bronezombies )then I compare the current skin with bronezombies. Link to comment
Castillo Posted January 7, 2011 Share Posted January 7, 2011 HOW?! with a COMMAND OR WHAT? Link to comment
Kenix Posted January 7, 2011 Author Share Posted January 7, 2011 HOW?! with a COMMAND OR WHAT? I go to this setTimer function Link to comment
lil Toady Posted January 7, 2011 Share Posted January 7, 2011 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 ) Link to comment
Kenix Posted January 7, 2011 Author Share Posted January 7, 2011 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) Link to comment
Kenix Posted January 8, 2011 Author Share Posted January 8, 2011 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
SDK Posted January 8, 2011 Share Posted January 8, 2011 But where is skinID? And where is source? They dont exist here Link to comment
Castillo Posted January 8, 2011 Share Posted January 8, 2011 SDK, thats why i wanted to know how he using it o_o Link to comment
lil Toady Posted January 8, 2011 Share Posted January 8, 2011 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
Kenix Posted January 8, 2011 Author Share Posted January 8, 2011 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
Kenix Posted January 13, 2011 Author Share Posted January 13, 2011 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
SDK Posted January 13, 2011 Share Posted January 13, 2011 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
Kenix Posted January 13, 2011 Author Share Posted January 13, 2011 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
SDK Posted January 13, 2011 Share Posted January 13, 2011 If it's only players, then you'll have to set the game speed client side, cause setGameSpeed doesnt have a player argument Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now