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

I try to make mod with xp.


Post New Thread Reply   
 
Thread Tools Display Modes
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 05-31-2008 , 16:12   Re: Try make mod. please help .
Reply With Quote #11

he could've written sqroot(str_to_num(sZCommand)) instead of -1, that would be more incorrect IMO...
[ --<-@ ] Black Rose is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 05-31-2008 , 16:55   Re: Try make mod. please help .
Reply With Quote #12

So I little bit changed it something add/delete/fix with your help but there are still some lines and appear error messages . Please help me at least with plugin beginning . If somebody are not difficult to try compile this plugin and see those errors then it will be nice .
(I try to learn about coding. Sorry if I miss something.)
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.

Last edited by Fry!; 06-07-2008 at 14:55. Reason: .sma not needed anymore
Fry! is offline
DA
Veteran Member
Join Date: Nov 2005
Location: Germany/Münster
Old 05-31-2008 , 20:46   Re: Try make mod. please help .
Reply With Quote #13

You have a public function with the name "PlayerClass" and a global array with the same name. You set the health and the armor from a player without to include the fun modul. And you should declare the var "CLASS_MARINEPRIVATE"...
__________________
DA is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 06-01-2008 , 06:08   Re: Try make mod. please help .
Reply With Quote #14

ok some things I fixed . And some I didn't fix .
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 06-02-2008 , 15:39   Re: Try make mod. please help .
Reply With Quote #15

I can't figured out , how can I fix it. I try , try , try and I don't know . Can someone show demonstration what i did wrong ... Please I really need this .
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.

Last edited by Fry!; 06-07-2008 at 14:56. Reason: .sma not needed anymore
Fry! is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 06-02-2008 , 15:56   Re: Try make mod. please help .
Reply With Quote #16

For probably the fifth time. YOU CAN'T NAME A FUNCTION EXACTLY LIKE A VARIABLE!
[ --<-@ ] Black Rose is offline
Old 06-02-2008, 16:54
Exolent[jNr]
This message has been deleted by Greentryst. Reason: stop repeating other people's posts
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 06-02-2008 , 18:29   Re: Try make mod. please help .
Reply With Quote #17

Ok ,I fixed that meanwhile.
__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.
Fry! is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-04-2008 , 11:03   Re: Try make mod. please help .
Reply With Quote #18

Quote:
Use descriptive topic titles. People should know at a glance of the title what the thread is about.
http://forums.alliedmods.net/showthread.php?t=49470

Failure to fix your topic will result in topic closure
__________________
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
dekken
Veteran Member
Join Date: Jul 2007
Old 06-05-2008 , 05:59   Re: I try to make mod with xp.
Reply With Quote #19

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>

#define MAXCLASSES 6
#define MAXLEVELS 10
#define PLUGIN "BetaMod"
#define VERSION "0.1"
#define AUTHOR "The_Thing"

enum
{
    
PLAYERLEVEL_1,
    
PLAYERLEVEL_2,
    
PLAYERLEVEL_3,
    
PLAYERLEVEL_4,
    
PLAYERLEVEL_5,
    
PLAYERLEVEL_6,
    
PLAYERLEVEL_7,
    
PLAYERLEVEL_8,
    
PLAYERLEVEL_9,
    
PLAYERLEVEL_10

}

enum
{
    
CLASS_NONE 0,
    
CLASS_SOLDIER,
    
CLASS_WIZARD,
    
CLASS_AMAZON,
    
CLASS_GHOST,
    
CLASS_DRAGON
}

new const 
CLASSES[MAXCLASSES][] =
{
    
"None",
    
"Soldier",
    
"Wizard",
    
"Amazon",
    
"GHOST",
    
"Dragon"
}

new const 
LEVELS[MAXLEVELS] =
{
    
0,
    
100,
    
200,
    
350,
    
500,
    
650,
    
800,
    
1000,
    
1200,
    
1450,
}

new 
PlayerXP[33], PlayerLevel[33], PlayerClass[33]
new 
g_vaultidattackerXP_Kill,XP_Knife,XP_Hs,SaveXP

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
register_event("DeathMsg""eDeath""a")

    
SaveXP register_cvar("SaveXP","1")
    
XP_Kill register_cvar("XP_per_kill""15")
    
XP_Hs register_cvar("XP_hs_bonus""25")
    
XP_Knife register_cvar("XP_knife_bonus""30")
    
g_vault nvault_open("BetaMod")

    
register_clcmd("say","check_say")
    
register_clcmd("say_team""check_say")
}


public 
check_say(id)
{
    new 
arg[32]
    
read_argsarg31 )
    
remove_quotes(arg)
    
    if(
equali(arg,"!heroes"))
        
ChangeClass(id)
    
    if(
equali(arg"!info"))
        
ShowHud(id)
}


public 
on_spawn(id)
{
    if (
PlayerClass[id] == CLASS_NONE)
        
ChangeClass(id)
}


public 
eDeath( )
{
    new 
headshot,attacker read_data)
    new 
clipammoweapon get_user_weapon(id,clip,ammo)
    
headshot read_data)
    
    if(
PlayerClass[attacker] == 0)
        return 
PLUGIN_CONTINUE
    
    PlayerXP
[attacker] += get_pcvar_num(XP_Kill)
    
    if(
headshot)
        
PlayerXP[attacker] += get_pcvar_num(XP_Hs)
    
    if(
weapon == CSW_KNIFE)
        
PlayerXP[attacker] += get_pcvar_num(XP_Knife)
    
    while(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]])
    {
        
client_print(attackerprint_chat"[Beta Mod] Cheers ! You are a level %i %s!"PlayerLevel[attacker],CLASSES[PlayerClass[attacker]])
        
PlayerLevel[attacker] += 1
    
}
    
    
ShowHud(attacker)
    
SaveData(attacker)
    return 
PLUGIN_CONTINUE
}


public 
ShowHud(id)
{
    
set_hudmessage(255000.750.0103.03.00.10.11)
    
show_hudmessage(id"Level: %i^nXP: %i^nClass: %s",PlayerLevel[id],PlayerXP[id],CLASSES[PlayerClass[id]])
}


public 
ChangeClass(id)
{
    new 
menu menu_create("Class Menu""Class_Handle");
    
menu_additem(menu ,"Soldier""1" 0);
    
menu_additem(menu ,"Wizard""2" 0);
    
menu_additem(menu ,"Amazon""3" 0);
    
menu_additem(menu ,"GHOST""4" 0);
    
menu_additem(menu ,"Dragon""5" 0);
    
    
menu_setprop(menu MPROP_EXIT MEXIT_ALL);
    
    
menu_display(id menu 0);
    
    return 
PLUGIN_CONTINUE
}


public 
Class_Handle(idmenu item)
{
    new 
szCommand[6] , szName[64]; 
    new 
access callback;
    
menu_item_getinfo(menu item access szCommand szName 63 callback);
    
    new 
ChosenClass str_to_num(szCommand)
    
    if(
PlayerClass[id] != ChosenClass)
    {
        
PlayerClass[id] = ChosenClass 
        client_print
(idprint_chat,"You are now a %s",CLASSES[ChosenClass])
    }
    
    else
    {
        if (
PlayerClass[ChosenClass] == CLASS_NONE)
            
client_print(idprint_chat"You didnt choose any Class!")
        
        else
        {
            
client_print(id,print_chat,"You are already a %s",CLASSES[ChosenClass]);
        }
    } 
    
    return 
PLUGIN_HANDLED
}


public 
client_connect(id)
{
    if(
get_pcvar_num(SaveXP) == 1)
    {
        
LoadData(id)
        
ChangeClass(id)
    }
}


public 
client_disconnect(id

    if(
get_pcvar_num(SaveXP) == 1
     { 

          
SaveData(id
     } 
}


public 
SaveData(id

   
    new 
AuthID[35
    
get_user_authid(id,AuthID,34)
    new 
vaultkey[64],vaultdata[256
 
    
format(vaultkey,63,"%s Mod",AuthID
    
format(vaultdata,255,"%i %i ",PlayerXP[id],PlayerLevel[id]) 
 
    
nvault_set(g_vault,vaultkey,vaultdata
    return 
PLUGIN_CONTINUE 
}


public 
LoadData(id

    new 
AuthID[35
    
get_user_authid(id,AuthID,34
    new 
vaultkey[64],vaultdata[256

    
format(vaultkey,63,"%s Mod",AuthID

    
nvault_get(g_vault,vaultkey,vaultdata,255
    new 
playerxp[32], playerlevel[32
    
parse(vaultdataplayerxp31playerlevel31
    
PlayerXP[id] = str_to_num(playerxp
    
PlayerLevel[id] = str_to_num(playerlevel
    return 
PLUGIN_CONTINUE 



public 
PlayerClass2(id)
{
    if (
PlayerClass[id] == CLASS_SOLDIER)
    {
        switch(
PlayerLevel[id])
        {
            case 
1:
            {
                
set_user_health(id102);
                
give_item(id,"weapon_m249");
            }
            case 
2:
            {
                
set_user_health(id104);
                
set_user_armor(id105);
            }
            case 
3:
            {    
                
set_user_health(id106);
                
set_user_armor(id110);
            }
            case 
4:
            {
                
set_user_health(id108);
                
set_user_armor(id115);
            }
            case 
5:
            {
                
set_user_health(id110);
                
set_user_armor(id120);
            }
            case 
6:
            {
                
set_user_health(id112);
                
set_user_armor(id125);
            }
            case 
7:
            {
                
set_user_health(id114);
                
set_user_armor(id130);
            }
            case 
8:
            {
                
set_user_health(id116);
                
set_user_armor(id135);
            }
            case 
9:
            {
                
set_user_health(id118);
                
set_user_armor(id140)
            }
        }
    }

added few stuff and fix some things...couldn't see any other problems...post if you have any probs
__________________
Signature Goes Here
dekken is offline
Fry!
Veteran Member
Join Date: Apr 2008
Location: Latvia
Old 06-05-2008 , 16:32   Re: I try to make mod with xp.
Reply With Quote #20

wow , thanks for a help dekken . And could someone tell me how to add one weapon model on one of classes because i have one weapon model how can I set that model , example cs_set_playerclass "modelname.mdl" . ?? Thanks .

Ops , appeared error > http://img84.**************/my.php?image=errorux9.jpg

and I forgat I also added some lines in script if this has something to do with that error then correct please .

PHP Code:
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1)
    
    
register_logevent("logevent_round_end"2"1=Round_End")
    
register_clcmd("fullupdate""clcmd_fullupdate"
PHP Code:
public fwHamPlayerSpawnPost(iPlayer)
{
    if (
PlayerClass[id] == CLASS_NONE)
        
ChangeClass(id)
    } 
PHP Code:
public clcmd_fullupdate() 
{
    return 
PLUGIN_HANDLED_MAIN

PHP Code:
public PlayerClass2(id)
{
    if (
PlayerClass[id] == CLASS_SOLDIER)
    {
        switch(
PlayerLevel[id])
        {
            case 
1:
            {
                
set_user_health(id102);
                
give_item(id,"weapon_m249");
            }
            case 
2:
            {
                
set_user_health(id104);
                
set_user_armor(id105);
            }
            case 
3:
            {    
                
set_user_health(id106);
                
set_user_armor(id110);
            }
            case 
4:
            {
                
set_user_health(id108);
                
set_user_armor(id115);
            }
            case 
5:
            {
                
set_user_health(id110);
                
set_user_armor(id120);
            }
            case 
6:
            {
                
set_user_health(id112);
                
set_user_armor(id125);
            }
            case 
7:
            {
                
set_user_health(id114);
                
set_user_armor(id130);
            }
            case 
8:
            {
                
set_user_health(id116);
                
set_user_armor(id135);
            }
            case 
9:
            {
                
set_user_health(id118);
                
set_user_armor(id140)
    }
    case 
10:
    {
        
set_user_health(id120);
        
set_user_armor(id145);
    }
}

    if (
PlayerClass[id] == CLASS_WIZARD)
    {
        switch (
PlayerLevel[id])
        {
            case 
1:
            {
                
set_user_health(id101);
                
set_user_armor(id105);
            }
            case 
2:
            {
                
set_user_health(id102);
                
set_user_armor(id110);
            }
            case 
3:
            {
                
set_user_health(id103);
                
set_user_armor(id115);
            }
            case 
4:
            {
                
set_user_health(id104);
                
set_user_armor(id120);
            }
            case 
5:
            {
                
set_user_health(id105);
                
set_user_armor(id125);
            }
            case 
6:
            {
                
set_user_health(id106);
                
set_user_armor(id130);
            }
            case 
7:
            {
                
set_user_health(id107);
                
set_user_armor(id140);
            }
            case 
8:
            {
                
set_user_health(id108);
                
set_user_armor(id145);
            }
            case 
9:
            {
                
set_user_health(id109);
                
set_user_armor(id150);
            }
            case 
10:
            {
                
set_user_health(id110);
                
set_user_armor(id155);
            }
        }
    }
}

__________________
Quote:
Originally Posted by wisam187
why all the great scriptors..... always.... leave and let their works go into oblivion ???
i miss your way in making outstanding plugins...
this forum needs lots of the likes of you..... and less of the idiots that spread right now.

Last edited by Fry!; 06-05-2008 at 16:55.
Fry! 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 06:33.


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