Raised This Month: $ Target: $400
 0% 

Help with basic scripting


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
samalex
Member
Join Date: Mar 2005
Old 03-29-2005 , 03:27   Help with basic scripting
Reply With Quote #1

Hi, i'm trying to add constellation members (natural-selection) to the admin reserved slot system that comes with amxmod stock....




In the regular admin slot plugin this is the code that checks to see if they are admin:

public client_authorized(id) {
new maxplayers = get_maxplayers()
new players = get_playersnum( 1 )
new limit = maxplayers - get_cvar_num("amx_reservation")
if ( access(id,ADMIN_RESERVATION) || (players <= limit) )
{
#if defined HIDE_RESERVED_SLOTS
setVisibleSlots( players , maxplayers, limit )
#endif
return PLUGIN_CONTINUE
}

client_cmd(id,g_cmdLoopback)

return PLUGIN_HANDLED
}




Now here is the version that ive tried to write to see if they are constellation, and it should work, but it needs to be executed somewhere in the default code above, which i dont know how to do:



public scoreinfo(id)
{
new maxplayers2 = get_maxplayers()
new players2 = get_playersnum( 1 )
new limit2 = maxplayers2 - get_cvar_num("amx_reservation")
if ( read_data(6) != 0 || read_data(6) != 32 || (players2 <= limit2) )
{
#if defined HIDE_RESERVED_SLOTS
setVisibleSlots( players2 , maxplayers2, limit2 )
#endif
return PLUGIN_CONTINUE
}

client_cmd(id,g_cmdLoopback)

return PLUGIN_HANDLED
}


This checks the ScoreInfo to see if they are anything other than a regular person or a regular cheating-death user, if they are, then they are treated like an admin (and given a reserved slot)


the problem i'm running into is making my part of the code execute before the main admin check but still while connecting ie during client_authorize(id)...


The reason i figure this out, is if i put my part of the code in client_authorize(id) then wont it read_data from client_authorize(id) and not scoreinfo(id)???


I appreciate any help
samalex is offline
 



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 10:01.


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