Raised This Month: $ Target: $400
 0% 

GPS block on BlockMaker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nikolov
Senior Member
Join Date: Feb 2011
Old 12-05-2011 , 14:10   GPS block on BlockMaker
Reply With Quote #1

I search action code of blockmaker who shows where is CT's and TT's players.
Example with Paint Image...
http://img846.**************/img846/6398/showw.png

Sry about my bad creation with PAINT...

With another words... When player steppeed on this block will show Red and Blue lines. To CT (blue lines) players and (red lines) to TT players.

CT - Counter-Terrorists Team
TT - Terrorists Team

Sry about my english...
nikolov is offline
diablix
Senior Member
Join Date: Jan 2010
Location: Warsaw, Poland
Old 12-10-2011 , 11:16   Re: GPS block on BlockMaker
Reply With Quote #2

I didn't make this action to show all players, your dedicated server wouldn't feel good with action like that.. Instead, I made action that will show your neariest enemy.

PHP Code:
enum Type {
    
DONT_IGNORE_TEAMMATES,
    
IGNORE_TEAMMATES
};

new 
g_sSprLaser;

public 
plugin_precache() g_sSprLaser engfunc(EngFunc_PrecacheModel"sprites/laserbeam.spr");

public 
actionGps(id){
    new 
iClosestEnemy getClosestPlayer(idIGNORE_TEAMMATES);
    
    if(
is_user_alive(iClosestEnemy))
        
createColouredLineByTeam(idiClosestEnemy);
    else{
        
set_hudmessage(2552552550.030.3400.10.10.20.2);
        
show_hudmessage(id"Could not find any available enemies.");
    }
}

stock createColouredLineByTeam(idiTarget){
    new 
Float:fOrigin[0x2][0x3], iColor[0x3];
    
pev(idpev_originfOrigin[0]);
    
pev(iTargetpev_originfOrigin[1]);
    
    if(
get_user_team(iTarget)==0x2)
        
iColor[2]=0xFF;
    else
        
iColor[0]=0xFF;
    
    
message_begin(MSG_ONESVC_TEMPENTITY, {0x00x00x0}, id);
    
write_byte(0x0);
    
engfunc(EngFunc_WriteCoordfOrigin[0x0][0x0]);
    
engfunc(EngFunc_WriteCoordfOrigin[0x0][0x1]);
    
engfunc(EngFunc_WriteCoordfOrigin[0x0][0x2]);
    
engfunc(EngFunc_WriteCoordfOrigin[0x1][0x0]);
    
engfunc(EngFunc_WriteCoordfOrigin[0x1][0x1]);
    
engfunc(EngFunc_WriteCoordfOrigin[0x1][0x2]);
    
write_short(g_sSprLaser);
    
write_byte(0x3);
    
write_byte(0x0);
    
write_byte(0x1);
    
write_byte(0xA);
    
write_byte(0x0);
    
write_byte(iColor[0x0]);
    
write_byte(iColor[0x1]);
    
write_byte(iColor[0x2]);
    
write_byte(0x40);
    
write_byte(0x0);
    
message_end();
}

stock getClosestPlayer(idType:ignoreteammates){
    new 
iPlayers[0x20], Float:flClosestDist 9999.9Float:flDistFloat:fOrigin[0x2][0x3], iNumiPlayeriClosestPlayer;
    
ignoreteammates get_players(iPlayersiNum"ache"get_user_team(id) == "TERRORIST" "CT") : get_players(iPlayersiNum"ach");
    
    for(new 
0iNumi++){    
        
iPlayer iPlayers[i];
        
        
pev(iPlayerpev_originfOrigin[0x0]);
        
pev(idpev_originfOrigin[0x1]);
        
        
flDist get_distance_f(fOrigin[0x0], fOrigin[0x1]);
        
        if(
flDist <= flClosestDist){
            
iClosestPlayer     iPlayer;
            
flClosestDist     flDist;
        }
    }
    if(
is_user_alive(iClosestPlayer))
        return 
iClosestPlayer;
    
    return -
1;

diablix is offline
Send a message via Skype™ to diablix
nikolov
Senior Member
Join Date: Feb 2011
Old 12-10-2011 , 14:12   Re: GPS block on BlockMaker
Reply With Quote #3

10x a lot of... Can you modify code to show lines from all ? When CT stepp on block this line can be seen from TT...
nikolov is offline
diablix
Senior Member
Join Date: Jan 2010
Location: Warsaw, Poland
Old 12-11-2011 , 04:50   Re: GPS block on BlockMaker
Reply With Quote #4

PHP Code:
message_begin(MSG_ONESVC_TEMPENTITY, {0x00x00x0}, id); 

->
PHP Code:
message_begin(MSG_ALLSVC_TEMPENTITY); 

Last edited by diablix; 12-11-2011 at 04:51.
diablix is offline
Send a message via Skype™ to diablix
Reply


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 20:59.


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