[SOLVED]Variable for every player [Help]
Hello guys :)
I am new to plugin scripting and I have started working on a test plugin. My plugin is going to kick or ban you if you say a bad word to many times. My problem is that the variable "warning" is not unique for each player. So my question is, how can I make it unique for each player? Code:
new warning = 0 |
Re: Variable for every player [Help]
Use an array dimensioned with 33 and use it with id as the index.
|
Re: Variable for every player [Help]
Like this?
Code:
new warning[33] = 0 |
Re: Variable for every player [Help]
Yes. However, you can optimize it with a switch
Code:
|
Re: Variable for every player [Help]
You have the array right, but you can improve that function.
If comparing the value of a variable to many thing, like you did, suggest using a switch like this: PHP Code:
PHP Code:
|
Re: Variable for every player [Help]
Ty so much :)
So easy ^^ Can you also explain why i'm gonna use "[33]" ? What does that mean? |
Re: Variable for every player [Help]
Quote:
|
Re: Variable for every player [Help]
The second version was nice :P
EDIT: I would love a little bit more help. But now i gotta go to sleep! Night :) And thank you again! |
Re: Variable for every player [Help]
Quote:
|
Re: Variable for every player [Help]
Quote:
|
| All times are GMT -4. The time now is 11:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.