DarkLink Posted July 9, 2011 Share Posted July 9, 2011 Okay guys, hi there again I have some problems here, I dont know how to implement this. So the mapper makes a map for the gamemode, the gamemode can receive 10 cars to spawn them. THEN, I want to calculate the dynamic situation, I mean, when that gamemode start it will check players on. 1ºIF players on are < 4 then I want 2 cars. 2ºIF players on are > 4 and < 8 then I want 6 cars. 3ºIF players on are > 8 then I want 10 cars. The cars is an example, could be, markers for teleport, spawns, flags.. I know that I can make this by simple conditions and in each one call a function. But that would make a large code!! because on 3º condition, the function would have to had the cars of 1º,2º and 3º condition, you see? And on 2º condition, the function would have to had the cars of 1º and 2º condition, you see guys? I talk here about an example, a dynamic situation with 3 conditions. But look if there are more conditions..? each one would have a function, and would have function very long.. Wont cause lag problems? much code? Is there a way to do this with less code? an optimized solution? Thanks in advance, sorry about my bad english Link to comment
DarkLink Posted July 10, 2011 Author Share Posted July 10, 2011 Sorry for double post, but can someone help me? Thanks. Link to comment
Jaysds1 Posted July 10, 2011 Share Posted July 10, 2011 We don't know how to do this, but I'll think... maybe by 2morrow i'll have something. Link to comment
qaisjp Posted July 10, 2011 Share Posted July 10, 2011 Very simple function iif(a,b,c) if a then return b else return c end end then spawnCars(iif(players<4, 2, iif(players>4 and players<8, 6, iif(players>8, 10, 10)))) Link to comment
DarkLink Posted July 10, 2011 Author Share Posted July 10, 2011 Very simple function iif(a,b,c) if a then return b else return c end end then spawnCars(iif(players<4, 2, iif(players>4 and players<8, 6, iif(players>8, 10, 10)))) I think I get it, will try to make something like that . Thanks both 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