Raised This Month: $ Target: $400
 0% 

ScoreAttrib VIP message independent of a team


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
benio101
Junior Member
Join Date: Feb 2012
Location: Toruń, Poland
Old 08-12-2012 , 02:33   ScoreAttrib VIP message independent of a team
Reply With Quote #1

Hi!

Because no one code for VIP status in Score Table works fine,
even on AlliedModders, always being loosing some informations
(i.e. `bout having bomb after throwing away and taking again from ground),
i finally wrote the code, wchich simply adds VIP status for people, who have a T flag.

The trick was the fact, ScoreAttribMessage is bitsum information and the priority of statuses
are directly proportional to the power of number tho, wchich repsentant following flag values:

- VIP with 4 flag being equal to two to the power of two
- Bomb with 2 flag being equal to two to the power of one
- Dead with 1 flag being equal to two to the power of zero

So, the working, good one code is
PHP Code:
register_message(get_user_msgid("ScoreAttrib"), "g_VipStatus");

public 
g_VipStatus(){
    new 
id=get_msg_arg_int(1);
    if(
is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
        
set_msg_arg_int(2ARG_BYTEget_msg_arg_int(2)|4)

It makes me happy, they are ways, turnings from impossible to ready after time,
as jim_yang`s Max Money module or Arkshine`s Custom Hud awesome solutions.

Anyway, live terrorists (hereinafter referred to as TT) don`t see VIP status
and live anti-terrorists (hereinafter referred to as CT) don`t see BOMB status.

I am curious if it is possible to change team for TT, then send message as they are CT and change theirs team back
to CT leaving the VIP status in Score set by ScoreAttrib message with 2nd argument bitsum of 2 squared equal positive.

So, i tried
PHP Code:
register_message(get_user_msgid("ScoreAttrib"), "g_VipStatus");

public 
g_VipStatus(){
    new 
id=get_msg_arg_int(1);
    new 
bool:team=false;
    if(
get_user_team(id)==&& is_user_alive(id))
        
team=true;
    if(
team)//if CT, set team to CT
        
set_pdata_int(id,114,2);//114 means TEAM pdata
    
if(is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
        
set_msg_arg_int(2ARG_BYTEget_msg_arg_int(2)|4);//sens info
    
if(team)//and back the team to TT leaving "VIP" status in Score table
        
set_pdata_int(id,114,1);

but, unfortunatelly, i failed.

Is it possible to send that info or try to edit it`s memory using
Orpheu or Rage to reach live TT "VIP" status in Score table?


My target is create fully work ScoreAttrib VIP status,
independing of the team or CS hardcoded limitations.

I would be grateful for reply.
Best regards, benio101
benio101 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 05:43.


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