AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Command used twice (https://forums.alliedmods.net/showthread.php?t=318297)

SID12 08-23-2019 11:51

Command used twice
 
How can i check if a user types a command twice for example : /bhop enables bhop type it again and it disables it or in general is there a way to check this?

Relaxing 08-23-2019 12:29

Re: Command used twice
 
Yep, using booleans.

SID12 08-23-2019 13:05

Re: Command used twice
 
Quote:

Originally Posted by Relaxing (Post 2664414)
Yep, using booleans.

Sounds good thx.

SID12 08-23-2019 13:46

Re: Command used twice
 
Hmm one more thing how do i do that for individual users?XD

Relaxing 08-23-2019 15:17

Re: Command used twice
 
Switch to arrays

Relaxing 08-23-2019 15:31

Re: Command used twice
 
Code:
new array[33]; public command(id){     if (array[id])         array[id] = 0;     else array[id] = 1;     if (array[id]){         // activated     } else {         // deactivated     } }

SID12 08-24-2019 09:06

Re: Command used twice
 
That was very useful indeed thx :).


All times are GMT -4. The time now is 17:04.

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