Author Topic: Some newbie questions..  (Read 5178 times)

ian727

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Some newbie questions..
« Reply #15 on: February 08, 2014, 11:44:25 am »
function onPlayerCommand( pPlayer, szCommand, szText )
{
   if ( szCommand == "rgb2" )
   {
      if ( pPlayer.Vehicle ) pPlayer.Vehicle.RGBColour1 = Colour( 10, 40, 92 );
   }
return 1;
}


Thats the file's content^^

SugarD

  • Argonath RPG Dev/Manager
  • Tester
  • Sr. Member
  • ****
  • Posts: 820
  • Karma: +37/-75
  • STOP IN THE NAME OF THE COLESLAW!
    • View Profile
    • Clan Xperience
Re: Some newbie questions..
« Reply #16 on: February 10, 2014, 04:03:17 pm »
function onPlayerCommand( pPlayer, szCommand, szText )
{
   if ( szCommand == "rgb2" )
   {
      if ( pPlayer.Vehicle ) pPlayer.Vehicle.RGBColour1 = Colour( 10, 40, 92 );
   }
return 1;
}


Thats the file's content^^
My Squirrel is very rusty, but it looks like you're telling the command to expect text after the command itself is sent, which you don't need because you are already specifying the color input automatically.

Try removing ", szText" and see what happens.

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Some newbie questions..
« Reply #17 on: February 10, 2014, 05:28:47 pm »
<>
Code: [Select]
function onPlayerCommand( plr, cmd, text )
{
   if ( cmd == "c1" )
   {
      if ( plr.Vehicle )
       {
            local r = GetTok( text, " ", 1 ).tointeger(), g = GetTok( text, " ", 2 ).tointeger(), b = GetTok( text, " ", 3 ).tointeger();
    plr.Vehicle.RGBColour1 = Colour( r, g, b );
       }
       
       else
       {
          MessagePlayer( "[#00ff00]*Server* [#ff0000]You are not in a vehicle", plr );
       }
   }

   if ( cmd == "c2" )
   {
      if ( plr.Vehicle )
       {
            local r = GetTok( text, " ", 1 ).tointeger(), g = GetTok( text, " ", 2 ).tointeger(), b = GetTok( text, " ", 3 ).tointeger();
    plr.Vehicle.RGBColour2 = Colour( r, g, b );
       }
       
       else
       {
          MessagePlayer( "[#00ff00]*Server* [#ff0000]You are not in a vehicle", plr );
       }
   }
     
   return 1;
}






ian727

  • Newbie
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Some newbie questions..
« Reply #18 on: February 12, 2014, 07:20:03 pm »
Thank you very much, but what exactly do I have to type now while running the game? I also think that I need to replace some spaces in your script, I already added the numbers instead of the letters r, g, b - Is that correct?

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Some newbie questions..
« Reply #19 on: February 12, 2014, 09:15:26 pm »
You Shouldn't Do any thing on this script.
You should Type on the game >> EX: /c2 255 255 255



 

© Liberty Unleashed Team.