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

API Scripting Help [TUT] ZP 5.0 Admin Only class


Post New Thread Reply   
 
Thread Tools Display Modes
bibu
Veteran Member
Join Date: Sep 2010
Old 08-23-2011 , 15:13   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #11

Would be better to put all into one php tag and describe it with a comment the important stuff.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Sp@jk
Member
Join Date: May 2010
Location: Serbia
Old 08-23-2011 , 17:35   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #12

Quote:
Originally Posted by bibu View Post
Would be better to put all into one php tag and describe it with a comment the important stuff.
I think that this is better
Sp@jk is offline
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 08-23-2011 , 18:51   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #13

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

#define VERSION        "1.0"

new iZombieClass // This will be the index of our Admin Zombie class

new Class_NAME[ ] = "ADMIN ZOMBIE"     // Name of the class
new Class_INFO[ ] = "Only for Admins"     // Info of the class
new Class_HEALTH 5000             // Health of the class
new FloatClass_SPEED 1.2        // Speed of the class ( FLOAT | 1.0 = normal )
new FloatClass_GRAVITY 0.5        // Gravity of the class ( FLOAT | 1.0 = normal )


public plugin_init( )
{
    
register_plugin"[ ZP50 ] ADMIN CLASS"VERSION"" )
    
    
iZombieClass zp_class_zombie_registerClass_NAMEClass_INFOClass_HEALTHClass_SPEEDClass_GRAVITY )
    
// Register the class and return the index of the class in class_id
}

/**
 * Called when determining whether a class should be available to a player.
 *
 * Possible return values are:
 *    - ZP_CLASS_AVAILABLE (show in menu, allow selection)
 *    - ZP_CLASS_NOT_AVAILABLE (show in menu, don't allow selection)
 *    - ZP_CLASS_DONT_SHOW (don't show in menu, don't allow selection)
 *
 * @param id            Player index.
 * @param iClassSelected    Internal zombie class ID.
 */
public zp_fw_class_zombie_select_preidiClassSelected )
{
    if( 
iClassSelected == iZombieClass && !is_user_adminid ) ) // The class selected is the Admin Class ? Is the player admin ?
    
{
        
// The player isn't an admin
        
return ZP_CLASS_NOT_AVAILABLE
        
// The player can't select it
    
}
    return 
ZP_CLASS_AVAILABLE
    
// The player is an admin, he's next class will be the Admin Class

__________________

Last edited by bboygrun; 08-23-2011 at 19:00.
bboygrun is offline
Tirant
Veteran Member
Join Date: Jul 2008
Location: Los Angeles, California
Old 08-24-2011 , 05:22   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #14

The final version of classes is much more powerful then this. Admin classes and experience requirements can be build into the classes.
__________________

PM me if you're interested in buying the Credits addition for Base Builder
Battlefield Rebirth [66% done]
Call of Duty: MW2 [100% done]
Base Builder [100% done]
Tirant is offline
styler
Senior Member
Join Date: Oct 2011
Location: Oslo, Norway
Old 11-07-2011 , 05:40   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #15

Wait.. I dont get it..
Are we just gonna add this in top of a .sma file? :s Can you explain how to do this for a noob like me?
styler is offline
Old 11-07-2011, 06:08
JoKeR LauGh
This message has been deleted by JoKeR LauGh.
styler
Senior Member
Join Date: Oct 2011
Location: Oslo, Norway
Old 11-07-2011 , 06:21   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #16

Oh its for human classes :s Nvm :/
styler is offline
CrysisWarHead
Junior Member
Join Date: Aug 2010
Old 11-15-2011 , 16:05   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #17

hi guys convert this zombie class for 5.0
Attached Files
File Type: sma Get Plugin or Get Source (zp_zclass_ragenerate.sma - 482 views - 2.9 KB)
CrysisWarHead is offline
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 11-16-2011 , 13:39   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #18

Quote:
Originally Posted by CrysisWarHead View Post
hi guys convert this zombie class for 5.0
This zombie class should work on 5.0 version, and idk why you are posting in this thread.

EDIT : Lawl in your plug :

PHP Code:
#define PLUGIN "xxx"
#define VERSION "xxx"
#define AUTHOR "xxx

// xxx Zombie Attributes
new const zclass6_name[] = "xxx"
new const zclass6_info[] = "xxx"
new const zclass6_model[] = "xxx"
new const zclass6_clawmodel[] = "xxx"
const zclass6_health xxx
const zclass6_speed xxx
const Float:zclass6_gravity xxx
const Float:zclass6_knockback xxx 
__________________
bboygrun is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 11-16-2011 , 21:29   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #19

xxx ? what plugin is this ?
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Tozy
Junior Member
Join Date: Apr 2010
Old 04-07-2012 , 14:15   Re: [TUT] ZP 5.0 Admin Only class
Reply With Quote #20

But this don't work for ZPA
Quote:
Originally Posted by bartek93tbg View Post
It is possible to make admin class even in ZP 4.3
Just use forward zp_user_infected_pre
example:

Code:
public zp_user_infected_pre(id) 
{
        if((zp_get_user_next_class(id) == your_class_id) && !(get_user_flags(id) & ADMIN_BAN))
        {
            client_print(id, print_chat, "[ZP] Only admins can use this class!")
            zp_set_user_zombie_class(id, 0)
        }
}
Tozy 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 19:29.


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