Author Topic: Vehicle Repair script not working.  (Read 9625 times)

Peavy

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Vehicle Repair script not working.
« on: June 05, 2013, 03:41:15 am »
Code: [Select]
Else if( szcmd == "repairvehicle" )
{
if ( pPlayer.Vehicle )
{
MessagePlayer( "Your vehicle has been fixed",pPlayer );
pPlayer.Vehicle.Fix();
}
Else MessagePlayer ( "You are not in a vehicle",pPlayer );
}
}
The script won't load or anything, I put "<script file="carrepair.nut" client="0"/>" in the "script.xml" but it won't load.

Did I do something wrong? Sorry. I'm a noob at this.

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Vehicle Repair script not working.
« Reply #1 on: June 05, 2013, 04:11:27 am »
Try This >>
Code: [Select]
else if( szcmd == "repairvehicle" )
      {
if ( pPlayer.Vehicle )
{
MessagePlayer( "Your vehicle has been fixed",pPlayer );
pPlayer.Vehicle.Fix();
}
else
         {
            MessagePlayer ( "You are not in a vehicle",pPlayer );
         }
       }
 



Peavy

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Vehicle Repair script not working.
« Reply #2 on: June 05, 2013, 04:20:58 am »
With the code you gave me I get "scripts/main/carrepair.nut line = 1 column = 4 error expression expected"

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Vehicle Repair script not working.
« Reply #3 on: June 05, 2013, 04:36:06 am »
With the code you gave me I get "scripts/main/carrepair.nut line = 1 column = 4 error expression expected"

Try This >>
Code: [Select]
function onPlayerCommand( player, cmd, text )
{
  if( cmd == "repairvehicle" )
   {
     if ( player.Vehicle )
      {
MessagePlayer( "Your vehicle has been fixed",player );
player.Vehicle.Fix();
      }
     else
      {
        MessagePlayer ( "You are not in a vehicle",player );
      }
   }
}



Peavy

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Vehicle Repair script not working.
« Reply #4 on: June 05, 2013, 04:41:18 am »
Yes, that worked. What is it that I did wrong?

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Vehicle Repair script not working.
« Reply #5 on: June 05, 2013, 04:44:53 am »
Yes, that worked. What is it that I did wrong?

Else >> else
This is The Wrong and Some Things . :D



Peavy

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Vehicle Repair script not working.
« Reply #6 on: June 05, 2013, 04:47:06 am »
Yes, that worked. What is it that I did wrong?

Else >> else
This is The Wrong and Some Things . :D
So I shouldn't use caps in coding?

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Vehicle Repair script not working.
« Reply #7 on: June 05, 2013, 04:49:44 am »
Code: [Select]
else Only  :D



Peavy

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Vehicle Repair script not working.
« Reply #8 on: June 05, 2013, 04:51:42 am »
Alright. Thanks man, is there any way I can contact you easier if I run into another snag in coding?

Vortrex

  • Full Member
  • ***
  • Posts: 267
  • Karma: +54/-74
    • View Profile
Re: Vehicle Repair script not working.
« Reply #9 on: June 05, 2013, 04:53:42 am »
If you have any more questions, feel free to ask on the forums. You will get better solutions and more options that way.

Mido_Pop

  • Full Member
  • ***
  • Posts: 168
  • Karma: +6/-20
  • The_Pops ( War )
    • View Profile
Re: Vehicle Repair script not working.
« Reply #10 on: June 05, 2013, 04:55:49 am »
If you have any more questions, feel free to ask on the forums. You will get better solutions and more options that way.
Or You Can Send Me A Massage And I Will help You  :D



Peavy

  • Newbie
  • *
  • Posts: 27
  • Karma: +0/-0
    • View Profile
Re: Vehicle Repair script not working.
« Reply #11 on: June 05, 2013, 05:01:13 am »
Thanks guys, I'll probably be around here a bit sense I'm still a noob at this stuff.
I can do simple teleporter scripts and making /help commands with ease. However that repair vehicle script was a bit more difficult.

 

© Liberty Unleashed Team.