Raised This Month: $ Target: $400
 0% 

Slot Changer


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 12-08-2012 , 08:10   Re: Slot Changer
Reply With Quote #11

Quote:
slot_pcvar = register_cvar("amx_slotnumber", "32")
Should be registred in precache then.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Bence98007
Member
Join Date: Jun 2012
Old 12-08-2012 , 09:39   Re: Slot Changer
Reply With Quote #12

Quote:
Originally Posted by bibu View Post
Should be registred in precache then.
Fixed!
Bence98007 is offline
myusername
Senior Member
Join Date: Aug 2012
Old 12-08-2012 , 14:01   Re: Slot Changer
Reply With Quote #13

Also when i deleted pcvar then server shutdown instantly. Tested in deathrun server. Slot num 24. The code was like this (I was already installed the orpheu module) Debug mod no error log

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <orpheu_memory>

#define PLUGIN "Slot Changer"
#define VERSION "1.0"
#define AUTHOR "Bence98007"

new dir[256]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()
{
    
get_configsdir(dir255);
    
format(dir255"%s/orpheu/memory/SLOTCHANGER"dir);
    
file_write();
    
    if(
is_module_loaded("orpheu"))
    {
        new 
slot 32
        OrpheuMemoryReplace
("SLOTCHANGER",0,"-maxplayers""%d"random_num(1000000000090000000000))
        
server_cmd("maxplayers %d"slot)
        
log_amx("[SLOT CHANGER] Orpheu module loaded.")
        
log_amx("[SLOT CHANGER] Max slots has been changed to %d"slot)
    }
    else
    {
        
log_amx("[SLOT CHANGER] You need Orpheu, to use Slot Changer!")
    }
}

public 
file_write()
{
    if(!
file_exists(dir))
    {
        
write_file(dir"{")
        
write_file(dir"   ^"name^"        : ^"SLOTCHANGER^",")
        
write_file(dir"   ^"library^"     : ^"engine^",")
        
write_file(dir"   ^"type^"       : ^"string^",")
        
write_file(dir"   ^"memoryType^"  : ^"data^"")
        
write_file(dir"}")
        
log_amx("[SLOT CHANGER] File write complete.")
    }

__________________
Rest in piece.

Last edited by myusername; 12-08-2012 at 14:01.
myusername is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 12-08-2012 , 17:09   Re: Slot Changer
Reply With Quote #14

I think this plugin is useless because if you use that into a Bought Server, your provider cancel your service, if you have a host of your own you change the slots directly. Anyway maxplayers 32 for example into server.cfg do the job.
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!

Last edited by quilhos; 12-08-2012 at 18:08.
quilhos is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 12-08-2012 , 17:47   Re: Slot Changer
Reply With Quote #15

Quote:
Originally Posted by quilhos View Post
maxslots 32
maxplayers 32
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
quilhos
Veteran Member
Join Date: Jun 2010
Old 12-08-2012 , 18:08   Re: Slot Changer
Reply With Quote #16

Yes my bad x)
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 12-09-2012 , 13:29   Re: Slot Changer
Reply With Quote #17

There is no need to use orpheu to do this.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Old 12-09-2012, 21:39
DeteCT0R
This message has been deleted by DeteCT0R.
Bence98007
Member
Join Date: Jun 2012
Old 12-10-2012 , 01:25   Re: Slot Changer
Reply With Quote #18

server_cmd("maxplayers %d", slot)
|
|
V
server_cmd("maxplayers 32")

If you remove the pcvar, you need to remove the pcvar variables.

Quote:
Originally Posted by myusername View Post
Also when i deleted pcvar then server shutdown instantly. Tested in deathrun server. Slot num 24. The code was like this (I was already installed the orpheu module) Debug mod no error log

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <orpheu_memory>

#define PLUGIN "Slot Changer"
#define VERSION "1.0"
#define AUTHOR "Bence98007"

new dir[256]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
plugin_precache()
{
    
get_configsdir(dir255);
    
format(dir255"%s/orpheu/memory/SLOTCHANGER"dir);
    
file_write();
    
    if(
is_module_loaded("orpheu"))
    {
        new 
slot 32
        OrpheuMemoryReplace
("SLOTCHANGER",0,"-maxplayers""%d"random_num(1000000000090000000000))
        
server_cmd("maxplayers %d"slot)
        
log_amx("[SLOT CHANGER] Orpheu module loaded.")
        
log_amx("[SLOT CHANGER] Max slots has been changed to %d"slot)
    }
    else
    {
        
log_amx("[SLOT CHANGER] You need Orpheu, to use Slot Changer!")
    }
}

public 
file_write()
{
    if(!
file_exists(dir))
    {
        
write_file(dir"{")
        
write_file(dir"   ^"name^"        : ^"SLOTCHANGER^",")
        
write_file(dir"   ^"library^"     : ^"engine^",")
        
write_file(dir"   ^"type^"       : ^"string^",")
        
write_file(dir"   ^"memoryType^"  : ^"data^"")
        
write_file(dir"}")
        
log_amx("[SLOT CHANGER] File write complete.")
    }

Bence98007 is offline
Old 12-10-2012, 01:27
Bence98007
This message has been deleted by ConnorMcLeod. Reason: Rules : https://forums.alliedmods.net/misc.php?do=showrules
Old 12-10-2012, 01:29
Bence98007
This message has been deleted by ConnorMcLeod. Reason: Rules : https://forums.alliedmods.net/misc.php?do=showrules
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-10-2012 , 01:40   Re: Slot Changer
Reply With Quote #19

Quote:
Originally Posted by Bence98007 View Post
but some provider dont cancel the service, thats only a plugin, the provider can't delete my server, because i use a plugin!
If you violate their terms they can cancel your service. This will certainly count as violating their terms since you pay for a server with a set number of slots.

Also, don't double/triple post. Learn to use the multi-quote button.
__________________
fysiks is offline
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 12-10-2012 , 02:16   Re: Slot Changer
Reply With Quote #20

PHP Code:
#include <amxmodx>

public plugin_precache()
{
    
server_cmd("maxplayers 32")

__________________
Discord:FluffyDeveloper#4753
Github: https://github.com/francoromaniello
AMX-ES: https://amxmodx-es.com/r0ma'
r0ma is offline
Send a message via MSN to r0ma
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 14:18.


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