VC:MP 0.4 (Beta) > Script Releases
Changeskin, paint - commands
soulshaker:
Changeskin:-
--- Code: ---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 );
}
}
}
--- End code ---
Paint:-
--- Code: ---if ( cmd == "paint" )
{
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 );
}
}
--- End code ---
Simple commands, but i thought these may help some people :)
Flockshot:
You added
--- Code: ---text = text.tointeger();
--- End code ---
when there is no need for it.
You can just simply do
--- Code: ---player.Skin = text.tointeger();
veh.Colour1 = text.tointeger();
--- End code ---
Also when you are making a variable of player.Vehicle and only using it once in
--- Code: ---else if ( !veh )
--- End code ---
when u dont use it here
--- Code: ---player.Vehicle.Colour1 = text.tointeger();
--- End code ---
Simple errors which make the server do more work.
Other than that its good.
soulshaker:
Thanks :)
Updated.
Honey.:
Nice, It will get better if you add different attractive bright colors ;)
soulshaker:
Actually it depend on others, which colour they want to add. So i didn't added any :)
Navigation
[0] Message Index
[#] Next page
Go to full version