Raised This Month: $ Target: $400
 0% 

Storing and Moving via Global Var


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 07-07-2012 , 08:44   Storing and Moving via Global Var
Reply With Quote #1

Here's the Code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "Epic"

new StoredP

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /store""Store")
    
register_clcmd("say /move""Move")
}

public 
Store(id)
{
    static 
Players[32], Pnum;
    
get_players(PlayersPnum"ae""TERRORIST")
    
    for(new 
0Pnumi++)
    {
        
StoredP Players[i]
        
cs_set_user_team(StoredPCS_TEAM_CT)
        
client_print(StoredPprint_chat"[AMXX] T's stored")
    }
}

public 
Move(id)
{
    if(
is_user_connected(StoredP))
    {
        
cs_set_user_team(StoredPCS_TEAM_T)
    }

Quote:
Trying to do:

Store all the terrorist in the global var and move them to CT and then move them back to T.
Quote:
Whats Happening:

Store's all the terrorists in the global var and moves them all to CT and only moves the last terrorist stored back to T.
Do i have to use a 2d array for this?

any help would be appreciated

Last edited by EpicMonkey; 07-07-2012 at 08:47.
EpicMonkey 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 15:17.


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