Raised This Month: $51 Target: $400
 12% 

Help me add rank's client?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ditmesteam
Senior Member
Join Date: Oct 2009
Old 02-16-2010 , 22:54   Help me add rank's client?
Reply With Quote #1

This is not plugin which is released, made by _Master_ (he has not been log in forum): http://forums.alliedmods.net/showthr...t=53032&page=2
May someone help me:

1. I want to add rank's client when player connect, for example:
Killer(rank: 10/1550)joined

2. It's not important but if you know about code:
- can you delete (I only want 1,2):
* 3 = connected + disconnected + connecting
* 4 = connected + disconnected + connecting + authorized
- remove country info when player connect, disconnect
- remove sound
============================================= ==============
Code:
#include <amxmodx>
#include <amxmisc>
#include <geoip>
new SoundFile[] = "buttons/blip1.wav"
new SayText
new PCVAR_JOINMSG
static pauthid[35], pname[32], pip[32], pcountry[33], players[32], num, idx
static msg_admin[192], msg_player[192]
public plugin_init(){
 register_plugin("Join msg", "1.0", "_M@573|2_")
 
 PCVAR_JOINMSG = register_cvar("amx_joinmsg", "4")
 /*
 *  1 = connected
 *  2 = connected + disconnected
 *  3 = connected + disconnected + connecting
 *  4 = connected + disconnected + connecting + authorized
 */
 
 SayText = get_user_msgid("SayText")
}
public plugin_precache() precache_sound(SoundFile)
public client_putinserver(id){ 
 if(get_pcvar_num(PCVAR_JOINMSG) >= 1){
 
  get_user_name(id, pname, 31)
  get_user_ip(id, pip, 31, 1)
  get_user_authid(id, pauthid, 34)
  geoip_country(pip, pcountry)
 
  msg_admin[0] = 0x04
  msg_player[0] = 0x04
 
  formatex(msg_admin[1], 191, "%s ^x01(^x03%s^x01) (^x03%s^x01) Joined (^x03%s^x01).", pname, pip, pauthid, pcountry)
  formatex(msg_player[1], 191, "%s^x01 Joined (^x03%s^x01).", pname, pcountry)
 
  get_players(players, num, "c")
  for(new i = 0; i < num; i++){
 
   idx = players[i]
   if(idx == id) continue
 
   message_begin(MSG_ONE, SayText, {0, 0, 0}, idx)
   write_byte(idx)
   if(is_user_admin(idx)) write_string(msg_admin)
   else write_string(msg_player)
   message_end()
  }
 
  client_cmd(0, "spk %s", SoundFile)
 }
}
public client_disconnect(id){ 
 if(get_pcvar_num(PCVAR_JOINMSG) >= 2){
 
  get_user_name(id, pname, 31)
  get_user_ip(id, pip, 31, 1)
  get_user_authid(id, pauthid, 34)
  geoip_country(pip, pcountry)
 
  msg_admin[0] = 0x04
  msg_player[0] = 0x04
 
  formatex(msg_admin[1], 191, "%s ^x01(^x03%s^x01) (^x03%s^x01) Disconnected (^x03%s^x01).", pname, pip, pauthid, pcountry)
  formatex(msg_player[1], 191, "%s^x01 Disconnected (^x03%s^x01).", pname, pcountry)
 
  get_players(players, num, "c")
  for(new i = 0; i < num; i++){
 
   idx = players[i]
   if(idx == id) continue
 
   message_begin(MSG_ONE, SayText, {0, 0, 0}, idx)
   write_byte(idx)
   if(is_user_admin(idx)) write_string(msg_admin)
   else write_string(msg_player)
   message_end()
  }
 }
}
public client_connect(id){ 
 if(get_pcvar_num(PCVAR_JOINMSG) >= 3){
 
  get_user_name(id, pname, 31)
  get_user_ip(id, pip, 31, 1)
  get_user_authid(id, pauthid, 34)
  geoip_country(pip, pcountry)
 
  msg_admin[0] = 0x04
  msg_player[0] = 0x04
 
  formatex(msg_admin[1], 191, "%s ^x01(^x03%s^x01) (^x03%s^x01) Is connecting (^x03%s^x01).", pname, pip, pauthid, pcountry)
  formatex(msg_player[1], 191, "%s^x01 Is connecting (^x03%s^x01).", pname, pcountry)
 
  get_players(players, num, "c")
  for(new i = 0; i < num; i++){
 
   idx = players[i]
   if(idx == id) continue
 
   message_begin(MSG_ONE, SayText, {0, 0, 0}, idx)
   write_byte(idx)
   if(is_user_admin(idx)) write_string(msg_admin)
   else write_string(msg_player)
   message_end()
  }
 }
}
public client_authorized(id){ 
 if(get_pcvar_num(PCVAR_JOINMSG) >= 4){
 
  get_user_name(id, pname, 31)
  get_user_ip(id, pip, 31, 1)
  get_user_authid(id, pauthid, 34)
  geoip_country(pip, pcountry)
 
  msg_admin[0] = 0x04
  msg_player[0] = 0x04
 
  formatex(msg_admin[1], 191, "%s ^x01(^x03%s^x01) (^x03%s^x01) Authorized (^x03%s^x01).", pname, pip, pauthid, pcountry)
  formatex(msg_player[1], 191, "%s^x01 Authorized (^x03%s^x01).", pname, pcountry)
 
  get_players(players, num, "c")
  for(new i = 0; i < num; i++){
 
   idx = players[i]
   if(idx == id) continue
 
   message_begin(MSG_ONE, SayText, {0, 0, 0}, idx)
   write_byte(idx)
   if(is_user_admin(idx)) write_string(msg_admin)
   else write_string(msg_player)
   message_end()
  }
 }
}
============================================= =================
Attached Files
File Type: sma Get Plugin or Get Source (join_msg.sma - 626 views - 3.8 KB)

Last edited by ditmesteam; 02-16-2010 at 22:58.
ditmesteam is offline
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 09:17.


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