login
April 19, 2024, 03:55:53 pm

Author Topic: Little help :p  (Read 1790 times)

0 Members and 1 Guest are viewing this topic.

WiLsOn

  • Crazy Man
  • *****
  • *
  • *
  • *
  • Posts: 5488
  • Country: 00
  • First in battle last in retreat.
    • View Profile
Little help :p
« on: July 04, 2012, 10:00:51 am »
Code: [Select]
else if ( cmd == "show" )
    {
if ( !player.IsSpawned ) PrivMessage( "Error - Your Not Spawned Yet.", player );
else
{
      ClientMessageToAll("" + player.Name + " Back From Stealth Mode",0, 229, 254 );
      ClientMessage( "Now Your Showing At Map",player,0, 255,0 )
      EchoMessage( "7>>2 " + player.Name + " entered in stealth mode." )    
  HideON[ player.ID ] = false;
  player.SetMarker( "1", player );
}
}

Tried everything but still this cmd doesnt work, when i type !hide its work but when i type !show it doesnt show player in map.

Thanks in advance.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor







Thijn

  • Forum Administrator
  • Crazy Man
  • *
  • *
  • *
  • Posts: 2946
  • Country: nl
    • View Profile
Re: Little help :p
« Reply #1 on: July 04, 2012, 10:24:21 am »
Well first of all you're missing a lot of ;'s
Also, I think SetMarker needs an boolean.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

I'm not totally useless,
I can be used as an bad example ;)

"Never do Today, What you can do Tomorrow"


Skirmant

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 681
  • Country: il
  • Ignorance is bliss.
    • View Profile
Re: Little help :p
« Reply #2 on: July 04, 2012, 10:27:00 am »
I may not know much about squirrel, but I'm pretty damn sure  "player.SetMarker( "1", player );" should contain an integer or bool.
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

"C++ is a horrible language" - Linus Torvalds, creator of Linux

Quote
<SLC> nope. changed my mind. squirrel still sux dix
<SLC> it's just a piece of sh!t
* SLC has quit (Connection closed)

morphine

  • Crazy Man
  • *****
  • Posts: 1909
  • Country: lt
    • View Profile
Re: Little help :p
« Reply #3 on: July 04, 2012, 12:34:10 pm »
The function itself is
Code: [Select]
player.SetMarker( colorID ); where colorID is the player's Team ID (in all cases except FFA, where the color ID is 16).

You can try enabling blips with something like this:
Code: [Select]
if( player.Team == 255 ) player.SetMarker( 16 );
else player.SetMarker( player.Team.tointeger() );

Or, you can do it the long and boring way with a custom function:
Code: [Select]
function SetPlayerMarker( player, num )
{
        player.RemoveMarker();


        switch( num )
        {

                case 255:
                {
                        player.SetMarker( 16 );
                        break;
                }
                case 0:
                {
                        player.SetMarker( 0 );
                        break;
                }
                case 1:
                {
                        player.SetMarker( 1 );
                        break;
                }
                case 2:
                {
                        player.SetMarker( 2 );
                        break;
                }
                case 3:
                {
                        player.SetMarker( 3 );
                        break;
                }
                case 4:
                {
                        player.SetMarker( 4 );
                        break;
                }
                case 5:
                {
                        player.SetMarker( 5 );
                        break;
                }
                case 6:
                {
                        player.SetMarker( 6 );
                        break;
                }
                case 7:
                {
                        player.SetMarker( 7 );
                        break;
                }
                case 8:
                {
                        player.SetMarker( 8 );
                        break;
                }
                case 9:
                {
                        player.SetMarker( 9 );
                        break;
               
                }
                case 10:
                {
                        player.SetMarker( 10 );
                        break;
                }
                case 11:
                {
                        player.SetMarker( 11 );
                        break;
                }
                case 12:
                {
                        player.SetMarker( 12 );
                        break;
                }
                case 13:
                {
                        player.SetMarker( 13 );
                        break;
                }
                case 14:
                {
                        player.SetMarker( 14 );
                        break;
                }
                case 15:
                {
                        player.SetMarker( 15 );
                        break;
                }

        }
}

Note: For the FFA class, the team ID returns 255, whereas the class ID returns -1.
Note 2: The 'num' parameter in the function I posted would simply be "player.Team".
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor


Skirmant

  • Vice Underdog
  • Crazy Man
  • *
  • *
  • Posts: 681
  • Country: il
  • Ignorance is bliss.
    • View Profile
Re: Little help :p
« Reply #4 on: July 04, 2012, 01:39:15 pm »
Or, you can do it the long and boring way with a custom function:
Code: [Select]
function SetPlayerMarker( player, num )
{
        player.RemoveMarker();


        switch( num )
        {

                case 255:
                {
                        player.SetMarker( 16 );
                        break;
                }
                case 0:
                {
                        player.SetMarker( 0 );
                        break;
                }
                case 1:
                {
                        player.SetMarker( 1 );
                        break;
                }
                case 2:
                {
                        player.SetMarker( 2 );
                        break;
                }
                case 3:
                {
                        player.SetMarker( 3 );
                        break;
                }
                case 4:
                {
                        player.SetMarker( 4 );
                        break;
                }
                case 5:
                {
                        player.SetMarker( 5 );
                        break;
                }
                case 6:
                {
                        player.SetMarker( 6 );
                        break;
                }
                case 7:
                {
                        player.SetMarker( 7 );
                        break;
                }
                case 8:
                {
                        player.SetMarker( 8 );
                        break;
                }
                case 9:
                {
                        player.SetMarker( 9 );
                        break;
               
                }
                case 10:
                {
                        player.SetMarker( 10 );
                        break;
                }
                case 11:
                {
                        player.SetMarker( 11 );
                        break;
                }
                case 12:
                {
                        player.SetMarker( 12 );
                        break;
                }
                case 13:
                {
                        player.SetMarker( 13 );
                        break;
                }
                case 14:
                {
                        player.SetMarker( 14 );
                        break;
                }
                case 15:
                {
                        player.SetMarker( 15 );
                        break;
                }

        }
}

Yikes! The function can be done in a less boring way :P

Code: [Select]
function SetPlayerMarker( player, num ) {
 player.RemoveMarker();
 player.SetMarker(num != 255?num:16);
}
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor

"C++ is a horrible language" - Linus Torvalds, creator of Linux

Quote
<SLC> nope. changed my mind. squirrel still sux dix
<SLC> it's just a piece of sh!t
* SLC has quit (Connection closed)

WiLsOn

  • Crazy Man
  • *****
  • *
  • *
  • *
  • Posts: 5488
  • Country: 00
  • First in battle last in retreat.
    • View Profile
Re: Little help :p
« Reply #5 on: July 05, 2012, 09:02:00 am »
Thanks Morphine that works  :thumbsup:
Agree Disagree Funny Winner Pwnt Informative Friendly Useful Optimistic Artistic Late Brain Donor