pojedynczy post
  (#17) stare
sebi1717
Forumowy ekspert
 
sebi1717's Avatar
 
Grupa: Użytkownik
Postów: 1,617
Zarejestrowany: Sep 2008
Skąd: Szczecin
Wiek: 15
Karma: B.Dobra

Status: Zagram
Wyślij wiadomość przez Gadu Gadu do użytkownika sebi1717
Odp: PLugin wg. poradnika - 13-11-08, 20:01

Cytat:
Napisał ^^KaMaZZ~.^ Zobacz post
Spróbuj tego:
Kod php:
#include <amxmodx>
#include <amxmisc>
#include <nvault>
#include <csx>

#define MAXCLASSES 6

new const CLASSES[MAXCLASSES][] = {
    
"Dziecko",
    
"Dobry",
    
"Cwanaiczek",
    
"VIP",
    
"Zawodowiec",
    
"PrO"
}

new const 
LEVELS[6] = {
    
100
    
200
    
400
    
800,
    
1600,
    
3200
}

new 
PlayerXP[33],PlayerLevel[33],PlayerClass[33]
new 
XP_Kill,XP_Knife,XP_Hs,SaveXP,g_vault

public plugin_init()
{
    
register_plugin("XpMod""1.0""Fxfighter")
 
    
register_event("DeathMsg""eDeath""a"
 
    
SaveXP register_cvar("SaveXP","1")
    
XP_Kill=register_cvar("XP_per_kill""20")
    
XP_Hs=register_cvar("XP_hs_bonus","20")
    
XP_Knife=register_cvar("XP_knife_bonus","20")
    
g_vault nvault_open("animod")
 
    
register_clcmd("say /class""ChangeClass")
    
register_clcmd("say_team /class""ChangeClass")
    
register_clcmd("say /xp""ShowHud")
    
register_clcmd("say_team /xp""ShowHud")
}

public 
client_death(attacker,victim,weap,hedshot,teamkiller)
{
 
    
PlayerXP[attacker] += get_pcvar_num(XP_Kill)
 
    if(
hedshot)
    
PlayerXP[attacker] += get_pcvar_num(XP_Hs)
 
    if(
weap == CSW_KNIFE)
    
PlayerXP[attacker] += get_pcvar_num(XP_Knife)
 
 
    while(
PlayerXP[attacker] >= LEVELS[PlayerLevel[attacker]])
    {
      
client_print(attackerprint_chat"[Animal Mod] Congratulations! You are a level %i %s!")
      
PlayerLevel[attacker] += 1
    
}
    
ShowHud(attacker)
    
SaveData(attacker)
}

public 
ShowHud(id)
{
    
set_hudmessage(255000.750.0106.015.0)
    
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 ,"Dog""1" 0);
    
menu_additem(menu ,"Cat""2" 0);
    
menu_additem(menu ,"Horse""3" 0);
    
menu_additem(menu ,"Cow""4" 0);
 
    
menu_setprop(menu MPROP_EXIT MEXIT_ALL);
 
    
menu_display(id menu 0);
 
    return 
PLUGIN_CONTINUE;
}

public 
Class_Handle(id menu item
{
    if(
item == MENU_EXIT
    {
 
        
menu_destroy(menu);
 
    }
 
    new 
szCommand[6] , szName[64];
    new 
access callback;
 
    
menu_item_getinfo(menu item access szCommand szName 63 callback);
 
    new 
str_to_num(szCommand)
    if(
PlayerClass[id] != i)
    {
        
PlayerClass[id] = i
        client_print
(id,print_chat,"You are now a %s",CLASSES[i])
    }
    else
    {
        
client_print(id,print_chat,"You are alredy a %s",CLASSES[i])
    }
 
    
menu_destroy(menu);
    return 
PLUGIN_CONTINUE
}

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

public 
client_disconnect(id)
{
    if(
get_pcvar_num(SaveXP) == 1)
    {
 
        
SaveData(id)
    }
    
PlayerXP[id] = 0
    PlayerLevel
[id] = 0
    PlayerClass
[id] = 0
}

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)
    
format(vaultdata,255,"%i#%i#",PlayerXP[id],PlayerLevel[id])
    
nvault_get(g_vault,vaultkey,vaultdata,255)
 
    
replace_all(vaultdata255"#"" ")
 
    new 
playerxp[32], playerlevel[32]
 
    
parse(vaultdataplayerxp31playerlevel31)
 
    
PlayerXP[id] = str_to_num(playerxp)
    
PlayerLevel[id] = str_to_num(playerlevel)
 
    return 
PLUGIN_CONTINUE
    

chodzi mi o to


Zapraszam na serwa!



Wbijać! ;))
Offline sebi1717 jest nieaktywny
 
Najczesciej szukane frazy
Chmura zapytan
amx_ss amxbans battlefield 1942 download bot na puszki boty do cs 1.6 download call of duty 2 download call of duty 4 download cd key do sims 3 cd key do the sims 3 cd key sims 3 cd key the sims 3 config cs config do cs 1.6 counter strike 1.6 do pobrania counter strike 1.6 download counter strike 1.6 download non steam counter strike 1.6 non steam counter strike 1.6 non steam download counter strike 1.6 non steam pobierz counter strike 1.6 pobierz counter strike do pobrania counter strike non steam download counter strike source counter strike source download counter strike source non steam counter strike source non steam download cs cs 1.6 do pobrania cs 1.6 download cs 1.6 download non steam cs 1.6 non steam cs 1.6 non steam download cs 1.6 non steam pobierz cs 1.6 ns download cs 1.6 pobierz cs 1.6 portable cs do pobrania cs forum cs non steam cs non steam download cs patch v32 cs pobierz cs portable cs portable download cs serwery cs source cs source download cs source non steam cs source non steam download cs1.6 non steam download css download darmowe gry steam deathrun deluxe ski jump 2.1 pełna wersja diablo 2 download diablo mod diablo mod cs 1.6 diablomod dodatki do cs dodatki do cs 1.6 download cs 1.6 non steam dsj 2.1 pełna wersja fajny nick fifa 10 download filmy online bez limitu forum cs gamma control gothic 3 download gry java 240x320 gry na telefon download gta 3 pobierz gta 4 do pobrania gta 4 download gta 4 spolszczenie gta iv spolszczenie gta sa download gta san andreas do pobrania gta san andreas download gta san andreas pobierz hard truck download heroes 3 download jak ogladac filmy bez limitu jak zwiekszyc fps klucz do microsoft office 2007 klucz do office 2007 klucz do sims 3 kody do cs kody do cs 1.6 kody do pinball kody do pinballa komendy amx komendy rcon left 4 dead download mapy cs mapy do cs mapy do cs 1.6 mapy do cs 1.6 download microsoft office 2007 klucz milionerzy na telefon modele hltv nfs most wanted download no recoil non steam download numer seryjny do far cry 2 office 2007 klucz patch v32 download pluginy pluginy amx pluginy amxx pobierz cs pobierz cs 1.6 pobierz cs 1.6 non steam pobierz gta san andreas pokemon download rcon komendy roundsound servery cs serwery cs serwery cs 1.6 serwery cs 1.6 non steam serwery diablo mod serwery do cs serwery do cs 1.6 serwery ventrilo sims 1 download sims 2 download sims 2 pobierz sims 3 cd key sims 3 download ski jump 2.1 pełna wersja skoki narciarskie 2006 download skrypt na bh skrypty cs skrypty do cs snikers snikers download spolszczenie do gta 4 spolszczenie gta 4 spyware doctor licencja steam validation rejected swat 4 download test drive unlimited download the sims 1 do pobrania the sims 1 download the sims 1 pobierz the sims 2 download the sims 2 pobierz the sims 3 cd key the sims 3 download twierdza download twierdza krzyżowiec download usdownloader ventrilo 2.1.4 ventrilo 2.1.4 download ventrilo 2.1.4 pobierz vt 2.1.4 www.odsiebie.com zbot zbot download zombie mod cs 1.6