I Am Looking For Force Server Car Skins @ Players

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
User avatar
sterretje22
road tourist
road tourist
Posts: 87
Joined: 29 May 2010 23:47
Owned TM-games: TMUF, TMNF, TM²
Manialink(s): fireteam
Location: Oudenburg(BE)
Contact:

I Am Looking For Force Server Car Skins @ Players

Post by sterretje22 » 02 Dec 2010 17:14

hello
I had seen on a other united server that
there was kind of force skins...
that everyone drove with the same car
I cant find on the forum a script for this

Somebody knows more of this? :scene:
`·.¸¸.->ѕтαя~ƒιяє<-.¸¸.·´
ImageImage
Image
`·.¸¸.->~ƒιяє~<-.¸¸.·´
Image

dukez30
sunday driver
sunday driver
Posts: 59
Joined: 23 Aug 2008 14:26
Owned TM-games: TMU

Re: I Am Looking For Force Server Car Skins @ Players

Post by dukez30 » 02 Dec 2010 17:33

There is isnt any such plugin that i know of, perhaps they just shared the same car?

User avatar
sterretje22
road tourist
road tourist
Posts: 87
Joined: 29 May 2010 23:47
Owned TM-games: TMUF, TMNF, TM²
Manialink(s): fireteam
Location: Oudenburg(BE)
Contact:

Re: I Am Looking For Force Server Car Skins @ Players

Post by sterretje22 » 03 Dec 2010 10:41

No:P
I was driving also that car
it was on coppers million server
we where with 10 and everyone had
a pink lotus:P maybe its a mod
and not a plug-in...
but thx for the reply
`·.¸¸.->ѕтαя~ƒιяє<-.¸¸.·´
ImageImage
Image
`·.¸¸.->~ƒιяє~<-.¸¸.·´
Image

jouko100
speedy pilot
speedy pilot
Posts: 375
Joined: 10 Mar 2007 09:33
Location: finland

Re: I Am Looking For Force Server Car Skins @ Players

Post by jouko100 » 03 Dec 2010 11:09

viewtopic.php?f=127&t=19815

pls do final version

User avatar
sterretje22
road tourist
road tourist
Posts: 87
Joined: 29 May 2010 23:47
Owned TM-games: TMUF, TMNF, TM²
Manialink(s): fireteam
Location: Oudenburg(BE)
Contact:

Re: I Am Looking For Force Server Car Skins @ Players

Post by sterretje22 » 03 Dec 2010 18:37

Thanks!
I will have a look on this!
`·.¸¸.->ѕтαя~ƒιяє<-.¸¸.·´
ImageImage
Image
`·.¸¸.->~ƒιяє~<-.¸¸.·´
Image

User avatar
Basskid
road tourist
road tourist
Posts: 81
Joined: 07 Sep 2008 12:40
Owned TM-games: TMO, TMS, TMN, TMUF
Manialink(s): Basskid, mwl, 100k, bk.ladder
Location: Germany
Contact:

Re: I Am Looking For Force Server Car Skins @ Players

Post by Basskid » 04 Dec 2010 01:00

I've seen a Plugin a long time ago in the German Deepsilver Forum... Here the code:

Code: Select all

<?php
/*
 Forced Skins Plugin for Xaseco by Naturtalent. Tested on v1.09.
 Thanks to Slig for answering some questions and helping with examples some time ago :)
 -- Note skin remapping works only for TMUF players --
 so if you want to use it effective for all players don't use stadium as packmask for your server

- This plugin will do:
 Remap skins on your server for TMUF players.
 You configure single skins to be replaced.
 You can configure single skins to be shown on the server.
 You can replace all other skins by a default skin, also several default skins
 Help you with the config as far as possible.
 Kick TMNF players on a Stadiumserver if you really want that.

- This plugin will NOT do:
 Remap skins of TMNF players (not possible)
 Force a player to actually drive with an allowed skin on his PC (not possible)
     -> despite that the wrong skin won't show if your config is fine
*/
global $forcedskins;
global $createchecksums;
global $kicknationsplayers;
global $skinsforchecksum;
global $showskininfo;
global $skininfourl;
Aseco::registerEvent('onStartup', 'forceSkins');
Aseco::registerEvent('onPlayerConnect', 'kicknationsplayer');

/*************************************************************************
*********************** CONFIG *******************************************
*************************************************************************/
// 0 = false    ,    1 = true


$createchecksums = 1;
// this creates the checksums for your skins and saves them to a txt file in your xaseco folder
// it also helps you to create your forcedskins array easier
// set only to true for first checksum creation and after that to false again


// nations players skins cannot be remapped
// decide if you want to kick them on a stadium server
// you should not set packmask to 'Stadium' in that case for a better solution
$kicknationsplayers = 0;


// define if you want to show info were to download your skins when a player connects
$showskininfo = 1;
$skininfourl = "http://www.yourskininfo.com";


// fill all your filenames of skins to be remapped in the array
// enclosed by '' and separated by ,
// array must be filled if you set createchecksums = true !!!
// make sure all skins are in your GameData/Skins/ folder of your server
$skinsforchecksum = array('skin1.zip','skin2_a.zip', 'skin3.zip');


// you need to create an array of arrays of your forced skins
// it's not that trivial, there's help in the README section at te bottom of this plugin
// using the createchecksums option will create a functional array in a textfile
// you can replace the array here with it
// you will still have to alter 'Orig' and 'Url' manually if needed

$forcedskins = array(
                        (array('Orig'=>'*','Name'=>'Skins/Vehicles/CarCommon/skin1.zip','Checksum'=>'1234567890','Url'=>'http://skindownload.com/skin/skin1.zip')),
                        (array('Orig'=>'*','Name'=>'Skins/Vehicles/CarCommon/skin2.zip','Checksum'=>'','Url'=>''))
                     );



/*************************************************************************
********************* CONFIG END *****************************************
*************************************************************************/


function forceSkins($aseco, $command){
global $forcedskins;



$aseco->addCall('SetForcedSkins', array($forcedskins));

    $aseco->client->query('GetForcedSkins');
        $response = $aseco->client->getResponse();
        $number = count($response);
    $aseco->console_text('[Force Skins] ' . $number . ' skins are getting remapped now for connecting players'. "\n");
    $aseco->client->query('GetSkinsDirectory');
        $response2 = $aseco->client->getResponse();
    $aseco->console_text('[Force Skins] Make sure all your remapped skins are additional in following server folder: '."\n".$response2."Vehicles\CarCommon\\". "\n");
    $aseco->client->query('EnableP2PUpload(true)');
    $response3 = $aseco->client->getResponse();
    if ($response3 == true)
    $aseco->console_text('[Force Skins] P2P is (now) enabled on server'. "\n");
    else
    $aseco->console_text('[Force Skins WARNING] P2P is not enabled on server'. "\n");


    checksumhelper();
}

function kicknationsplayer($aseco, $player){

        global $kicknationsplayers;
        global $showskininfo;
        global $skininfourl;
        if ($showskininfo == 1){
        $message = "You can find info and downloads of the server motto skins on "."\n"."\$l".$skininfourl."\$l";
        $aseco->client->query('ChatSendServerMessageToLogin', $message, $player->login);
        }
        if (kicknationsplayers == 0) {return 0;}
        else {
        $aseco->client->query('GetServerPackMask');;
        $packmask = $aseco->client->getResponse();
            if ($packmask == "Stadium") {
            $aseco->client->query('GetDetailedPlayerInfo', $player->login);
            $response = $aseco->client->getResponse();
                if ($response['OnlineRights'] == 0) $aseco->client->query('Kick', $player->login);
            }
            else {$kicknationsplayers = 0;}
        }




}

function mkChecksum($data){
            return trim(implode('',array_reverse(explode(',',chunk_split(strtoupper(md5($data)),2,',')))));
            }

function checksumhelper()
{
    global $createchecksums;
    global $skinsforchecksum;
        //
        if ($createchecksums == 1)
        {
            $skinfolder = '/GameData/Skins/Vehicles/CarCommon/';
            $file = "forcedskin_helper.txt";

            $textfile = fopen($file, a);
            fwrite($textfile, "\n". "\n"."new forced skin array:" ."\n". "\n". "\$forcedskins = array( "."\n");
            fclose($textfile);

            for ($i=0;$i<count($skinsforchecksum);$i++)
            {
            $data = $skinfolder.$skinsforchecksum[$i];
               $code = mkChecksum($data);
            echo 'skin: '.$skinsforchecksum[$i].'  checksum: '.$code."\n";

            if ($i<(count($skinsforchecksum)-1))
            $text = "(array('Orig'=>'*','Name'=>'Skins/Vehicles/CarCommon/".$skinsforchecksum[$i]."','Checksum'=>'".$code."','Url'=>'')),\n";
            else
            $text = "(array('Orig'=>'*','Name'=>'Skins/Vehicles/CarCommon/".$skinsforchecksum[$i]."','Checksum'=>'".$code."','Url'=>''))\n );";
            $textfile = fopen($file,a);
            fwrite($textfile, $text);
            fclose($textfile);
            }
        }
           return 0;
}

/*
        README SECTION

If you want to remap skins on your server you should do:
- Place all your skins in the GameData/Skins folder of your server.
 If it does not exist create it. Place locators there too. It won't harm :)
- Upload all skins to a webspace with direct download / hotlinking.

Now this is how the forcedskin array works:

Orig is the skin to get replaced.
    You can use '*' for any skin.
    Otherwise you have to give the name of the skin file
    with path relativ to the trackmania root folder
    Some examples:
    Coast Car: 'Orig'=>'Skins\Vehicles\CoastCar\U_Blue.zip'
    Desert Car: 'Orig'=>'Skins\Vehicles\American\Blackdevil.zip'

    Users Skins go to the CarCommon folder:
    User Skin: 'Orig'=>'Skin\Vehicles\CarCommon\userskin.zip'

    So to make sure the skin is remapped you should remap it at least two times or up to eight times
    for every thinkable environment (you play on your server) - folder and the CarCommon folder.

Name, Checksum and URL define the new skin.
    You can leave any of them empty: ''
    If all three are empty it means same as Orig.
    My advise is to define every skin with one you know where it is located on your server.
    In case you put all skins in your /GameData/Skins/ directory you only have to give the filename for 'Name'

    Checksum you should create with the Checksum helper of this plugin.
    Then you find a functional array for your config in forcedskinhelper.txt in your Xaseco root directory.

    Now you only have to fill in Orig and URL by your own.
    URL is not a must but will hopefully help to reduce traffic transfer on your server and speed up the process.

    To allow a special skin just remap it with itself :P.
    Make sure to place remapping of special skins in front of the default ones ('Orig'=>'*') in the array.
    To have more than one default skin you can use 'Orig'=>'*' several times.


This may be a little confusing so go out and test it before adding it to your public server.
Keep in mind that it may need some time in game to transfer the skin data to your PC.

*/
?>
Source: http://forum.deepsilver.com/forum/showt ... hp?t=41812

Not Coded by me !!! But i hope that helps you a lil bit :)

User avatar
sterretje22
road tourist
road tourist
Posts: 87
Joined: 29 May 2010 23:47
Owned TM-games: TMUF, TMNF, TM²
Manialink(s): fireteam
Location: Oudenburg(BE)
Contact:

Re: I Am Looking For Force Server Car Skins @ Players

Post by sterretje22 » 05 Dec 2010 16:27

yeah it works on my united server thx...
now I will try it on my stadium server ^^
`·.¸¸.->ѕтαя~ƒιяє<-.¸¸.·´
ImageImage
Image
`·.¸¸.->~ƒιяє~<-.¸¸.·´
Image

Post Reply