Raised This Month: $ Target: $400
 0% 

Need help with assigning values.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 08-29-2004 , 15:41   Need help with assigning values.
Reply With Quote #1

I'm trying to write a plugin so you can say /afk and you join spectators but it keeps your team and model so when you type /back you join the team you were on with the same model. Maybe my mistake is obvious but I can't get the plugin to choose the right team. I also need help with the get model and set model commands. This is the code I have so far.
Code:
#include <amxmodx> 
#include <amxmisc> 
#include <cstrike>

public plugin_init()
{ 
   register_plugin("AFK and Back","0.1","twistedeuphoria") 
   register_clcmd("say","say_event") 
   return PLUGIN_CONTINUE 
} 
  

public say_event(id) 
{ 
   
    new sid[2] 
    new team[32]    
    new model[32] 
    sid[0] = id 
    num_to_str(id,sid,2) 
    new said[192] 
    read_args(said,191) 
    new name[32] 
    get_user_name(id,name,31) 
    if(containi(said,"/afk") != -1) 
    { 
      if (is_user_alive(id))
      { 
        cs_get_user_model(id,model[id],4)//How do I use this?
        team[id] = get_user_team(id)
	user_kill(id) 
        client_print(0,print_chat,"*DEAD* %s : I'll be back...",name) 
        client_cmd(id,"jointeam 6")    
      }  
  
   }
   if(containi(said,"/back") != -1) 
   { 
       
     client_print(0,print_chat,"%s : I'm back....",name) 
     if(team[id] == 1)
        client_cmd(id,"jointeam 1")    
     else
        client_cmd(id,"jointeam 2")
     cs_set_user_model(id,model[id])//Need help here too.
   }  
}
Thank you for your time.
twistedeuphoria 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 17:14.


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