Raised This Month: $ Target: $400
 0% 

[ZP] Ayuda Niveles Por Frags


  
 
 
Thread Tools Display Modes
Author Message
Mono25
Junior Member
Join Date: Aug 2013
Location: Argentina
Old 09-01-2013 , 15:00   [ZP] Ayuda Niveles Por Frags
#1

Ayuda He estado creando Niveles Por Frags HM/ZM
Copila Todo Pero Tengo Un problema No Sube De Nivel.

Esto Es Lo Que Ice

// Level Frags
new const FRAGS_HM[5] = { 0, 10, 20, 30, 40 }
new const FRAGS_ZM[5] = { 0, 10, 20, 30, 40 }


[Global Variables]
new g_level[33] // levels weapons
new g_frags_hm[33] // frags humans
new g_frags_zm[33] // frags zombie


// Register native Level/Frags
register_native("zp_get_user_level", "native_get_user_level", 1)
register_native("zp_set_user_level", "native_set_user_level", 1)
register_native("zp_get_user_frags_lvl", "native_get_user_frags_lvl", 1)
register_native("zp_set_user_frags_lvl", "native_set_user_frags_lvl", 1)


public fw_PlayerKilled(victim, attacker, shouldgib)
{
if(!g_zombie[victim])
check_level(attacker, 1, 0)


if (resetall)
{
g_level[id] = 1
g_frags_hm[id] = 0
g_frags_zm[id] = 0

// Native: zp_get_user_level
public native_get_user_level(id)
{
return g_level[id];
}

// Native: zp_set_user_level
public native_set_user_level(id, amount)
{
g_level[id] = amount;
}

// Native: zp_get_user_frags_lvl
public native_get_user_frags_lvl(id)
{
return g_frags_hm[id] || g_frags_zm[id];
}

// Native: zp_set_user_frags_lvl
public native_set_user_frags_lvl(id, amount)
{
return ckeck_level(id, 0 - g_frags_hm[id] || g_frags_zm[id] + amount, 0)
}


// Level Frags Human/Zombie
public check_level(id, amount, check)
{
if(check)

if(g_frags_hm[id] + amount > FRAGS_HM[sizeof FRAGS_HM - 1] - 1 || g_frags_zm[id] + amount > FRAGS_ZM[sizeof FRAGS_ZM - 1] - 1)
return PLUGIN_HANDLED

g_frags_hm[id] += amount
g_frags_zm[id] += amount

if(amount < 0)
{
if(g_frags_hm[id] >= FRAGS_HM[g_level[id]] || g_frags_zm[id] >= FRAGS_ZM[g_level[id]])
{
g_level[id]++
client_print(id, print_chat, "[ZP] Subiste De Nivel!!!")
check_level(id, -1, 1)
}
}
return PLUGIN_HANDLED
}


Ayuda Que Tengo Que Hacer?
Attached Files
File Type: sma Get Plugin or Get Source (Untitled.sma - 498 views - 387.7 KB)

Last edited by Mono25; 09-01-2013 at 15:01.
Mono25 is offline
Ayudante
Member
Join Date: Jul 2013
Location: Mi Casa!
Old 09-01-2013 , 15:10   Re: [ZP] Ayuda Niveles Por Frags
#2

1.- Usa etiquetass PHP.
2.- Mira que hay un tutorial de zp levels con frags!

BUSCA!

Last edited by Ayudante; 09-01-2013 at 15:10.
Ayudante is offline
Mono25
Junior Member
Join Date: Aug 2013
Location: Argentina
Old 09-01-2013 , 15:17   Re: [ZP] Ayuda Niveles Por Frags
#3

Quote:
Originally Posted by Ayudante View Post
1.- Usa etiquetass PHP.
2.- Mira que hay un tutorial de zp levels con frags!

BUSCA!
Si vi el Tutorial Por Frags Humano Y Zombie Pero Tengo Un Problema No Sube De Nivel
Mono25 is offline
ChileScripting
BANNED
Join Date: Jan 2013
Old 09-02-2013 , 00:02   Re: [ZP] Ayuda Niveles Por Frags
#4

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <hamsandwich> #include <zombieplague> #define PLUGIN "EXP/Level System" #define VERSION "1.0" #define AUTHOR "ChileScripting" /*  PLUGIN CUSTOMIZATION */ #define ConnectedValid(%1) (1 <= %1 <= get_maxplayers() && is_user_connected(%1)) #define TAG "^x04[ZP]^x01 " #define MAX_LEVEL 100 #define Operation(%1)       floatround(((%1 + 1) * float(%1 / 2)) * 6) enum _:CVARS {     EXP_KILL_ZOMBIE,     EXP_KILL_NEMESIS,     EXP_KILL_HUMAN,     EXP_KILL_SURVIVOR } enum _:DATA {     NAMEVAR[40],     RESULT[6]     } new const PLUGINVARS[CVARS][DATA] = {     {         "zp_exp_kill_zombie",         "2"     },     {         "zp_exp_kill_nemesis",         "4"     },     {         "zp_exp_kill_human",         "2"     },     {         "zp_exp_kill_survivor",         "4"     } }     enum VARIABLES {     LEVEL = 0,     FRAGS_H } new g_Variable[33][VARIABLES] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         // Add your code here...     RegisterHam(Ham_Killed, "player", "HamKilled", 1)         for(new i = 0; i < sizeof PLUGINVARS; i++)         PLUGINVARS[i][RESULT] = register_cvar(PLUGINVARS[i][NAMEVAR], PLUGINVARS[i][RESULT]) } public plugin_natives() {     register_native("zp_get_user_level", "native_get_user_level", 1)     register_native("zp_get_user_fragsh", "native_get_user_fragsh", 1)         register_native("zp_set_user_level", "native_set_user_level", 1)     register_native("zp_set_user_fragsh", "native_set_user_fragsh", 1) } public client_putinserver(id) {     g_Variable[id][LEVEL] = 1     g_Variable[id][FRAGS_H] = 0 } public HamKilled(victim, attacker, shouldgib) {     static selfkill     selfkill = (victim == attacker || !ConnectedValid(attacker)) ? true : false         if (selfkill) return         static EXP, szPrint[30]     if(zp_get_user_zombie(victim))     {         if(zp_get_user_nemesis(victim))         {             EXP = get_pcvar_num(PLUGINVARS[EXP_KILL_NEMESIS][RESULT])             szPrint = "Matar a un Nemesis"         }         else         {             EXP = get_pcvar_num(PLUGINVARS[EXP_KILL_ZOMBIE][RESULT])             szPrint = "Matar a un Zombie"         }     }     else     {         if(zp_get_user_survivor(victim))         {             EXP = get_pcvar_num(PLUGINVARS[EXP_KILL_SURVIVOR][RESULT])             szPrint = "Matar a un Survivor"         }         else         {             EXP = get_pcvar_num(PLUGINVARS[EXP_KILL_HUMAN][RESULT])             szPrint = "Matar a un Humano"         }     }     EXPCheck(attacker, EXP, szPrint)         } public EXPCheck(id, EXP, const Print[]) {     if(!EXP) return 0;         if((g_Variable[id][FRAGS_H] + EXP) >= Operation(MAX_LEVEL))     {         g_Variable[id][FRAGS_H] = Operation(MAX_LEVEL)         say(id, "%sNo ganas EXP^x01, haz llegado al^x03 maximo nivel^x01 (^x03%d^x01)^x01.", TAG, MAX_LEVEL)         return 0;     }     g_Variable[id][FRAGS_H] += EXP     say(id, "%s Ganaste ^x04%d^x01 de^x03 EXP^x01 Por:^x04 %s^x01.", TAG, EXP, Print)     while(g_Variable[id][FRAGS_H] >= Operation(g_Variable[id][LEVEL]))     {         g_Variable[id][LEVEL]++         say(id, "%sHaz subido al^x04 nivel^x01:^x03 ^"^x04%d^x03^"^x01.", TAG, g_Variable[id][LEVEL])     }         return 1; } public native_get_user_level(id) {     return g_Variable[id][LEVEL] } public native_get_user_fragsh(id) {     return g_Variable[id][FRAGS_H] } public native_set_user_level(id, iCantidad) {     g_Variable[id][LEVEL] = iCantidad } public native_set_user_fragsh(id, iCantidad) {     g_Variable[id][FRAGS_H] = iCantidad } public say(id, const msg[], any:...) {         static buffer[512], msg_SayText = 0         if(!msg_SayText) msg_SayText = get_user_msgid("SayText")             vformat(buffer, charsmax(buffer), msg, 3)                 message_begin(MSG_ONE_UNRELIABLE, msg_SayText, _, id)     write_byte(id)     write_string(buffer)     message_end() }

Last edited by ChileScripting; 09-02-2013 at 00:02.
ChileScripting is offline
 



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 00:12.


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