Raised This Month: $51 Target: $400
 12% 

Warn Other Players!


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 15:23   Warn Other Players!
Reply With Quote #1

- 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.
Attached Files
File Type: sma Get Plugin or Get Source (warnplayers.sma - 660 views - 3.1 KB)

Last edited by LemoNSK; 07-18-2018 at 17:17.
LemoNSK is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-18-2018 , 15:23   Re: Warn Other Players!
Reply With Quote #2

Remove the amxx file
__________________
My plugin:
Celena Luna is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 15:25   Re: Warn Other Players!
Reply With Quote #3

Quote:
Originally Posted by Celena Luna View Post
Remove the amxx file
Thanks for making me aware
LemoNSK is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 07-18-2018 , 16:48   Re: Warn Other Players!
Reply With Quote #4

As a newbie I would suggest you to REwrite the whole projecrjt.
__________________
Relaxing is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 16:52   Re: Warn Other Players!
Reply With Quote #5

Quote:
Originally Posted by Relaxing View Post
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..

Last edited by LemoNSK; 07-18-2018 at 16:58.
LemoNSK is offline
Rivotril
Senior Member
Join Date: Feb 2014
Location: Argentina
Old 07-18-2018 , 17:05   Re: Warn Other Players!
Reply With Quote #6

Why don't you use a stock inside the plugin instead of giving a download for the .inc for the colors?
Rivotril is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-18-2018 , 17:15   Re: Warn Other Players!
Reply With Quote #7

Quote:
Originally Posted by Rivotril View Post
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.

Last edited by LemoNSK; 07-18-2018 at 17:22.
LemoNSK is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-18-2018 , 17:55   Re: Warn Other Players!
Reply With Quote #8

Already made:
https://forums.alliedmods.net/showthread.php?t=186670
https://forums.alliedmods.net/showpo...&postcount=550
edon1337 is offline
LemoNSK
Member
Join Date: Jul 2018
Location: Criminal Underworld
Old 07-19-2018 , 00:03   Re: Warn Other Players!
Reply With Quote #9

Ah, ok. At least I tried ;)
LemoNSK is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 07-19-2018 , 05:28   Re: Warn Other Players!
Reply With Quote #10

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
edon1337 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 09:11.


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