I've been trying to modify the Daredevil character's ESP rings to show as red for Terrorists, and Blue for Counter-Terrorists (and down the road have cvars to show only your team, or the enemy). Since I know basically none of the "Small" scripting language, I've been getting code from other superheros. I've gotten most of the team detection and stuff from Xavier. Like I say I know pretty much nothing about Small scripting except what I've learned by reading plugins.
I've decided to post the code that I've modified, so if you don't want to d/l it you can just look to see the changes:
Code:
public daredevil_esp( id )
{
new players[SH_MAXSLOTS];
new c;
new vec1[3];
get_players(players,c,"a");
for(new i = 0; i < c; i++)
{
if(players[i]==id) continue;
get_user_origin(players[i],vec1,0);
if ( !is_user_alive(id) ) return
message_begin(MSG_ONE,SVC_TEMPENTITY,vec1,id)
write_byte( 21 );
write_coord(vec1[0]);
write_coord(vec1[1]);
write_coord(vec1[2] + 16);
write_coord(vec1[0]);
write_coord(vec1[1]);
write_coord(vec1[2] + 768 ) // test get_cvar_num("daredevel_radius") ); //1936
write_short( gSpriteWhite );
write_byte( 0 ); // startframe
write_byte( 1 ); // framerate
write_byte( 6 ); // 3 life 2
write_byte( 8 ); // width 16
write_byte( 1 ); // noise
if ( get_user_team(id) == 1) {
write_byte( 255 ); // r
write_byte( 100 ); // g
write_byte( 100 ); // b
}
else if ( get_user_team(id) == 2) {
write_byte( 100 ); // r
write_byte( 100 ); // g
write_byte( 255 ); // b
}
write_byte( get_cvar_num("daredevil_bright") ); //brightness
write_byte( 0 ); // speed
message_end();
}
}