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

How to edit .sp files?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mero
Junior Member
Join Date: Feb 2017
Old 04-21-2017 , 19:42   How to edit .sp files?
Reply With Quote #1

Hi guys
editing .sp files is a fix of a problem
but editing it is problem
so here's the problem
I want to make some people VIP
and only VIP (and certainly admin) have access to a command example "sm_resize"
but the problem is I dont want them to use those commands on other people
I want them to have access to a command like "sm_resize {VIP PLAYER NAME}"
So some people told me you can't do this by overrides only, you must edit the plugin
and noticed that I cant edit a smx file, I can edit .sp files only (and then compile it and somethin like that...)
So here's the main question
How can I edit the .sp file
thanks
Mero is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-21-2017 , 23:28   Re: How to edit .sp files?
Reply With Quote #2

Quote:
Originally Posted by Mero View Post
So some people told me you can't do this by overrides only, you must edit the plugin
That information can be both true and false.

If the creator has done his/her work properly, you should be able to override such things easily..

No matter which kind of branch you're in, you can always find people doing things in a lousy way and/or otherwise trying to cut corners where they can. If your plugin has been created by someone like that, then it is possible that the plugin code needs to be altered.

If the plugin you are using is "[ANY] Resize Players - 1.5.1 - 2014/11/20", then you can override "sm_resize" (and all the other "Overrides" listed there), to get the wanted functionality either for specific flags, or for giving specific groups access to that command.

Without a link to (or a copy of) the specific plugin you're have, I'm afraid it won't be possible to help you more than that.


Quote:
Originally Posted by Mero View Post
So here's the main question
How can I edit the .sp file
Open the .sp file with your favorite text editor (nano, vi, vim, mcedit, Notepad, Notepad++, ..., you name it), change what you need to change, save the file and exit your editor.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 04-22-2017 , 05:50   Re: How to edit .sp files?
Reply With Quote #3

Don't forget to compile the .sp after doing so, move the compiled .smx file to plugins folder, and overwrite the previous one. Otherwise, no changes will be made.

Last edited by cravenge; 04-22-2017 at 05:51.
cravenge is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 04-22-2017 , 08:29   Re: How to edit .sp files?
Reply With Quote #4

Quote:
Originally Posted by arne1288 View Post
If the creator has done his/her work properly, you should be able to override such things easily.
This isn't true. Overrides don't know or care about command parameters.
Fyren is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 04-23-2017 , 23:58   Re: How to edit .sp files?
Reply With Quote #5

Quote:
Originally Posted by Fyren View Post
Quote:
Originally Posted by arne1288 View Post
If the creator has done his/her work properly, you should be able to override such things easily.
This isn't true. Overrides don't know or care about command parameters.
Yup, I have to admit I completely missed this part:

Quote:
Originally Posted by Mero View Post
but the problem is I dont want them to use those commands on other people
Closest OP will get to this is probably a combination of overrides (to give access to sm_resize) and immunity levels to prevent lower (and/or equal) immunity level admins using it on others. It would still not be 100% identical to OP's request though. Higher immunity admins would always be able to use it on lower level admins.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-24-2017 , 03:55   Re: How to edit .sp files?
Reply With Quote #6

Quote:
Originally Posted by Fyren View Post
This isn't true. Overrides don't know or care about command parameters.
But overrides can be used to limit whether parameters are accepted.

Something like this:

PHP Code:
public void OnPluginStart() {
    
RegAdminCmd("sm_SomeCommand"cmd_callback0"Some command");
}

public 
Action cmd_callback(int clientint args) {
    
int target client;
    if (
CheckCommandAccess(client"sm_SomeCommand_TargetOthers"ADMFLAG_GENERICtrue) {
        
//declar a char array, get the argument, run it through FindTarget and store the result in 'target'
    
}
    
//the rest of the command's code

__________________

Last edited by ddhoward; 04-24-2017 at 03:56.
ddhoward 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 22:12.


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