Raised This Month: $ Target: $400
 0% 

Array Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-12-2010 , 08:11   Re: Array Problem
Reply With Quote #1

you can't use id in event_new_round, you have to loop through all the players

Edit: try this:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>


#define PLUGIN "FutureMod"
#define VERSION "1.1"
#define AUTHOR "Mottzi"

new class[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /class""change_class")
    
register_clcmd("say_team /class""change_class")
    
register_event("HLTV""event_new_round""a""1=0""2=0")  
}

public 
change_class(id)
{
    if (!
is_user_alive(id))
    {
        new 
menu_class menu_create("\r: Choose a class!""change_class_menu");
       
        
menu_additem(menu_class"\wSonic""1"0);
        
        
menu_setprop(menu_classMPROP_EXITMEXIT_ALL);
        
        
menu_display(idmenu_class0);
    }
    
    else
    {
        
client_print(idprint_chat"Only dead peaple can change their class!")
    }
   

   
 }

 public 
change_class_menu(idmenu_classitem)
 {

    
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu_class);
        return 
PLUGIN_HANDLED;
    }

    
    new 
data[6], iName[64];
    new 
accesscallback;

    
menu_item_getinfo(menu_classitemaccessdata,5iName63callback);

    
    new 
key str_to_num(data);
   
    switch(
keyid)
    {
        case 
1:
        {
            
set_user_gravity(id0.5)
            class[
id] = 0
            client_print
(idprint_chat"[FM] You are a Sonic now!");
            
menu_destroy(menu_class);
       

            return 
PLUGIN_HANDLED;
        }
    }

    
menu_destroy(menu_class);
    return 
PLUGIN_HANDLED;
 }

public 
event_new_round()
{
    new 
players[32], inumid
    get_players
(playersinum)
    
    for(new 
0inumi++) 
    {
        
id players[i]
        
        if(class[
id] == 1)
        {
            
set_user_health(id150)
            
set_user_gravity(id0.5)
        }
        
        
client_print(idprint_chat"%i lool", class[id])
    }
    return 
PLUGIN_CONTINUE

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 06-12-2010 at 08:19.
drekes is offline
Send a message via MSN to drekes
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 14:43.


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