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

Vip with custom flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 03-24-2013 , 08:19   Vip with custom flags
Reply With Quote #1

So, because everyone wants vips without admin acces i was thinking at something like this:

PHP Code:
new const gUserFlags[4][] = {

   
"bvwx",
   
"bvwx",
   
"bwx",
   
"bx"
}; 
in this part it's working:
PHP Code:
public resetModel(id
{
        if (
get_user_flags(id) == gFlagsValue[0]) 
        {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T
        {
                        
cs_set_user_model(id"vip_t_model")
                }
                else if(
userTeam == CS_TEAM_CT
        {
                        
cs_set_user_model(id"vip_ct_model")
                }
                else 
        {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE

i don't know if is the best way, but i'm still learning
my problem is here, i know it's wrong and doesn't work

PHP Code:
public on_damage(id)
{
    if(
get_pcvar_num(g_type))
    {
        static 
attackerattacker get_user_attacker(id)
        static 
damagedamage read_data(2)    

        if(
is_user_connected(attacker) && get_user_flags(attacker) == gFlagsValue[0])    
        {
            
            if(
fm_is_ent_visible(attacker,id))
            {
                
set_hudmessage(0100200, -1.00.5520.14.00.020.02, -1)
                
ShowSyncHudMsg(attackerg_hudmsg"%i^n"damage)                
            }
                    
                
        }
    }


Last edited by zi443r; 03-24-2013 at 17:23.
zi443r is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 03-24-2013 , 14:05   Re: Vip with custom flags
Reply With Quote #2

You are not even using 'gUserFlags'. Am I missing something here?
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 is offline
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 03-24-2013 , 17:01   Re: Vip with custom flags
Reply With Quote #3

now you understand?

PHP Code:
new const gUserFlags[4][] = {
   
"bvwx",
   
"bvwx",
   
"bwx",
   
"bx"
};
new 
gFlagsValue[sizeof gUserFlags];
for(new 
0sizeof gUserFlagsi++)
gFlagsValue[i] = read_flags(gUserFlags[i]); 
zi443r is offline
tonykaram1993
Senior Member
Join Date: Mar 2013
Location: This World
Old 03-24-2013 , 17:26   Re: Vip with custom flags
Reply With Quote #4

Quote:
Originally Posted by zi443r View Post
now you understand?

PHP Code:
new const gUserFlags[4][] = {
   
"bvwx",
   
"bvwx",
   
"bwx",
   
"bx"
};
new 
gFlagsValue[sizeof gUserFlags];
for(new 
0sizeof gUserFlagsi++)
gFlagsValue[i] = read_flags(gUserFlags[i]); 
First, the following is wrong:
PHP Code:
for(new 0sizeof gUserFlagsi++)
// Should be 
for(new 0sizeof gUserFlags 1i++) 
And I still don't understand what you want to do or how things work. If you want assistance, provide the full code, I might understand then.
__________________
My Plugins:
UltimatePlugin
UltimateSurf
UltimateAdmin
Code:
rcon version | rcon amxx version | rcon meta version
rcon amxx plugins | rcon meta list | rcon status
I AM INACTIVE ON THIS FORUM - For direct contact: [email protected]
tonykaram1993 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-25-2013 , 09:56   Re: Vip with custom flags
Reply With Quote #5

Quote:
Originally Posted by tonykaram1993 View Post
First, the following is wrong:
PHP Code:
for(new 0sizeof gUserFlagsi++)
// Should be 
for(new 0sizeof gUserFlags 1i++) 
Wrong, it was correct berfore
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
zi443r
Senior Member
Join Date: Mar 2009
Location: Braila,Romania
Old 03-25-2013 , 12:52   Re: Vip with custom flags
Reply With Quote #6

thank you YamiKaitou. your post helped me to solve my problem but now i encountered another problem.
now, it's only working just for one class of vips like:

PHP Code:
if (get_user_flags(id) == gFlagsValue[0]) 
{.......}
if (
get_user_flags(id) == gFlagsValue[1]) 
{.......}
if (
get_user_flags(id) == gFlagsValue[2]) 
{.......}
if (
get_user_flags(id) == gFlagsValue[3]) 
so, i want some functions to work on multiple classes, like:
PHP Code:
if (get_user_flags(id) == gFlagsValue[0]||gFlagsValue[1])  //this is wrong
if (get_user_flags(id) == gFlagsValue[0]||get_user_flags(id) ==gFlagsValue[1]) //this is working 
i'm a genius, first copy-paste plugin made)
thank you guys for helping me

Last edited by zi443r; 03-25-2013 at 14:13.
zi443r 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 08:09.


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