Vice City: Multiplayer

Server Development => Scripting and Server Management => Snippet Showroom => Topic started by: soulshaker on Oct 17, 2014, 05:16 AM

Title: Changeskin, paint -> Commands
Post by: soulshaker on Oct 17, 2014, 05:16 AM
Changeskin:-

if ( cmd == "changeskin" )
    {
        if ( !player.IsSpawned ) MessagePlayer( "[#EE3B3B]You have to be spawned to use this command.", player );
        else if ( !text ) MessagePlayer( "[#FFFFFE]Syntax:- /" + cmd + "[#EE3B3B] <ID/SkinName>", player );
        else if( IsNum(text) )
{
player.Skin = text.tointeger();
         MessagePlayer( "[#66CD00]Skin changed to: " + GetSkinName( player.Skin ), player );
        }
else
         {
local skin_id = GetSkinID(text);
         if (skin_id < 0) MessagePlayer( "[#EE3B3B]Could not identify the specified skin name.", player );
else
         {
player.Skin = skin_id;
MessagePlayer( "[#66CD00]Skin changed to: " + GetSkinName( player.Skin ), player );
}
}
    }

Paint1(Vehicle Colour 1):-

if ( cmd == "paint1" )
                {
                    if ( !player.IsSpawned ) MessagePlayer( "[#EE3B3B]You have to be spawned to use this command", player );
                        else if ( !player.Vehicle ) MessagePlayer( "[#FFFFFE]Error: [#EE3B3B]You must be in a vehicle to use this command", player );
                        else if ( !text ) MessagePlayer( "[#FFFFFE]Syntax:- /" + cmd + "[#EE3B3B] <ID> (Id must be between 0 to 94)", player );
                        else if ( !IsNum( text ) ) MessagePlayer( "[#FFFFFE]Error: [#EE3B3B]The color ID should be in integer/number.", player );
                        else if ( text.tointeger() > 94 ) MessagePlayer( "[#FFFFFE]Syntax:- /" + cmd + "[#EE3B3B] <ID> (Id must be between 0 to 94)", player );
                        else
                        {
                         player.Vehicle.Colour1 = text.tointeger();
                         MessagePlayer( "[#66CD00]You have change colour of your vehicle", player );
                        }
                }

Paint2(Vehicle Colour 2):-

if ( cmd == "paint2" )
                {
                    if ( !player.IsSpawned ) MessagePlayer( "[#EE3B3B]You have to be spawned to use this command", player );
                        else if ( !player.Vehicle ) MessagePlayer( "[#FFFFFE]Error: [#EE3B3B]You must be in a vehicle to use this command", player );
                        else if ( !text ) MessagePlayer( "[#FFFFFE]Syntax:- /" + cmd + "[#EE3B3B] <ID> (Id must be between 0 to 94)", player );
                        else if ( !IsNum( text ) ) MessagePlayer( "[#FFFFFE]Error: [#EE3B3B]The color ID should be in integer/number.", player );
                        else if ( text.tointeger() > 94 ) MessagePlayer( "[#FFFFFE]Syntax:- /" + cmd + "[#EE3B3B] <ID> (Id must be between 0 to 94)", player );
                        else
                        {
                         player.Vehicle.Colour2= text.tointeger();
                         MessagePlayer( "[#66CD00]You have change colour of your vehicle", player );
                        }
                }
Simple commands, but i thought these may help some people :)
Title: Re: Changeskin, paint -> Commands
Post by: Sebastian on Oct 17, 2014, 01:44 PM
Would be better if you make the paint command to change both colors of the vehicle. :)
Anyway, good job.
Title: Re: Changeskin, paint -> Commands
Post by: soulshaker on Oct 18, 2014, 04:53 PM
Quote from: sseebbyy on Oct 17, 2014, 01:44 PMWould be better if you make the paint command to change both colors of the vehicle. :)
Anyway, good job.
hmm, 2 wheelers dont need colour2, so i created a new command which changes colour2.
Post Updated
Title: Re: Changeskin, paint -> Commands
Post by: kokia on Jul 29, 2015, 03:19 PM
changeskin not working error expression expected
Title: Re: Changeskin, paint -> Commands
Post by: MacTavish on Jul 29, 2015, 03:37 PM
Quote from: kokia on Jul 29, 2015, 03:19 PMchangeskin not working error expression expected

@kokia the command is fine maybe you done something wrong in your command showme
Title: Re: Changeskin, paint -> Commands
Post by: BrYaN_FuRy on Jul 29, 2015, 03:49 PM
why did i think bump?
Title: Re: Changeskin, paint -> Commands
Post by: KAKAN on Jul 29, 2015, 05:24 PM
The command is fine, show us the error @kokia