Raised This Month: $ Target: $400
 0% 

working xp mod tutorial


Post New Thread Reply   
 
Thread Tools Display Modes
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 08-29-2008 , 17:06   Re: working xp mod tutorial
Reply With Quote #11

can you explain, about your 'HLTV' method? Thanks.

I don't want to use hamsandwich
PvtSmithFSSF is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 08-29-2008 , 17:09   Re: working xp mod tutorial
Reply With Quote #12

untested should work just add this and make some changes .
This is just a sample and w.e you might come up whit later should be able to get optimized.
might write a new xp tutorial later.

choice if you wanna use spawn or roundstart.
but all players might not be alive on roundstart and if they join late they wont get there stuff.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>

new max_players

public plugin_init()
{
    
//to give stuff when they spawn
    
RegisterHam(Ham_Spawn"player""Spawn"1)
    
    
//give stuff on new round
    
register_event("HLTV""event_new_round""a""1=0""2=0")
    
max_players get_maxplayers()
}
public 
fwHamPlayerSpawnPost(id)
{
    if(!
is_user_alive(id))return
    
    
//trigger the give stuff function for the player
    
Give_Stuff(id)
    
    
}
public 
Give_Stuff(id)
{
    switch(
PlayerClass[id])
    {
        case 
0:
        {
            
//if they dont got a class show the class menu
            
ChangeClass(id)
        }
        case 
1:
        {
            
//if they are a dog give stuff
            
switch(PlayerLevel[id])
            {
                case 
0:
                {
                    
//if hes lv 0 give these stuff in here
                
}
                case 
2:
                {
                        if(
get_user_team(id) == 1)
                        {
                            
//if hes a lv 2 terrorist give these
                        
}
                }
                case 
1,5,7:
                {
                    
//if hes lv 1 or 5 or 7 give these stuff in here
                
}    
                case 
10..50,70..90:
                {
                    
//if hes lv 10 to 50 or 70 to 90 give these stuff in here
                
}            
            }
        }
        case 
2:
        {
            
//if they are a cat
        
}
        case 
3:
        {
            
//if they are a horse
        
}
        case 
4:
        {
            
//if they are a cow
        
}
    }
}
public 
event_new_round()
{
    new 
team
    
for(new i=1;i<=max_players;i++)
    {
        
//stop if hes not on the server
//you might wanna use is_user_alive and skip the team check here
        
if(!is_user_connected(i))continue
        
        
team=get_user_team(i)
        
//if hes not a ct or t stop
        
if(!team||team>2)continue
        
       
//give him his stuff
        
Give_Stuff(i)
    }

__________________
If one of my plugins become broken, contact me by mail. [email protected]

Last edited by fxfighter; 08-29-2008 at 17:14.
fxfighter is offline
Send a message via MSN to fxfighter
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 08-29-2008 , 17:46   Re: working xp mod tutorial
Reply With Quote #13

Thanks man +karma
PvtSmithFSSF is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-29-2008 , 18:00   Re: working xp mod tutorial
Reply With Quote #14

http://forums.alliedmods.net/showthread.php?t=42159
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 08-30-2008 , 01:19   Re: working xp mod tutorial
Reply With Quote #15

Quote:
Originally Posted by PvtSmithFSSF View Post

I don't want to use hamsandwich
why?
__________________
I am out of order!
grimvh2 is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 08-30-2008 , 13:37   Re: working xp mod tutorial
Reply With Quote #16

Quote:
Originally Posted by Exolent[jNr] View Post
Yah I just found that earlier

@Grimvh2- I thought there was a better way to do it but I guess not. Sorry for that confusion.
PvtSmithFSSF is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 08-30-2008 , 22:02   Re: working xp mod tutorial
Reply With Quote #17

Quote:
Originally Posted by [X]-RayCat View Post
Well you could do it like this:

PHP Code:
 
new m4xp[33];
 
public 
plugin_init()
{
    
register_event("DeathMsg""eDeath""a");


public 
eDeath()
{
    new 
killer read_data(1);
 
    new 
weapon get_user_weapon(killer);
 

    if(
weapon == CSW_M4A1)
        
m4xp[killer] += 10;

    
//and then save data

Could you please elaborate on this and guide me through what to do with "m4xp"
Thanks; I need to know how to do this for a new idea of mine.
PvtSmithFSSF is offline
[X]-RayCat
Senior Member
Join Date: Sep 2006
Old 08-31-2008 , 07:14   Re: working xp mod tutorial
Reply With Quote #18

Quote:
Originally Posted by PvtSmithFSSF View Post
Could you please elaborate on this and guide me through what to do with "m4xp"
Thanks; I need to know how to do this for a new idea of mine.
I think you could do like this -->

(Dont know if it works), but if it works you dont need to make variable for all classes.

Code:
  #define MAXCLASSES 5   new PlayerXP[4][33]   new const CLASSES[MAXCLASSES][] = {     "None",     "Dog",     "Cat",     "Horse",     "Cow" }   enum {     DogXp,     CatXp,     HorseXp,     CowXp, };   public plugin_init() {     register_event("DeathMsg", "eDeath", "a"); }   public eDeath() {     new killer = read_data(1);       new weapon = get_user_weapon(killer);       if(weapon == CSW_M4A1)         PlayerXP[DogXp][killer] += 10;         //and then save data }
[X]-RayCat is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 08-31-2008 , 08:16   Re: working xp mod tutorial
Reply With Quote #19

work
padilha007 is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 08-31-2008 , 09:38   Re: working xp mod tutorial
Reply With Quote #20

I think you need to use tracelines and the TakeDmg event to set how much the weapon damages when it's a certain level. I have no idea how it's done...
But about the new round I already made a new round event all you needed to do was asking me to add a class check...
Anyways, i'll still be glad to help if needed.
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores 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 03:16.


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