• Whats the difference?
    3 replies, posted
I was wondering what would be best to use of these two codes: [lua]if (!success) then gm.player.notify(player, "Test failed!", 1); else player:StripWeapon(class); player:SelectWeapon("test");[/lua] [lua]if (!success) then gm.player.notify(player, "Test failed!", 1); elseif (success) then player:StripWeapon(class); player:SelectWeapon("test");[/lua] ore is it exactly the same thing?
I myself would use the first one.
[QUOTE=Koala;28303303]I myself would use the first one.[/QUOTE] Okay well thanks for the reply and im going to use that then :rolleyes:
They are the exact same things, just that the first one is better optimised. You are basicly asking "If not success then.." and then it can only be one more thing, yeah, success.
Sorry, you need to Log In to post a reply to this thread.