Raised This Month: $32 Target: $400
 8% 

Solved Swapmeroundend


Post New Thread Reply   
 
Thread Tools Display Modes
LenHard
Senior Member
Join Date: Jan 2016
Old 06-20-2018 , 19:46   Re: Swapmeroundend
Reply With Quote #11

Quote:
Originally Posted by mug1wara View Post
It doesn't really work like that Klaus. Let me explain for you.

PHP Code:
g_bSomething = !g_bSomething/* g_bSomething WILL equal to FALSE if set to true */

if (!g_bSomething){} /* IF the value is FALSE */ 
https://wiki.alliedmods.net/Tags_(Scripting)#Boolean
You're incorrect. g_bSomething = !g_bSomething is basically setting it to the opposite variable (from 0 to 1 or 1 to 0). Inside the if statement is a different situation. You could test it out if you'd like
__________________
LenHard is offline
KlausLaw
AlliedModders Donor
Join Date: Feb 2018
Location: Israel
Old 06-20-2018 , 19:55   Re: Swapmeroundend
Reply With Quote #12

Quote:
Originally Posted by mug1wara View Post
It doesn't really work like that Klaus. Let me explain for you.

PHP Code:
g_bSomething = !g_bSomething/* g_bSomething WILL equal to FALSE if set to true */

if (!g_bSomething){} /* IF the value is FALSE */ 
https://wiki.alliedmods.net/Tags_(Scripting)#Boolean
I don't want to argue, just test it and see that i'm right.
__________________
Taking private requests

KlausLaw is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 06-21-2018 , 01:50   Re: Swapmeroundend
Reply With Quote #13

Quote:
Originally Posted by mug1wara View Post
Better using OnClientAuthorized, rather than OnClientPostAdminCheck.
Doesn't matter at all in my code.

Quote:
Originally Posted by mug1wara View Post
This is how I would do it, tested and working well.
Again, like I told you take a look at what the OP requested. Because that's not it. I feel like you're only here to practice coding, there are other sections for that.
__________________
Rohanlogs is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 06-21-2018 , 05:42   Re: Swapmeroundend
Reply With Quote #14

I mixed my thoughts about inside the statements and outside xD. I'm so sorry guys! Mistakes happen, especially when the time is 2 am.

+ Edited my code aswell, should look better.

Last edited by mug1wara; 06-21-2018 at 05:46.
mug1wara is offline
Rohanlogs
Senior Member
Join Date: Nov 2015
Old 06-21-2018 , 08:24   Re: Swapmeroundend
Reply With Quote #15

Quote:
Originally Posted by mug1wara View Post
I mixed my thoughts about inside the statements and outside xD. I'm so sorry guys! Mistakes happen, especially when the time is 2 am.

+ Edited my code aswell, should look better.
That's fine and I like the passion but you should consider all the different cenareos when you're writing your code. Now the problem is that the player will be swapped forever unless they write the command again. So you should set the bool to false on round start. And use some sort of chat messages to let the players know what's going on. Take a look at Klaus's or my version.
__________________
Rohanlogs is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode