Raised This Month: $32 Target: $400
 8% 

Pedido comando


  
 
 
Thread Tools Display Modes
Author Message
Choop
Junior Member
Join Date: Sep 2013
Old 09-30-2013 , 14:03   Pedido comando
#1

Buenas a todos, necesito anexarle un comando a mi server surf+levels osea, el comando de dar levels a traves de consola que solo lo puedan utilizar los admin y que me ayuden a como anexarlo ya que soy nuevo gracias a toda la gente de alliedmodders, si hay algun error con el post avise gracias
Choop is offline
zlChileanFlylz
Member
Join Date: Feb 2013
Location: Chile e,e
Old 09-30-2013 , 14:39   Re: Pedido comando
#2

Esto uso en ZP; adaptalo

PHP Code:
//registramos :P
register_concmd("zp_dar""dar"ADMIN_RCON)

//funcion
public dar(idlevelcid)
{
    if(
get_user_flags(id) & ADMIN_RCON && is_user_connected(id))
    {
        new 
nombre[32], nivel[32], packs[32], razon[32], resets[32]
    
        
read_argv(1nombrecharsmax(nombre))
        
read_argv(2nivelcharsmax(nivel))
        
read_argv(3packscharsmax(packs))
        
read_argv(4resetscharsmax(resets))
        
read_argv(5razoncharsmax(razon))
    
        new 
id2 cmd_target(idnombre0)
    
        
zp_set_user_level(id2str_to_num(nivel)) // Tambien puede ser varieble ej: g_level[id2] += str_to_num(nivel)
        
zp_set_user_ammo_packs(id2str_to_num(packs))   
        
zp_set_user_reset(id2str_to_num(resets))
        
        
client_print(id2print_chat"Te Han Dado: %d Nivel; %d AP's Y %d Resets."str_to_num(nivel), str_to_num(packs), str_to_num(resets))
        
        static 
name[60]
        
get_user_name(id2namesizeof name 1)
        
        
replace_all(razoncharsmax(razon), "-"" ")
        
replace_all(razoncharsmax(razon), "_"" ")
        
        
client_print(0print_chat"Han Dado: %d Nivel; %d AP's Y %d Resets A: %s Razon: %s"str_to_num(nivel), str_to_num(packs), str_to_num(resets), namerazon)
        
client_print(0print_console"Han Dado: %d Nivel; %d AP's Y %d Resets A: %s Razon: %s"str_to_num(nivel), str_to_num(packs), str_to_num(resets), namerazon)
        
        
zp_check_level(id2)
    }

__________________
My Steam
-------Proyect's-------
Zp Edit 20%
-----------------------
I Speak Spanish No English

Last edited by zlChileanFlylz; 09-30-2013 at 14:46.
zlChileanFlylz is offline
Choop
Junior Member
Join Date: Sep 2013
Old 09-30-2013 , 14:58   Re: Pedido comando
#3

Pero me ayudas a como adaptarlo esque soy nuevo ayudame donde pongo cada cosa si pudieras gracias
Choop is offline
zlChileanFlylz
Member
Join Date: Feb 2013
Location: Chile e,e
Old 09-30-2013 , 15:03   Re: Pedido comando
#4

Ok; por PM
__________________
My Steam
-------Proyect's-------
Zp Edit 20%
-----------------------
I Speak Spanish No English
zlChileanFlylz is offline
Choop
Junior Member
Join Date: Sep 2013
Old 09-30-2013 , 15:04   Re: Pedido comando
#5

Pm?
Choop is offline
zlChileanFlylz
Member
Join Date: Feb 2013
Location: Chile e,e
Old 09-30-2013 , 15:10   Re: Pedido comando
#6

Private Message(s) Por Donde Sale El Search, Buscador.
__________________
My Steam
-------Proyect's-------
Zp Edit 20%
-----------------------
I Speak Spanish No English
zlChileanFlylz is offline
Choop
Junior Member
Join Date: Sep 2013
Old 09-30-2013 , 15:23   Re: Pedido comando
#7

PHP Code:
/* Include some modules */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>

/* Who made this bad coded plugin? */
#define PLUGIN    "SURF XP MOD"
#define AUTHOR    "Ardivaba"
#define VERSION    "1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Enum for tutor colors */
enum
{
    
RED 1,
    
BLUE,
    
YELLOW,
    
GREEN
}

/* Precache array for tutor */
new const g_TutorPrecache[][] = {
    
"gfx/career/icon_!.tga",
    
"gfx/career/icon_!-bigger.tga",
    
"gfx/career/icon_i.tga",
    
"gfx/career/icon_i-bigger.tga",
    
"gfx/career/icon_skulls.tga",
    
"gfx/career/round_corner_ne.tga",
    
"gfx/career/round_corner_nw.tga",
    
"gfx/career/round_corner_se.tga",
    
"gfx/career/round_corner_sw.tga",
    
"resource/TutorScheme.res",
    
"resource/UI/TutorTextWindow.res"
}

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose

/* gCvars :( */
new gCvarNozoom

/* So many levels...oh my f**in god */
new const LEVELS[9999] =
{
    
50,
    
100,
    
200,
    
400,
    
600,
    
800,
    
1000,
    
1200,
    
1400,
    
1600,
    
1800,
    
2000,
    
2200,
    
2400,
    
2600,
    
2800,
    
3000,
    
3200,
    
3400,
    
3600,
    
3800,
    
4000,
    
4200,
    
4400,
    
4600,
    
4800,
    
5000,
    
5200,
    
5400,
    
5600,
    
5800,
    
6000,
    
6200,
    
6400,
    
6600,
    
6800,
    
7000,
    
7200,
    
7400,
    
7600,
    
7800,
    
8000,
    
8200,
    
8400,
    
8600,
    
8800,
    
9000,
    
9200,
    
9400,
    
9600,
    
9800,
    
10000,
    
10200,
    
10400,
    
10600,
    
10800,
    
11000,
    
11200,
    
11400,
    
11600,
    
11800,
    
12000,
    
12200,
    
12400,
    
12600,
    
12800,
    
13000,
    
13200,
    
13400,
    
13600,
    
13800,
    
14000,
    
14200,
    
14400,
    
14600,
    
14800,
    
15000,
    
15200,
    
15400,
    
15600,
    
15800,
    
16000,
    
16200,
    
16400,
    
16600,
    
16800,
    
17000,
    
17200,
    
17400,
    
17600,
    
17800,
    
18000,
    
18200,
    
18400,
    
18600,
    
18800,
    
19000,
    
19200,
    
19400,
    
19600,
    
19800,
    
20000,
    
20200,
    
20400,
    
20600,
    
20800,
    
21000,
    
21200,
    
21400,
    
21600,
    
21800,
    
22000,
    
22200,
    
22400,
    
22600,
    
22800,
    
23000,
    
23200,
    
23400,
    
23600,
    
23800,
    
24000,
    
24200,
    
24400,
    
24600,
    
24800,
    
25000,
    
25200,
    
25400,
    
25600,
    
25800,
    
26000,
    
26200,
    
26400,
    
26600,
    
26800,
    
27000,
    
27200,
    
27400,
    
27600,
    
27800,
    
28000,
    
28200,
    
28400,
    
28600,
    
28800,
    
29000,
    
29200,
    
29400,
    
29600,
    
29800,
    
30000,
    
30200,
    
30400,
    
30600,
    
30800,
    
31000,
    
31200,
    
31400,
    
31600,
    
31800,
    
32000,
    
32200,
    
32400,
    
32600,
    
32800,
    
33000,
    
33200,
    
33400,
    
33600,
    
33800,
    
34000,
    
34200,
    
34400,
    
34600,
    
34800,
    
35000,
    
35200,
    
35400,
    
35600,
    
35800,
    
36000,
    
36200,
    
36400,
    
36600,
    
36800,
    
37000,
    
37200,
    
37400,
    
37600,
    
37800,
    
38000,
    
38200,
    
38400,
    
38600,
    
38800,
    
39000,
    
39200,
    
39400,
    
39600,
    
40000,
    
45000,
    
50000,
    
50001,
    
60000,
    
70000,
    
80000,
    
90000,
    
99999,
}

new 
PXP33 ]
new 
PLEVEL33 ]
new 
PKS33 ]
new 
g_vault

public plugin_init()
{
    
//You want credits? Take credits...you stealz0rs
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//You poor little guy died, what we gonna do now?
    
register_event"DeathMsg""EventDeathMsg""a" )
    
    
//All kinds of information
    
register_clcmd"say /xp""printXp", -1"Print player Xp" )
    
register_clcmd"say /level""printLevel", -1"Print player level" )
    
register_clcmd"say /newlevel""printNewLevel", -1"Print player how many xp left to new level" )
    
register_clcmd"say /help""printHelp", -1"Print help" )
    
register_clcmd"say /info""printInfo", -1"Print info" )
    
register_clcmd"say /weapons""printWeapons", -1"Print weapon unlocks" )
    
    
//Nozoom stuff
    
register_event("SetFOV","zoom","b","1<90"
    
register_event("CurWeapon","ev_CurWeapon""be""1=1")
    
    
//Meat...mmmm, delicious ham
    
RegisterHam(Ham_Spawn"player""EventPlayerSpawn"1)
    
RegisterHam(Ham_TakeDamage"player""fwHamTakeDamage")
    
    
//nVault stuff
    
g_vault nvault_open("SURFXPMOD")
    
    
//Tutor stuff
    
g_MsgTutor get_user_msgid("TutorText")
    
g_MsgTutClose get_user_msgid("TutorClose")
    
    
//Those annoying cvars...for the community :(
    
gCvarNozoom register_cvar("sxm_nozoom""0"00.0)
}

/* Precache resources */
public plugin_precache()
{
    
precache_sound(MSOUND)
    
    new 
i
    
    
for(0sizeof g_TutorPrecachei++) precache_generic(g_TutorPrecache[i])
    
    
precache_model("models/customs/v_gknife.mdl")
    
    
precache_model("models/customs/v_gdeagle.mdl")
    
    
precache_model("models/customs/v_gelite.mdl")
    
    
precache_model("models/1/v_hegrenade.mdl")
    
    
precache_model("models/customs/v_xm1014.mdl")
    
    
precache_model("models/customs/v_m4a1.mdl")
        
    
precache_model("models/customs/v_ak47.mdl")
    
    
precache_model("models/customs/v_m3.mdl")
    
    
precache_model("models/custom/v_m3.mdl")
    
    
precache_model("models/custom/v_xm1014.mdl")
    
    
precache_model("models/custom/v_mp5.mdl")
    
    
precache_model("models/custom/v_m4a1.mdl")
    
    
precache_model("models/custom/v_g3sg1.mdl")
    
    
precache_model("models/custom/v_ak47.mdl")
    
    
precache_model("models/custom/v_glock18.mdl")
    
    
precache_model("models/custom/v_usp.mdl")
    
    
precache_model("models/1/v_ak47.mdl")
    
    
precache_model("models/1/v_m4a1.mdl")
    
    
precache_model("models/1/v_m3.mdl")
    
    
precache_model("models/1/v_xm1014.mdl")
    
}

public 
client_connectid )
{
    
PXPid ] = 0
    LoadData
id )
}

public 
client_disconnectid )
{
    
SaveDataid )
    
PXPid ] = 0
    PLEVEL
id ] = 0
    PKS
id ] = 0
}

public 
EventPlayerSpawnid )
{
    new 
health
    
new newhealth
    
new money
    
new newmoney
    
new armor
    
new newarmor
    
    money 
cs_get_user_moneyid )
    
newmoney money + (PLEVELid ] * 100)
    
cs_set_user_moneyidnewmoney)
    
    if( 
PLEVELid ] <= 25 )
    {
        
health get_user_healthid )
        
newhealth health + (PLEVELid ])
        
set_user_healthidnewhealth )
    }
    else
    {
        
health get_user_healthid )
        
newhealth 125
        
        armor 
get_user_armorid )
        
newarmor armor + ((PLEVELid ]) - 25)
        
set_user_armoridnewarmor )
        
set_user_healthidnewhealth )
    }
}

public 
EventDeathMsg()
{
    new 
killer read_data)
    new 
victim read_data)
    new 
headshot read_data)
    new 
xp
    
new hs
    
    
if(PLEVELkiller ] > PLEVELvictim ])
    {
        
xp 15000
    
}
    
    if(
PLEVELkiller ] < PLEVELvictim ])
    {
        
xp 150000
    
}
    
    if(
PLEVELkiller ] == PLEVELvictim ])
    {
        
xp 12000000
    
}
    
    
PKSvictim ] = 0
    
    
if( victim == killer )
    {
        return 
PLUGIN_CONTINUE
    
}
    
    if(
headshot)
    {
        
xp xp 9060
        hs 
1
    
}
    
    if(
PKSkiller ] < 10)
    {
        
PKSkiller ]++
    }
    
    
xp xp PKSkiller ]
    
    
add_xpkillerxphs )
    
check_levelkiller )
    
    new 
Text100 ]
    
formatex(Text,191,"You died and lost your killstreak!")
    
MakeTutor(victim,Text,RED,3.0)
}

/* Add xp */
public add_xpidxphs )
{
    new 
newlevel LEVELS[PLEVELid ]]-PXPid ]
    
    
PXPid ] = PXPid ] + xp
    
    
if(hs)
    {
        new 
Text100 ]
        
formatex(Text,191,"Headshot! You got %d xp! ^nKillstreak: %d^nNew level after %d xp!"xpPKSid ], newlevel)
        
MakeTutor(id,Text,GREEN,3.0)
    }
    else
    {
        new 
Text100 ]
        
formatex(Text,191,"You got %d xp! ^nKillstreak: %d^nNew level after %d xp!"xpPKSid ], newlevel)
        
MakeTutor(id,Text,GREEN,3.0)
    }
}

/* Lets check if player got a new level */
public check_levelid )
{
    if(
PXPid ] >= LEVELS[PLEVELid ]])
    {
        
PLEVELid ]++
        new 
Text100 ]
        
formatex(Text,191,"You are now level %d!"PLEVELid ])
        
MakeTutor(id,Text,GREEN,5.0)
    }
}

/* Lets print the list of weapon achievments */
public printWeaponsid )
{
    new 
Text255 ]
    
formatex(Text,191,
    
"LEVEL 5 Unlock^nGolden Knife^n^nLEVEL 7 Unlock^nGolden Elites^n^nLEVEL 10 Unlock^nGolden Deagle^n^nLevel 15 Unlock^nGerman Grenade")
    
MakeTutor(id,Text,YELLOW,7.0)
}

public 
printHelpid )
{
    
//new Text[ 255 ]
    //formatex(Text,191,
    //"Selleks, et vaadata enda levelit kirjuta:^n/level ^nSelleks, et vaadata enda XPd kirjuta:^n/xp^nSelleks, et vaadata millal uus level tuleb kirjuta:^n/uuslevel^n^nSelleks, et vaadata millal mis relva lahti saad kirjuta:^n/relvad")
    //MakeTutor(id,Text,YELLOW,7.0)
}

/* Plugin information */
public printInfoid )
{
    new 
Text255 ]
    
formatex(Text,191,
    
"What is SURF XP MOD?^n-SXM is mod created by Ardivaba for surf server^n^nWhat can i do with levels?^n-Levels reward you HP, starting money and golden weapons")
    
MakeTutor(id,Text,YELLOW,7.0)
}

/* Lets print players ammount of xp */
public printXpid )
{
    new 
Text100 ]
    
formatex(Text,191,"You have %d xp!"PXPid ])
    
MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print when player get's new level */
public printNewLevelid )
{
    new 
newlevel LEVELS[PLEVELid ]]-PXPid ]
    new 
Text100 ]
    
formatex(Text,191,"New level after %d xp!"newlevel)
    
MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print players level */
public printLevelid )
{
    
    new 
Text100 ]
    
formatex(Text,191,"Your level is %d!"PLEVELid ])
    
MakeTutor(id,Text,YELLOW,3.0)
}

/* Save Data to nVault */
public SaveData(id)
{
    new 
AuthID[35]
    
get_user_name(id,AuthID,34)
    
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-Mod",AuthID)
    
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
    
nvault_set(g_vault,vaultkey,vaultdata)
    return 
PLUGIN_CONTINUE
}

/* Load Data  from nVault */
public LoadData(id)
{
    new 
AuthID[35]
    
get_user_name(id,AuthID,34)
    
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-Mod",AuthID)
    
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
    
nvault_get(g_vault,vaultkey,vaultdata,255)
    
    
replace_all(vaultdata255"#"" ")
    
    new 
playerxp[32], playerlevel[32]
    
    
parse(vaultdataplayerxp31playerlevel31)
    
    
PXP[id] = str_to_num(playerxp)
    
PLEVEL[id] = str_to_num(playerlevel)
    
    return 
PLUGIN_CONTINUE
}

/* Teeme tutori teksti */
MakeTutor(id,Text[],Color,Float:Time 0.0) {
    
    
client_cmdid"spk %s"MSOUND )
    
    if(
is_user_connectedid ))
    {
        
message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
        
write_string(Text)
        
write_byte(0)
        
write_short(0)
        
write_short(0)
        
write_short(1<<Color)
        
message_end()
    }
    
    if(
Time != 0.0) {
        
        if( 
task_existsid TASK_TUT ) )
        {
            
remove_taskid TASK_TUT )
        }
        
        
set_task(Time,"RemoveTutor",id TASK_TUT)
    }
}

/* Lets Remove Tutor */
public RemoveTutor(taskID) {
    
    new 
id taskID TASK_TUT
    message_begin
(MSG_ALL,g_MsgTutClose,_,id)
    
message_end()
}

public 
zoomid )
{
    if(
gCvarNozoom)
    {
        
client_cmdid"drop" )
    }
}

/* Golden Weapons */

public ev_CurWeapon(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id)) 
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
Weapon_Id read_data(2)
    
    
/* Golden Knife */
    
if(Weapon_Id == CSW_KNIFE && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_gknife.mdl")
    }
    
    
/* Golden Elites */
    
if(Weapon_Id == CSW_ELITE && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_gelite.mdl")
    }
    
    
/* Golden Deagle */
    
if(Weapon_Id == CSW_DEAGLE && PLEVELid ] >= 10 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_gdeagle.mdl")
    }
    
    
/* German Grenade */
    
if(Weapon_Id == CSW_HEGRENADE && PLEVELid ] >= 15 
    {
        
set_pev(idpev_viewmodel2"models/1/v_hegrenade.mdl")
    }
    
    
/* XMF 1 */
    
if(Weapon_Id == CSW_XM1014 && PLEVELid ] >= 400 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_xm1014.mdl")
    }
    
    
/* M4A1 */
    
if(Weapon_Id == CSW_M4A1 && PLEVELid ] >= 50 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_m4a1.mdl")
         }
    
    
/* AK-47 */
    
if(Weapon_Id == CSW_AK47 && PLEVELid ] >= 45 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_ak47.mdl")
         }
    
    
/* M3 1 */
    
if(Weapon_Id == CSW_M3 && PLEVELid ] >= 500 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_m3.mdl")
    }
    
    
/* M3 2 */
    
if(Weapon_Id == CSW_M3 && PLEVELid ] >= 320 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_m3.mdl")
    }
    
    
/* XMF 2 */
    
if(Weapon_Id == CSW_XM1014 && PLEVELid ] >= 501 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_xm1014.mdl")
    }
    
    
/* MP 5 */
    
if(Weapon_Id == CSW_MP5NAVY && PLEVELid ] >= 25 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_mp5.mdl")
    }
    
    
/* M4a1 2 */
    
if(Weapon_Id == CSW_M4A1 && PLEVELid ] >= 200 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_m4a1.mdl")
    }
    
    
/* G3s1 */
    
if(Weapon_Id == CSW_G3SG1 && PLEVELid ] >= 180 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_g3sg1.mdl")
    }
    
    
/* Ak 47 2 */
    
if(Weapon_Id == CSW_AK47 && PLEVELid ] >= 205 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_ak47.mdl")
    }
    
    
/* Usp */
    
if(Weapon_Id == CSW_USP && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_usp.mdl")
    }    
    
    
/* Glock */
    
if(Weapon_Id == CSW_GLOCK18 && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_glock18.mdl")
    }    
    
    
/* AK 6 */
    
if(Weapon_Id == CSW_AK47 && PLEVELid ] >= 310 
    {
        
set_pev(idpev_viewmodel2"models/1/v_ak47.mdl")
    }    
    
    
/* m4a1 sliver */
    
if(Weapon_Id == CSW_M4A1 && PLEVELid ] >= 300 
    {
        
set_pev(idpev_viewmodel2"models/1/v_m4a1.mdl")
    }    
    
    
/* m3 */
    
if(Weapon_Id == CSW_M3 && PLEVELid ] >= 300 
    {
        
set_pev(idpev_viewmodel2"models/1/v_m3.mdl")
    }    
    
    
/* XM1014 */
    
if(Weapon_Id == CSW_XM1014 && PLEVELid ] >= 80 
    {
        
set_pev(idpev_viewmodel2"models/1/v_xm1014.mdl")

    }    
    
    return 
PLUGIN_CONTINUE;
}

public 
fwHamTakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    
    
/* Golden Knife */
    
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVELattacker ] >= 5)
    {
        
SetHamParamFloat(4damage 7.0)
        return 
HAM_HANDLED
    
}
    
    
/* Golden Elites */
    
if(get_user_weapon(attacker) == CSW_ELITE && PLEVELattacker ] >= 7)
    {
        
SetHamParamFloat(4damage 5.5)
        return 
HAM_HANDLED
    
}
    
    
/* Golden Deagle */
    
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVELattacker ] >= 10)
    {
        
SetHamParamFloat(4damage 5.0)
        return 
HAM_HANDLED
    
}
    
    
/* German Grenade */
    
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVELattacker ] >= 15)
    {
        
SetHamParamFloat(4damage 2.10)
        return 
HAM_HANDLED
    
}
    
    
/* XMF */
    
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVELattacker ] >= 400)
    {
        
SetHamParamFloat(4damage 2.10)
        return 
HAM_HANDLED
    
}
    
    
/* M4A1 */
    
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVELattacker ] >= 50)
    {
        
SetHamParamFloat(4damage 1.10)
        return 
HAM_HANDLED
    
}
    
    
/* AK-47 */
    
if(get_user_weapon(attacker) == CSW_AK47 && PLEVELattacker ] >= 45)
    {
        
SetHamParamFloat(4damage 1.99)
             return 
HAM_HANDLED
    
}
    
    
/* M3 1 */
    
if(get_user_weapon(attacker) == CSW_M3 && PLEVELattacker ] >= 500)
    {
        
SetHamParamFloat(4damage 2.99)
             return 
HAM_HANDLED
    
}
    
    
/* M3 2 */
    
if(get_user_weapon(attacker) == CSW_M3 && PLEVELattacker ] >= 320)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED
    
}
    
    
/* XMF 2 */
    
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVELattacker ] >= 501)
    {
        
SetHamParamFloat(4damage 6.99)
             return 
HAM_HANDLED
    
}
    
/* MP 5 */
    
if(get_user_weapon(attacker) == CSW_MP5NAVY && PLEVELattacker ] >= 25)
    {
        
SetHamParamFloat(4damage 1.99)
             return 
HAM_HANDLED
    
}
    
/* M4a1 2 */
    
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVELattacker ] >= 200)
    {
        
SetHamParamFloat(4damage 4.99)
             return 
HAM_HANDLED
    
}
    
/* G3s1 */
    
if(get_user_weapon(attacker) == CSW_G3SG1 && PLEVELattacker ] >= 180)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED
    
}
    
/* Ak 47 2 */
    
if(get_user_weapon(attacker) == CSW_AK47 && PLEVELattacker ] >= 205)
    {
        
SetHamParamFloat(4damage 4.99)
             return 
HAM_HANDLED
    
}
    
/* Usp */
    
if(get_user_weapon(attacker) == CSW_USP && PLEVELattacker ] >= 0)
    {
        
SetHamParamFloat(4damage 1.9)
             return 
HAM_HANDLED    
    
}
    
/* Glock */
    
if(get_user_weapon(attacker) == CSW_GLOCK18 && PLEVELattacker ] >= 0)
    {
        
SetHamParamFloat(4damage 1.9)
             return 
HAM_HANDLED
    
}
    
/* AK 6 */
    
if(get_user_weapon(attacker) == CSW_AK47 && PLEVELattacker ] >= 310)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED
    
}
    
/* m4a1 sliver */
    
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVELattacker ] >= 300)
    {
        
SetHamParamFloat(4damage 3.95)
             return 
HAM_HANDLED
    
}
    
/* m3 */
    
if(get_user_weapon(attacker) == CSW_M3 && PLEVELattacker ] >= 80)
    {
        
SetHamParamFloat(4damage 2.99)
             return 
HAM_HANDLED
    
}
    
/* XM1014 */
    
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVELattacker ] >= 300)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED     
    
}
    
    return 
HAM_IGNORED  

este es mi code claro si me lo pudieras adaptar, si no es mucha molestia
Choop is offline
zlChileanFlylz
Member
Join Date: Feb 2013
Location: Chile e,e
Old 09-30-2013 , 15:35   Re: Pedido comando
#8

Bueno ps el code es bastante horrible; le puse para dar lvl nomas

PHP Code:
/* Include some modules */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <cstrike>
#include <nvault>
#include <fakemeta>

/* Who made this bad coded plugin? */
#define PLUGIN    "SURF XP MOD"
#define AUTHOR    "Ardivaba"
#define VERSION    "1.0"

/* Lets define some illegal stuff */
#define TUTORIAL 1001
#define TASK_TUT 1111

/* What is the sound of the message? */
#define MSOUND "items/nvg_off.wav"

/* Enum for tutor colors */
enum
{
    
RED 1,
    
BLUE,
    
YELLOW,
    
GREEN
}

/* Precache array for tutor */
new const g_TutorPrecache[][] = {
    
"gfx/career/icon_!.tga",
    
"gfx/career/icon_!-bigger.tga",
    
"gfx/career/icon_i.tga",
    
"gfx/career/icon_i-bigger.tga",
    
"gfx/career/icon_skulls.tga",
    
"gfx/career/round_corner_ne.tga",
    
"gfx/career/round_corner_nw.tga",
    
"gfx/career/round_corner_se.tga",
    
"gfx/career/round_corner_sw.tga",
    
"resource/TutorScheme.res",
    
"resource/UI/TutorTextWindow.res"
}

/* Some new stuff for tutor */
new g_MsgTutor
new g_MsgTutClose

/* gCvars :( */
new gCvarNozoom

/* So many levels...oh my f**in god */
new const LEVELS[9999] =
{
    
50,
    
100,
    
200,
    
400,
    
600,
    
800,
    
1000,
    
1200,
    
1400,
    
1600,
    
1800,
    
2000,
    
2200,
    
2400,
    
2600,
    
2800,
    
3000,
    
3200,
    
3400,
    
3600,
    
3800,
    
4000,
    
4200,
    
4400,
    
4600,
    
4800,
    
5000,
    
5200,
    
5400,
    
5600,
    
5800,
    
6000,
    
6200,
    
6400,
    
6600,
    
6800,
    
7000,
    
7200,
    
7400,
    
7600,
    
7800,
    
8000,
    
8200,
    
8400,
    
8600,
    
8800,
    
9000,
    
9200,
    
9400,
    
9600,
    
9800,
    
10000,
    
10200,
    
10400,
    
10600,
    
10800,
    
11000,
    
11200,
    
11400,
    
11600,
    
11800,
    
12000,
    
12200,
    
12400,
    
12600,
    
12800,
    
13000,
    
13200,
    
13400,
    
13600,
    
13800,
    
14000,
    
14200,
    
14400,
    
14600,
    
14800,
    
15000,
    
15200,
    
15400,
    
15600,
    
15800,
    
16000,
    
16200,
    
16400,
    
16600,
    
16800,
    
17000,
    
17200,
    
17400,
    
17600,
    
17800,
    
18000,
    
18200,
    
18400,
    
18600,
    
18800,
    
19000,
    
19200,
    
19400,
    
19600,
    
19800,
    
20000,
    
20200,
    
20400,
    
20600,
    
20800,
    
21000,
    
21200,
    
21400,
    
21600,
    
21800,
    
22000,
    
22200,
    
22400,
    
22600,
    
22800,
    
23000,
    
23200,
    
23400,
    
23600,
    
23800,
    
24000,
    
24200,
    
24400,
    
24600,
    
24800,
    
25000,
    
25200,
    
25400,
    
25600,
    
25800,
    
26000,
    
26200,
    
26400,
    
26600,
    
26800,
    
27000,
    
27200,
    
27400,
    
27600,
    
27800,
    
28000,
    
28200,
    
28400,
    
28600,
    
28800,
    
29000,
    
29200,
    
29400,
    
29600,
    
29800,
    
30000,
    
30200,
    
30400,
    
30600,
    
30800,
    
31000,
    
31200,
    
31400,
    
31600,
    
31800,
    
32000,
    
32200,
    
32400,
    
32600,
    
32800,
    
33000,
    
33200,
    
33400,
    
33600,
    
33800,
    
34000,
    
34200,
    
34400,
    
34600,
    
34800,
    
35000,
    
35200,
    
35400,
    
35600,
    
35800,
    
36000,
    
36200,
    
36400,
    
36600,
    
36800,
    
37000,
    
37200,
    
37400,
    
37600,
    
37800,
    
38000,
    
38200,
    
38400,
    
38600,
    
38800,
    
39000,
    
39200,
    
39400,
    
39600,
    
40000,
    
45000,
    
50000,
    
50001,
    
60000,
    
70000,
    
80000,
    
90000,
    
99999,
}

new 
PXP33 ]
new 
PLEVEL33 ]
new 
PKS33 ]
new 
g_vault

public plugin_init()
{
    
//You want credits? Take credits...you stealz0rs
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
//You poor little guy died, what we gonna do now?
    
register_event"DeathMsg""EventDeathMsg""a" )
    
    
//All kinds of information
    
register_clcmd"say /xp""printXp", -1"Print player Xp" )
    
register_clcmd"say /level""printLevel", -1"Print player level" )
    
register_clcmd"say /newlevel""printNewLevel", -1"Print player how many xp left to new level" )
    
register_clcmd"say /help""printHelp", -1"Print help" )
    
register_clcmd"say /info""printInfo", -1"Print info" )
    
register_clcmd"say /weapons""printWeapons", -1"Print weapon unlocks" )
    
    
register_concmd("surf_dar""dar"ADMIN_RCON"Uso Nick Lvl Razon (ESPACIOS SON - O _)")
    
    
//Nozoom stuff
    
register_event("SetFOV","zoom","b","1<90"
    
register_event("CurWeapon","ev_CurWeapon""be""1=1")
    
    
//Meat...mmmm, delicious ham
    
RegisterHam(Ham_Spawn"player""EventPlayerSpawn"1)
    
RegisterHam(Ham_TakeDamage"player""fwHamTakeDamage")
    
    
//nVault stuff
    
g_vault nvault_open("SURFXPMOD")
    
    
//Tutor stuff
    
g_MsgTutor get_user_msgid("TutorText")
    
g_MsgTutClose get_user_msgid("TutorClose")
    
    
//Those annoying cvars...for the community :(
    
gCvarNozoom register_cvar("sxm_nozoom""0"00.0)
}

/* Precache resources */
public plugin_precache()
{
    
precache_sound(MSOUND)
    
    new 
i
    
    
for(0sizeof g_TutorPrecachei++) precache_generic(g_TutorPrecache[i])
    
    
precache_model("models/customs/v_gknife.mdl")
    
    
precache_model("models/customs/v_gdeagle.mdl")
    
    
precache_model("models/customs/v_gelite.mdl")
    
    
precache_model("models/1/v_hegrenade.mdl")
    
    
precache_model("models/customs/v_xm1014.mdl")
    
    
precache_model("models/customs/v_m4a1.mdl")
        
    
precache_model("models/customs/v_ak47.mdl")
    
    
precache_model("models/customs/v_m3.mdl")
    
    
precache_model("models/custom/v_m3.mdl")
    
    
precache_model("models/custom/v_xm1014.mdl")
    
    
precache_model("models/custom/v_mp5.mdl")
    
    
precache_model("models/custom/v_m4a1.mdl")
    
    
precache_model("models/custom/v_g3sg1.mdl")
    
    
precache_model("models/custom/v_ak47.mdl")
    
    
precache_model("models/custom/v_glock18.mdl")
    
    
precache_model("models/custom/v_usp.mdl")
    
    
precache_model("models/1/v_ak47.mdl")
    
    
precache_model("models/1/v_m4a1.mdl")
    
    
precache_model("models/1/v_m3.mdl")
    
    
precache_model("models/1/v_xm1014.mdl")
    
}

public 
client_connectid )
{
    
PXPid ] = 0
    LoadData
id )
}

public 
client_disconnectid )
{
    
SaveDataid )
    
PXPid ] = 0
    PLEVEL
id ] = 0
    PKS
id ] = 0
}

public 
EventPlayerSpawnid )
{
    new 
health
    
new newhealth
    
new money
    
new newmoney
    
new armor
    
new newarmor
    
    money 
cs_get_user_moneyid )
    
newmoney money + (PLEVELid ] * 100)
    
cs_set_user_moneyidnewmoney)
    
    if( 
PLEVELid ] <= 25 )
    {
        
health get_user_healthid )
        
newhealth health + (PLEVELid ])
        
set_user_healthidnewhealth )
    }
    else
    {
        
health get_user_healthid )
        
newhealth 125
        
        armor 
get_user_armorid )
        
newarmor armor + ((PLEVELid ]) - 25)
        
set_user_armoridnewarmor )
        
set_user_healthidnewhealth )
    }
}

public 
EventDeathMsg()
{
    new 
killer read_data)
    new 
victim read_data)
    new 
headshot read_data)
    new 
xp
    
new hs
    
    
if(PLEVELkiller ] > PLEVELvictim ])
    {
        
xp 15000
    
}
    
    if(
PLEVELkiller ] < PLEVELvictim ])
    {
        
xp 150000
    
}
    
    if(
PLEVELkiller ] == PLEVELvictim ])
    {
        
xp 12000000
    
}
    
    
PKSvictim ] = 0
    
    
if( victim == killer )
    {
        return 
PLUGIN_CONTINUE
    
}
    
    if(
headshot)
    {
        
xp xp 9060
        hs 
1
    
}
    
    if(
PKSkiller ] < 10)
    {
        
PKSkiller ]++
    }
    
    
xp xp PKSkiller ]
    
    
add_xpkillerxphs )
    
check_levelkiller )
    
    new 
Text100 ]
    
formatex(Text,191,"You died and lost your killstreak!")
    
MakeTutor(victim,Text,RED,3.0)
}

/* Add xp */
public add_xpidxphs )
{
    new 
newlevel LEVELS[PLEVELid ]]-PXPid ]
    
    
PXPid ] = PXPid ] + xp
    
    
if(hs)
    {
        new 
Text100 ]
        
formatex(Text,191,"Headshot! You got %d xp! ^nKillstreak: %d^nNew level after %d xp!"xpPKSid ], newlevel)
        
MakeTutor(id,Text,GREEN,3.0)
    }
    else
    {
        new 
Text100 ]
        
formatex(Text,191,"You got %d xp! ^nKillstreak: %d^nNew level after %d xp!"xpPKSid ], newlevel)
        
MakeTutor(id,Text,GREEN,3.0)
    }
}

/* Lets check if player got a new level */
public check_levelid )
{
    if(
PXPid ] >= LEVELS[PLEVELid ]])
    {
        
PLEVELid ]++
        new 
Text100 ]
        
formatex(Text,191,"You are now level %d!"PLEVELid ])
        
MakeTutor(id,Text,GREEN,5.0)
    }
}

/* Lets print the list of weapon achievments */
public printWeaponsid )
{
    new 
Text255 ]
    
formatex(Text,191,
    
"LEVEL 5 Unlock^nGolden Knife^n^nLEVEL 7 Unlock^nGolden Elites^n^nLEVEL 10 Unlock^nGolden Deagle^n^nLevel 15 Unlock^nGerman Grenade")
    
MakeTutor(id,Text,YELLOW,7.0)
}

public 
printHelpid )
{
    
//new Text[ 255 ]
    //formatex(Text,191,
    //"Selleks, et vaadata enda levelit kirjuta:^n/level ^nSelleks, et vaadata enda XPd kirjuta:^n/xp^nSelleks, et vaadata millal uus level tuleb kirjuta:^n/uuslevel^n^nSelleks, et vaadata millal mis relva lahti saad kirjuta:^n/relvad")
    //MakeTutor(id,Text,YELLOW,7.0)
}

/* Plugin information */
public printInfoid )
{
    new 
Text255 ]
    
formatex(Text,191,
    
"What is SURF XP MOD?^n-SXM is mod created by Ardivaba for surf server^n^nWhat can i do with levels?^n-Levels reward you HP, starting money and golden weapons")
    
MakeTutor(id,Text,YELLOW,7.0)
}

/* Lets print players ammount of xp */
public printXpid )
{
    new 
Text100 ]
    
formatex(Text,191,"You have %d xp!"PXPid ])
    
MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print when player get's new level */
public printNewLevelid )
{
    new 
newlevel LEVELS[PLEVELid ]]-PXPid ]
    new 
Text100 ]
    
formatex(Text,191,"New level after %d xp!"newlevel)
    
MakeTutor(id,Text,YELLOW,3.0)
}

/* Lets print players level */
public printLevelid )
{
    
    new 
Text100 ]
    
formatex(Text,191,"Your level is %d!"PLEVELid ])
    
MakeTutor(id,Text,YELLOW,3.0)
}

/* Save Data to nVault */
public SaveData(id)
{
    new 
AuthID[35]
    
get_user_name(id,AuthID,34)
    
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-Mod",AuthID)
    
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
    
nvault_set(g_vault,vaultkey,vaultdata)
    return 
PLUGIN_CONTINUE
}

/* Load Data  from nVault */
public LoadData(id)
{
    new 
AuthID[35]
    
get_user_name(id,AuthID,34)
    
    new 
vaultkey[64],vaultdata[256]
    
format(vaultkey,63,"%s-Mod",AuthID)
    
format(vaultdata,255,"%i#%i#",PXP[id],PLEVEL[id])
    
nvault_get(g_vault,vaultkey,vaultdata,255)
    
    
replace_all(vaultdata255"#"" ")
    
    new 
playerxp[32], playerlevel[32]
    
    
parse(vaultdataplayerxp31playerlevel31)
    
    
PXP[id] = str_to_num(playerxp)
    
PLEVEL[id] = str_to_num(playerlevel)
    
    return 
PLUGIN_CONTINUE
}

/* Teeme tutori teksti */
MakeTutor(id,Text[],Color,Float:Time 0.0) {
    
    
client_cmdid"spk %s"MSOUND )
    
    if(
is_user_connectedid ))
    {
        
message_begin(MSG_ONE_UNRELIABLE,g_MsgTutor,_,id)
        
write_string(Text)
        
write_byte(0)
        
write_short(0)
        
write_short(0)
        
write_short(1<<Color)
        
message_end()
    }
    
    if(
Time != 0.0) {
        
        if( 
task_existsid TASK_TUT ) )
        {
            
remove_taskid TASK_TUT )
        }
        
        
set_task(Time,"RemoveTutor",id TASK_TUT)
    }
}

/* Lets Remove Tutor */
public RemoveTutor(taskID) {
    
    new 
id taskID TASK_TUT
    message_begin
(MSG_ALL,g_MsgTutClose,_,id)
    
message_end()
}

public 
zoomid )
{
    if(
gCvarNozoom)
    {
        
client_cmdid"drop" )
    }
}

/* Golden Weapons */

public ev_CurWeapon(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id)) 
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
Weapon_Id read_data(2)
    
    
/* Golden Knife */
    
if(Weapon_Id == CSW_KNIFE && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_gknife.mdl")
    }
    
    
/* Golden Elites */
    
if(Weapon_Id == CSW_ELITE && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_gelite.mdl")
    }
    
    
/* Golden Deagle */
    
if(Weapon_Id == CSW_DEAGLE && PLEVELid ] >= 10 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_gdeagle.mdl")
    }
    
    
/* German Grenade */
    
if(Weapon_Id == CSW_HEGRENADE && PLEVELid ] >= 15 
    {
        
set_pev(idpev_viewmodel2"models/1/v_hegrenade.mdl")
    }
    
    
/* XMF 1 */
    
if(Weapon_Id == CSW_XM1014 && PLEVELid ] >= 400 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_xm1014.mdl")
    }
    
    
/* M4A1 */
    
if(Weapon_Id == CSW_M4A1 && PLEVELid ] >= 50 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_m4a1.mdl")
         }
    
    
/* AK-47 */
    
if(Weapon_Id == CSW_AK47 && PLEVELid ] >= 45 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_ak47.mdl")
         }
    
    
/* M3 1 */
    
if(Weapon_Id == CSW_M3 && PLEVELid ] >= 500 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_m3.mdl")
    }
    
    
/* M3 2 */
    
if(Weapon_Id == CSW_M3 && PLEVELid ] >= 320 
    {
        
set_pev(idpev_viewmodel2"models/customs/v_m3.mdl")
    }
    
    
/* XMF 2 */
    
if(Weapon_Id == CSW_XM1014 && PLEVELid ] >= 501 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_xm1014.mdl")
    }
    
    
/* MP 5 */
    
if(Weapon_Id == CSW_MP5NAVY && PLEVELid ] >= 25 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_mp5.mdl")
    }
    
    
/* M4a1 2 */
    
if(Weapon_Id == CSW_M4A1 && PLEVELid ] >= 200 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_m4a1.mdl")
    }
    
    
/* G3s1 */
    
if(Weapon_Id == CSW_G3SG1 && PLEVELid ] >= 180 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_g3sg1.mdl")
    }
    
    
/* Ak 47 2 */
    
if(Weapon_Id == CSW_AK47 && PLEVELid ] >= 205 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_ak47.mdl")
    }
    
    
/* Usp */
    
if(Weapon_Id == CSW_USP && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_usp.mdl")
    }    
    
    
/* Glock */
    
if(Weapon_Id == CSW_GLOCK18 && PLEVELid ] >= 
    {
        
set_pev(idpev_viewmodel2"models/custom/v_glock18.mdl")
    }    
    
    
/* AK 6 */
    
if(Weapon_Id == CSW_AK47 && PLEVELid ] >= 310 
    {
        
set_pev(idpev_viewmodel2"models/1/v_ak47.mdl")
    }    
    
    
/* m4a1 sliver */
    
if(Weapon_Id == CSW_M4A1 && PLEVELid ] >= 300 
    {
        
set_pev(idpev_viewmodel2"models/1/v_m4a1.mdl")
    }    
    
    
/* m3 */
    
if(Weapon_Id == CSW_M3 && PLEVELid ] >= 300 
    {
        
set_pev(idpev_viewmodel2"models/1/v_m3.mdl")
    }    
    
    
/* XM1014 */
    
if(Weapon_Id == CSW_XM1014 && PLEVELid ] >= 80 
    {
        
set_pev(idpev_viewmodel2"models/1/v_xm1014.mdl")

    }    
    
    return 
PLUGIN_CONTINUE;
}

public 
fwHamTakeDamage(victiminflictorattackerFloat:damagedamagebits)
{
    
    
/* Golden Knife */
    
if(get_user_weapon(attacker) == CSW_KNIFE && PLEVELattacker ] >= 5)
    {
        
SetHamParamFloat(4damage 7.0)
        return 
HAM_HANDLED
    
}
    
    
/* Golden Elites */
    
if(get_user_weapon(attacker) == CSW_ELITE && PLEVELattacker ] >= 7)
    {
        
SetHamParamFloat(4damage 5.5)
        return 
HAM_HANDLED
    
}
    
    
/* Golden Deagle */
    
if(get_user_weapon(attacker) == CSW_DEAGLE && PLEVELattacker ] >= 10)
    {
        
SetHamParamFloat(4damage 5.0)
        return 
HAM_HANDLED
    
}
    
    
/* German Grenade */
    
if(get_user_weapon(attacker) == CSW_HEGRENADE && PLEVELattacker ] >= 15)
    {
        
SetHamParamFloat(4damage 2.10)
        return 
HAM_HANDLED
    
}
    
    
/* XMF */
    
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVELattacker ] >= 400)
    {
        
SetHamParamFloat(4damage 2.10)
        return 
HAM_HANDLED
    
}
    
    
/* M4A1 */
    
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVELattacker ] >= 50)
    {
        
SetHamParamFloat(4damage 1.10)
        return 
HAM_HANDLED
    
}
    
    
/* AK-47 */
    
if(get_user_weapon(attacker) == CSW_AK47 && PLEVELattacker ] >= 45)
    {
        
SetHamParamFloat(4damage 1.99)
             return 
HAM_HANDLED
    
}
    
    
/* M3 1 */
    
if(get_user_weapon(attacker) == CSW_M3 && PLEVELattacker ] >= 500)
    {
        
SetHamParamFloat(4damage 2.99)
             return 
HAM_HANDLED
    
}
    
    
/* M3 2 */
    
if(get_user_weapon(attacker) == CSW_M3 && PLEVELattacker ] >= 320)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED
    
}
    
    
/* XMF 2 */
    
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVELattacker ] >= 501)
    {
        
SetHamParamFloat(4damage 6.99)
             return 
HAM_HANDLED
    
}
    
/* MP 5 */
    
if(get_user_weapon(attacker) == CSW_MP5NAVY && PLEVELattacker ] >= 25)
    {
        
SetHamParamFloat(4damage 1.99)
             return 
HAM_HANDLED
    
}
    
/* M4a1 2 */
    
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVELattacker ] >= 200)
    {
        
SetHamParamFloat(4damage 4.99)
             return 
HAM_HANDLED
    
}
    
/* G3s1 */
    
if(get_user_weapon(attacker) == CSW_G3SG1 && PLEVELattacker ] >= 180)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED
    
}
    
/* Ak 47 2 */
    
if(get_user_weapon(attacker) == CSW_AK47 && PLEVELattacker ] >= 205)
    {
        
SetHamParamFloat(4damage 4.99)
             return 
HAM_HANDLED
    
}
    
/* Usp */
    
if(get_user_weapon(attacker) == CSW_USP && PLEVELattacker ] >= 0)
    {
        
SetHamParamFloat(4damage 1.9)
             return 
HAM_HANDLED    
    
}
    
/* Glock */
    
if(get_user_weapon(attacker) == CSW_GLOCK18 && PLEVELattacker ] >= 0)
    {
        
SetHamParamFloat(4damage 1.9)
             return 
HAM_HANDLED
    
}
    
/* AK 6 */
    
if(get_user_weapon(attacker) == CSW_AK47 && PLEVELattacker ] >= 310)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED
    
}
    
/* m4a1 sliver */
    
if(get_user_weapon(attacker) == CSW_M4A1 && PLEVELattacker ] >= 300)
    {
        
SetHamParamFloat(4damage 3.95)
             return 
HAM_HANDLED
    
}
    
/* m3 */
    
if(get_user_weapon(attacker) == CSW_M3 && PLEVELattacker ] >= 80)
    {
        
SetHamParamFloat(4damage 2.99)
             return 
HAM_HANDLED
    
}
    
/* XM1014 */
    
if(get_user_weapon(attacker) == CSW_XM1014 && PLEVELattacker ] >= 300)
    {
        
SetHamParamFloat(4damage 3.99)
             return 
HAM_HANDLED     
    
}
    
    return 
HAM_IGNORED  
}  

public 
dar(idlevelcid)
{
    if(
get_user_flags(id) & ADMIN_RCON && is_user_connected(id))
    {
        new 
nombre[32], nivel[32], razon[32]
    
        
read_argv(1nombrecharsmax(nombre))
        
read_argv(2nivelcharsmax(nivel))
        
read_argv(3razoncharsmax(razon))
    
        new 
id2 cmd_target(idnombre0)
    
        
PLEVEL[id2] += str_to_num(nivel// Tambien puede ser varieble ej: g_level[id2] += str_to_num(nivel)
    
        
client_print(id2print_chat"Te Han Dado: %d Nivel."str_to_num(nivel))
        
        static 
name[60]
        
get_user_name(id2namesizeof name 1)
        
        
replace_all(razoncharsmax(razon), "-"" ")
        
replace_all(razoncharsmax(razon), "_"" ")
        
        
client_print(0print_chat"Han Dado: %d Nivel; %d A: %s Razon: %s"str_to_num(nivel))
        
client_print(0print_console"Han Dado: %d Nivel; %d A: %s Razon: %s"str_to_num(nivel))
        
        
check_level(id2)
    }

__________________
My Steam
-------Proyect's-------
Zp Edit 20%
-----------------------
I Speak Spanish No English
zlChileanFlylz is offline
wiDD.
Member
Join Date: Jul 2013
Location: Argentina
Old 09-30-2013 , 19:57   Re: Pedido comando
#9

Menos mal que te dije que edites esto:

PHP Code:
new const LEVELS[9999] =
{
    
50,
    
100,
    
200,
    
400,
    
600,
    
800,
    
1000,
    
1200,
    
1400,
    
1600,
    
1800,
    
2000,
    
2200,
    
2400,
    
2600,
    
2800,
    
3000,
    
3200,
    
3400,
    
3600,
    
3800,
    
4000,
    
4200,
    
4400,
    
4600,
    
4800,
    
5000,
    
5200,
    
5400,
    
5600,
    
5800,
    
6000,
    
6200,
    
6400,
    
6600,
    
6800,
    
7000,
    
7200,
    
7400,
    
7600,
    
7800,
    
8000,
    
8200,
    
8400,
    
8600,
    
8800,
    
9000,
    
9200,
    
9400,
    
9600,
    
9800,
    
10000,
    
10200,
    
10400,
    
10600,
    
10800,
    
11000,
    
11200,
    
11400,
    
11600,
    
11800,
    
12000,
    
12200,
    
12400,
    
12600,
    
12800,
    
13000,
    
13200,
    
13400,
    
13600,
    
13800,
    
14000,
    
14200,
    
14400,
    
14600,
    
14800,
    
15000,
    
15200,
    
15400,
    
15600,
    
15800,
    
16000,
    
16200,
    
16400,
    
16600,
    
16800,
    
17000,
    
17200,
    
17400,
    
17600,
    
17800,
    
18000,
    
18200,
    
18400,
    
18600,
    
18800,
    
19000,
    
19200,
    
19400,
    
19600,
    
19800,
    
20000,
    
20200,
    
20400,
    
20600,
    
20800,
    
21000,
    
21200,
    
21400,
    
21600,
    
21800,
    
22000,
    
22200,
    
22400,
    
22600,
    
22800,
    
23000,
    
23200,
    
23400,
    
23600,
    
23800,
    
24000,
    
24200,
    
24400,
    
24600,
    
24800,
    
25000,
    
25200,
    
25400,
    
25600,
    
25800,
    
26000,
    
26200,
    
26400,
    
26600,
    
26800,
    
27000,
    
27200,
    
27400,
    
27600,
    
27800,
    
28000,
    
28200,
    
28400,
    
28600,
    
28800,
    
29000,
    
29200,
    
29400,
    
29600,
    
29800,
    
30000,
    
30200,
    
30400,
    
30600,
    
30800,
    
31000,
    
31200,
    
31400,
    
31600,
    
31800,
    
32000,
    
32200,
    
32400,
    
32600,
    
32800,
    
33000,
    
33200,
    
33400,
    
33600,
    
33800,
    
34000,
    
34200,
    
34400,
    
34600,
    
34800,
    
35000,
    
35200,
    
35400,
    
35600,
    
35800,
    
36000,
    
36200,
    
36400,
    
36600,
    
36800,
    
37000,
    
37200,
    
37400,
    
37600,
    
37800,
    
38000,
    
38200,
    
38400,
    
38600,
    
38800,
    
39000,
    
39200,
    
39400,
    
39600,
    
40000,
    
45000,
    
50000,
    
50001,
    
60000,
    
70000,
    
80000,
    
90000,
    
99999,

wiDD. is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 09-30-2013 , 19:59   Re: Pedido comando
#10

Quote:
Originally Posted by wiDD. View Post
Menos mal que te dije que edites esto:

PHP Code:
new const LEVELS[9999] =
{
    
50,
    
100,
    
200,
    
400,
    
600,
    
800,
    
1000,
    
1200,
    
1400,
    
1600,
    
1800,
    
2000,
    
2200,
    
2400,
    
2600,
    
2800,
    
3000,
    
3200,
    
3400,
    
3600,
    
3800,
    
4000,
    
4200,
    
4400,
    
4600,
    
4800,
    
5000,
    
5200,
    
5400,
    
5600,
    
5800,
    
6000,
    
6200,
    
6400,
    
6600,
    
6800,
    
7000,
    
7200,
    
7400,
    
7600,
    
7800,
    
8000,
    
8200,
    
8400,
    
8600,
    
8800,
    
9000,
    
9200,
    
9400,
    
9600,
    
9800,
    
10000,
    
10200,
    
10400,
    
10600,
    
10800,
    
11000,
    
11200,
    
11400,
    
11600,
    
11800,
    
12000,
    
12200,
    
12400,
    
12600,
    
12800,
    
13000,
    
13200,
    
13400,
    
13600,
    
13800,
    
14000,
    
14200,
    
14400,
    
14600,
    
14800,
    
15000,
    
15200,
    
15400,
    
15600,
    
15800,
    
16000,
    
16200,
    
16400,
    
16600,
    
16800,
    
17000,
    
17200,
    
17400,
    
17600,
    
17800,
    
18000,
    
18200,
    
18400,
    
18600,
    
18800,
    
19000,
    
19200,
    
19400,
    
19600,
    
19800,
    
20000,
    
20200,
    
20400,
    
20600,
    
20800,
    
21000,
    
21200,
    
21400,
    
21600,
    
21800,
    
22000,
    
22200,
    
22400,
    
22600,
    
22800,
    
23000,
    
23200,
    
23400,
    
23600,
    
23800,
    
24000,
    
24200,
    
24400,
    
24600,
    
24800,
    
25000,
    
25200,
    
25400,
    
25600,
    
25800,
    
26000,
    
26200,
    
26400,
    
26600,
    
26800,
    
27000,
    
27200,
    
27400,
    
27600,
    
27800,
    
28000,
    
28200,
    
28400,
    
28600,
    
28800,
    
29000,
    
29200,
    
29400,
    
29600,
    
29800,
    
30000,
    
30200,
    
30400,
    
30600,
    
30800,
    
31000,
    
31200,
    
31400,
    
31600,
    
31800,
    
32000,
    
32200,
    
32400,
    
32600,
    
32800,
    
33000,
    
33200,
    
33400,
    
33600,
    
33800,
    
34000,
    
34200,
    
34400,
    
34600,
    
34800,
    
35000,
    
35200,
    
35400,
    
35600,
    
35800,
    
36000,
    
36200,
    
36400,
    
36600,
    
36800,
    
37000,
    
37200,
    
37400,
    
37600,
    
37800,
    
38000,
    
38200,
    
38400,
    
38600,
    
38800,
    
39000,
    
39200,
    
39400,
    
39600,
    
40000,
    
45000,
    
50000,
    
50001,
    
60000,
    
70000,
    
80000,
    
90000,
    
99999,

Cual es el problema de eso
__________________
Allied Modders En Espaņol
MexPower is offline
 


Thread Tools
Display Modes

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:11.


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