Changeskin, paint -> Commands

Started by soulshaker, Oct 17, 2014, 05:16 AM

Previous topic - Next topic

soulshaker

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 :)

Sebastian

Would be better if you make the paint command to change both colors of the vehicle. :)
Anyway, good job.

soulshaker

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

kokia

changeskin not working error expression expected

MacTavish

#4
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

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

BrYaN_FuRy


KAKAN

The command is fine, show us the error @kokia
oh no