Liberty Unleashed
Scripting => Script Help => Topic started by: Peavy on June 05, 2013, 03:41:15 am
-
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.
-
Try This >>
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 );
}
}
-
With the code you gave me I get "scripts/main/carrepair.nut line = 1 column = 4 error expression expected"
-
With the code you gave me I get "scripts/main/carrepair.nut line = 1 column = 4 error expression expected"
Try This >>
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 );
}
}
}
-
Yes, that worked. What is it that I did wrong?
-
Yes, that worked. What is it that I did wrong?
Else >> else
This is The Wrong and Some Things . :D
-
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?
-
else Only :D
-
Alright. Thanks man, is there any way I can contact you easier if I run into another snag in coding?
-
If you have any more questions, feel free to ask on the forums. You will get better solutions and more options that way.
-
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
-
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.