AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reset (https://forums.alliedmods.net/showthread.php?t=244385)

Alphad 07-17-2014 12:32

Reset
 
PHP Code:

#include <amxmodx> 
#include <amxmisc> 

new bool:aaszCommand  128 ]

public 
plugin_init() 

    
register_plugin("SVAA""1.0""AM"
    
register_clcmd("say /aa""clcmdAA"0



public 
clcmdAA id ) {
    
    
aa = !aa
    
    formatex 
szCommandsizeof szCommand -1"sv_airaccelerate %i"aa 100 )
    
server_cmd szCommand )
    
client_print(0print_chat"sv_airaccelerate %i"aa 100 

how could i reset this? like every round the first time you type /aa it wil do 5.
Because I have something that every newround does it set to 100. And if the last thing i typed the round before was to set it to 5. Then at the new round it will go to 100. Tho it is already 100. So reset it somehow evey new round. Is that thing possible?

Eagle07 07-17-2014 12:45

Re: Reset
 
1
PHP Code:

register_event("HLTV""event_new_round""a""1=0""2=0"

2
PHP Code:

public event_new_round()
{
    
server_cmd("sv_airaccelerate 5")



Alphad 07-17-2014 12:55

Re: Reset
 
Quote:

Originally Posted by Eagle07 (Post 2169352)
1
PHP Code:

register_event("HLTV""event_new_round""a""1=0""2=0"

2
PHP Code:

public event_new_round()
{
    
server_cmd("sv_airaccelerate 5")



I know Eagle this is what I did but lets say that i did /aa it went to 100 then again it went to 5. Then on the new round i will have to type it twice to get 100.
So like do on a new round it wont remember what ppl did the round before, reset or something possible?

HamletEagle 07-17-2014 13:03

Re: Reset
 
Why you make another topic ? Reset the bool in hltv event...

Alphad 07-17-2014 13:06

Re: Reset
 
Quote:

Originally Posted by HamletEagle (Post 2169358)
Why you make another topic ? Reset the bool in hltv event...

Sorry, How can i reset a bool? thats the reason i made this topic.
Edit: I did it. Thanks for saying me to reset it man!

Alphad 07-17-2014 14:02

Re: Reset
 
Sorry for double post. Thanks for helping

mottzi 07-17-2014 16:13

Re: Reset
 
Instead of %i use %s and "enabled" and "disabled" in the print function.


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

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