Raised This Month: $ Target: $400
 0% 

Making Admins Have Models with Fakemeta


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Huckleberry
Member
Join Date: Nov 2008
Old 11-23-2008 , 20:47   Making Admins Have Models with Fakemeta
Reply With Quote #1

I'm new with fakemeta (first script using it...) & I'm trying to make this script to make a terrorist admin into a specific model. Please tell me what I did wrong, & how to fix it please!
First reply +karma!
Attached Files
File Type: sma Get Plugin or Get Source (admin_t.sma - 146 views - 673 Bytes)
__________________

Blazenblood.com
Huckleberry is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 11-23-2008 , 21:00   Re: Making Admins Have Models with Fakemeta
Reply With Quote #2

Not tested

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "Terrorist Admin"
#define AUTHOR    "Bloodshot"
#define VERSION    "1.0"

new on_offg_maxplayers;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("RoundStart"2"1=Round_Start"
    
on_off register_cvar("admin_terroriston/off""1")
}

public 
plugin_precache() 
{
engfunc(EngFunc_PrecacheModel"models/player/admin_t/terrorist.mdl")
}

public 
RoundStart()
{
    static 
id
    
for (id 1id <= g_maxplayersid++)
    {
        if (
is_user_connected(id))
        {            
            if (
get_pcvar_num(on_off) == 1)
            {
                if ((
get_user_flags(id)&ADMIN_SLAY))
                {
                    
engfunc(EngFunc_SetModelid"terrorist")
                }
            }
        }
    }

__________________

padilha007 is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 11-23-2008 , 21:11   Re: Making Admins Have Models with Fakemeta
Reply With Quote #3

This is much better:

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define PLUGIN    "Terrorist Admin"
#define AUTHOR    "Bloodshot"
#define VERSION    "1.0"

new cvPluginOng_maxplayers;

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("RoundStart"2"1=Round_Start"
    
cvPluginOn register_cvar("admin_terrorist_on""1")
}

public 
plugin_precache() 
{
    
engfunc(EngFunc_PrecacheModel"models/player/admin_t/admin_t.mdl")
}
    
public 
RoundStart()
{
    if(
get_pcvar_num(cvPluginOn))
    {
        for(new 
id 1id <= g_maxplayersid++)
        {
            if( 
is_user_connected(id)
                && (
get_user_flags(id) & ADMIN_SLAY) )
            {
                
engfunc(EngFunc_SetModelid"admin_t")
            }
        }
    }

__________________

Community / No support through PM
danielkza is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2008 , 22:36   Re: Making Admins Have Models with Fakemeta
Reply With Quote #4

EngFunc_SetModel does not work this way.

http://forums.alliedmods.net/showthread.php?t=69386
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Huckleberry
Member
Join Date: Nov 2008
Old 11-23-2008 , 22:42   Re: Making Admins Have Models with Fakemeta
Reply With Quote #5

How do I know when to use a for, & when to use if? What's the difference?
__________________

Blazenblood.com
Huckleberry is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2008 , 22:44   Re: Making Admins Have Models with Fakemeta
Reply With Quote #6

If you don't know the difference, stop coding and read some tutorials.
Search the forums for people who asked for tutorials on how to learn Pawn.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Huckleberry
Member
Join Date: Nov 2008
Old 11-23-2008 , 23:07   Re: Making Admins Have Models with Fakemeta
Reply With Quote #7

It's weird how I have asked... -.-

Exolent I know you hate me, but why are you always being so mean?
__________________

Blazenblood.com
Huckleberry is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-24-2008 , 00:30   Re: Making Admins Have Models with Fakemeta
Reply With Quote #8

Try this : http://forums.alliedmods.net/showthread.php?t=80847

Add this plugin :
Attached Files
File Type: sma Get Plugin or Get Source (admins_models.sma - 673 views - 1.8 KB)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-24-2008 , 07:24   Re: Making Admins Have Models with Fakemeta
Reply With Quote #9

Quote:
Originally Posted by Huckleberry View Post
It's weird how I have asked... -.-

Exolent I know you hate me, but why are you always being so mean?
I don't hate you. If you seriously don't know the difference, you shouldn't be attempting to code. You need to learn the basics before you can try anything.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 11-24-2008 , 08:37   Re: Making Admins Have Models with Fakemeta
Reply With Quote #10

Actually I don't think that way. I don't know basics and still try to code almost everything. Okay maybe I should (learn basics). This had nothing to do with the plugin?
SnoW is offline
Send a message via MSN to SnoW
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 10:39.


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