Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #define VIP_FLAG ADMIN_IMMUNITY
- new sConnected,PLUGIN[][]={"Auto Steam VIP","1.0","Seroff"};
- #define get_bit(%1,%2) ( %1 & 1 << ( %2 & 31 ) )
- #define set_bit(%1,%2) ( %1 |= ( 1 << ( %2 & 31 ) ) )
- #define clear_bit(%1,%2) ( %1 &= ~( 1 << ( %2 & 31 ) ) )
- public plugin_init(){ register_plugin(PLUGIN[0], PLUGIN[1], PLUGIN[2]); }
- public client_disconnect(id){clear_bit(sConnected, id);}
- public client_putinserver(id){
- set_bit(sConnected, id);
- if(is_user_steam(id)){
- set_task(2.0,"set_vip",id);
- }
- }
- public set_vip(id){
- set_user_flags(id, VIP_FLAG);
- ColorChat(id, "^3Вам ^1выданы ^4vip ^1права за [^4Steam^1]");
- }
- bool:is_user_steam(id){
- static dp_pointer;
- if(dp_pointer || (dp_pointer = get_cvar_pointer("dp_r_id_provider"))) {
- server_cmd("dp_clientinfo %d", id);
- server_exec();
- return (get_pcvar_num(dp_pointer) == 2) ? true : false;
- }
- return false;
- }
- stock ColorChat(const id, const input[], any:...){
- static count = 1, players[32],msg[191];
- vformat(msg, 190, input, 3);
- replace_all(msg, 190, "!g", "^4"); // Зелёный
- replace_all(msg, 190, "!y", "^1"); // Стандартный
- replace_all(msg, 190, "!t", "^3"); // Цвет команды
- if (id) players[0] = id; else get_players(players, count, "ch")
- {
- for(new i = 0; i < count; i++){
- if(get_bit(sConnected,players[i])){
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment