SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 25/04/2016, 12:48 PM   #11
Crayder
Banned
 
Join Date: Sep 2013
Location: Flames of Hell
Posts: 3,324
Reputation: 652
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by Gammix View Post
Actually you are right, all time i though strcmp was slower than CallLocalFunction
Well but it won't stop people using ZCMD because it's easier than strcmp

There is no saving system, i won't recommend using SAMP's ban system since its so old, ugly and glitchy. Use your own BAN script. Its really easy to code a custom IP range ban using this maybe.
strcmp IS slower when it's being called hundreds of times per command call. Imagine having like 200 commands and calling the very last one in the callback. ZCMD, YCMD, and iZCMD all call CallLocalFunction a single time!
Crayder is offline   Reply With Quote
Old 25/04/2016, 02:02 PM   #12
codectile
Huge Clucker
 
codectile's Avatar
 
Join Date: Jul 2014
Posts: 248
Reputation: 116
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by Crayder View Post
strcmp IS slower when it's being called hundreds of times per command call. Imagine having like 200 commands and calling the very last one in the callback. ZCMD, YCMD, and iZCMD all call CallLocalFunction a single time!
It is not only strcmp which makes command processing slow, the main culprit behind it, is the if statements. People don't realize if-elseif could really reduce extra unnecessary checks on the following commands. But the performance is same of, "if" and "if-elseif" when the last coded command is executed.
codectile is offline   Reply With Quote
Old 25/04/2016, 02:21 PM   #13
Gammix
High-roller
 
Gammix's Avatar
 
Join Date: Jan 2015
Location: Canada
Posts: 1,773
Reputation: 858
Default Re: Admin System - admin system with many features

Actually my point/argument was that instead of creating a callback and using strcmp all together, only use strcmp and code in the if/elseif statements in case you no longer want to use ZCMD's method.
__________________

Follow me on Github: Donate on Paypal to show your support:

Gammix is offline   Reply With Quote
Old 29/04/2016, 01:30 PM   #14
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 882
Reputation: 317
Default Re: Admin System - admin system with many features

To add more to Crayder's & codectile's point, the CallLocalFunction code runs on the lower level unlike if...else and repeated function calls which add more AMX assembly code which means more instructions to be interpreted by the AMX machine which is why PAWN code is slower.

In fact, CallLocalFunction uses lot of strcmps (does a binary search). Still CallLocalFunction is faster because it isn't PAWN code. The code in CallLocalFunction (amx_FindPublic in the pawn source) is directly executed in the computer unlike PAWN code which is interpreted by the AMX Machine first then executed on the computer.

amx_FindPublic from PAWN Source

@Gammix I want you to check how strcmp is used there and do the necessary corrections to your strcmp FIX in your fixer include. The "<" and ">" symbols used to compare the value returned by strcmp might surprise you.
Yashas is offline   Reply With Quote
Old 03/06/2016, 02:40 PM   #15
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

v1.2

Changes:
"/kick" command is available for admin level 2
Added the ability to display the administration's actions messages to all players
Minor corrections in the localization
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 13/06/2016, 01:18 PM   #16
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

New version 1.3

Changes:
Small optimization
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Old 19/06/2016, 01:44 PM   #17
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

v1.4

Changes:
Compatible with Nexius's Update Checker
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker

Last edited by OstGot; 15/07/2019 at 01:36 PM.
OstGot is offline   Reply With Quote
Old 19/06/2016, 01:51 PM   #18
Max_Andolini
Huge Clucker
 
Max_Andolini's Avatar
 
Join Date: Oct 2013
Posts: 318
Reputation: 37
Default Re: Admin System - admin system with many features

Quote:
Originally Posted by OstGot View Post
v1.4

Changes:
Compatible with Nexius's Update Checker
Add this in nex ac.
Max_Andolini is offline   Reply With Quote
Old 21/06/2016, 11:59 PM   #19
Alnadhiry
Little Clucker
 
Alnadhiry's Avatar
 
Join Date: Oct 2015
Location: London
Posts: 7
Reputation: 1
Default Re: Admin System - admin system with many features

Great work Keep it up.
Alnadhiry is offline   Reply With Quote
Old 27/06/2016, 11:28 AM   #20
OstGot
Gangsta
 
OstGot's Avatar
 
Join Date: Mar 2013
Location: Gomel, Belarus
Posts: 959
Reputation: 347
Default Re: Admin System - admin system with many features

v1.5

Changes:
Added check for some commands (you can't give warn/kick/ban admins higher level)
__________________
aka Nexius
Don't want to always check for updates of my scripts?
Include it the last, after all others
Nexius's Update Checker
OstGot is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Cross Admin System V1.3 [updated] Anti Cheat(sscanf, dcmd,y_ini) and lots more ! No.1 Admin System CROSS_Hunter Filterscripts 9 20/07/2014 06:45 AM
[FilterScript] Cross Admin System V1.2 [updated] + Added IRC System + Anti Cheat(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 21 02/01/2013 06:32 PM
[FilterScript] Cross Admin System V1.1 [updated] + Added V.I.P System(sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 8 10/09/2012 11:18 AM
[FilterScript] Cross Admin System V1.0 (sscanf, dcmd,y_ini) No.1 Admin System CROSS_Hunter Filterscripts 6 09/09/2012 12:01 PM


All times are GMT. The time now is 06:49 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.