Raised This Month: $ Target: $400
 0% 

What worng ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
elpouletorange
Senior Member
Join Date: Oct 2007
Old 10-21-2007 , 12:13   What worng ?
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define MENU_KEYS MENU_KEY_0|MENU_KEY_1|MENU_KEY_2|MENU_KEY_3
#define PLUGIN "Kill mod"
#define VERSION "1.0"
#define AUTHOR "elpouletorange"
#define MAX_PLAYERS 32
new bool:g_restart_attempt[MAX_PLAYERS 1]
new 
str
new def
new dex
new agi
new total
new skp
public plugin_init() 
{
 
register_clcmd("say /menu""kmod_menu")
 
register_menucmd(register_menuid("Select your skills"), MENU_KEYS"choixMenu");
 
register_event("ResetHUD""event_hud_reset""be")
 
register_clcmd("fullupdate""clcmd_fullupdate"
 
register_event("TextMsg""event_restart_attempt""a""2=#Game_will_restart_in")
}
public 
kmod_menu(id

 
skp(id) = get_user_frags(id);  // ERROR !!!
 
total(id) = skp(id) - str(id) - def(id) - dex(id) - agi(id);
 
 if (
total(id) != 0)
 {
  new 
menutext[192]; 
  
format(menutext191"Select your skills^n^n1. Strenght (More Heal)^n2. Defence (More armor)^n3. Dexterity (Low gravity)^n4. Agility (More speed)"); 
  
show_menu(idMENU_KEYSmenutext); 
 }
 else
 {
  
client_print(idprint_chat"You cant choose a skill you got 0skp");
 }
}
public 
choixMenu(idkey)
{
 switch(
key)
 {
  case 
0:
   
str(id) = str(id) + 1;
  case 
1:
   
def(id) = def(id) + 1;
  case 
2:
   
dex(id) = dex(id) + 1;
  case 
3:
   
agi(id) = agi(id) + 1;
 }
}
public 
clcmd_fullupdate() {
    return 
PLUGIN_HANDLED_MAIN
}
 
public 
event_restart_attempt() {
    new 
players[32], num
    get_players
(playersnum"a")
    for (new 
inum; ++i)
        
g_restart_attempt[players[i]] = true
}
 
public 
event_hud_reset(id) {
    if (
g_restart_attempt[id]) {
        
g_restart_attempt[id] = false
        
return
    }
    
event_player_spawn(id)
}
 
// this function is called on player spawn
public event_player_spawn(id) {
    
set_user_health(idskill_strenght 5)
    
set_user_armor(idskill_defence 10)
    
set_user_gravity(id800 skill_dexterity 50)
    
set_user_maxspeed(id100 skill_agility 5)

elpouletorange 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 01:18.


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