AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Warn Other Players! (https://forums.alliedmods.net/showthread.php?t=309239)

LemoNSK 07-18-2018 15:23

Warn Other Players!
 
2 Attachment(s)
- Warn other players! -


Hello, I've made my code to warn a certain players. You check it and also re-write it if you want. If you want, you can also rate my work. (I know that many of you already know how this all works)

- What it does -
Basically you warn player and after being warned three times, player will be automatically kicked from the server and a message on the screen will be written to all players that the player has been kicked. That's all.


- The End -

I hope this code helps some scripters and can be used in some future plugins you'll be creating. I hope you like it.
Please, excuse me, this is my first code post! If something is wrong, lemme know!
This code is for at least intermediate scripters, i don't suggest it to newbies.

Celena Luna 07-18-2018 15:23

Re: Warn Other Players!
 
Remove the amxx file

LemoNSK 07-18-2018 15:25

Re: Warn Other Players!
 
Quote:

Originally Posted by Celena Luna (Post 2604605)
Remove the amxx file

Thanks for making me aware :)

Relaxing 07-18-2018 16:48

Re: Warn Other Players!
 
As a newbie I would suggest you to REwrite the whole projecrjt.

LemoNSK 07-18-2018 16:52

Re: Warn Other Players!
 
Quote:

Originally Posted by Relaxing (Post 2604646)
As a newbie I would suggest you to REwrite the whole projecrjt.

I've corrected it .. you just have to know at least some basics of AMXX.. I meant to give people a good idea for their servers, that's everything..

Rivotril 07-18-2018 17:05

Re: Warn Other Players!
 
Why don't you use a stock inside the plugin instead of giving a download for the .inc for the colors?

LemoNSK 07-18-2018 17:15

Re: Warn Other Players!
 
Quote:

Originally Posted by Rivotril (Post 2604654)
Why don't you use a stock inside the plugin instead of giving a download for the .inc for the colors?

Thank you for your reply :) But I don't want to do that.

edon1337 07-18-2018 17:55

Re: Warn Other Players!
 
Already made:
https://forums.alliedmods.net/showthread.php?t=186670
https://forums.alliedmods.net/showpo...&postcount=550

LemoNSK 07-19-2018 00:03

Re: Warn Other Players!
 
Ah, ok. At least I tried ;)

edon1337 07-19-2018 05:28

Re: Warn Other Players!
 
Here's some optimization you could do to the code:
1.
PHP Code:

            if(warnedTimes[iPlayer] == 0){
                
warnedTimes[iPlayer]++;
            } else if(
warnedTimes[iPlayer] == 1){
                
warnedTimes[iPlayer]++;
            } else if(
warnedTimes[iPlayer] == 2){
                
warnedTimes[iPlayer]++; 

Instead of if() and else if() you could use switch().

2. You should specify a HUD time because default is 12 seconds
PHP Code:

set_hudmessage(02550, -1.0, -1.6

3.
Player name can't be longer than 32 characters, so you can use [32].
PHP Code:

idName[50



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

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