[Include] SCS.inc | The Most Usefull Include for Server Control
#1

Server Controller
By 4ir-W4ys
Hey, I made a Include that Help You alot about your server Settings. It's Don't have alot functions becuase it's My first release. But it's Tested good. It have 3 very usefull functions
And Supportinf Dini.inc.

How to Use? (Functions)


pawn Код:
LoadServerSettings();
This function will load the Server files from the Dini File (scriptfiles/Server/ServerSettings.ini)
You need to Put it in
pawn Код:
public OnGameModeInit();
Note: As it's Controlling the Game Mode Text Delete the function
pawn Код:
SetGameModeText
Note!!!: Make Sure You got the 'ServerSettings.ini' in your scriptfiles/Server Directory Or the samp-server.exe will crash.
Note!!!: Make Sure You agree'd my License ( Go to the file SCS.inc, Search for 'new Agree = 0' and change it to 'new Agree = 1') Or the samp-server.exe will crash.
----------------------------------------------------------------------------------
pawn Код:
GetServerSourceValue(Source[]);
This command Will get the Saved Source of the Dini
Example:
pawn Код:
public OnPlayerConnect(playerid)
{
    new String[128];
    format(String, sizeof(String), "Welcome to %s", GetServerSourceValue("HostName"));
    SendClientMessage(playerid, White, String);
    return 1;
}
The Source 'HostName' Will get the Server Name from the Dini File.
There are 3 Sources That you can use in GetServerSourceValue:
pawn Код:
/* 1.*/ "HostName" // The Server Name Source
/* 2.*/ "Map" // The Server Map Name Source
/* 3.*/ "Mode" // The Server Mode name Source
-----------------------------------------------------------------------
pawn Код:
ChangeServerSetting(Source[], Setting[]);
That Function will Change the Setting You want In their Source.
Example:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/WeAreInLasVenturas", cmdtext, true))
    {
        ChangeServerSetting("Map", "Las Venturas");
        SendClientMessageToAll(0xFFFFFFFF, "The Server Map Name Changed to {33FF33}Las Venturas");
        return 1;
    }
    return 0;
}
After that Command, The Map Name of the server In SAMP Server Lists will Automaticly Change to Las Venturas
Becuase After That Function Being Used Automaticly It will Use the Function
pawn Код:
LoadServerSettings
And it will be changed!
----------------------------------------------------------------------------------------
I had another thing you can control but For now you cannot cantrol it from the Functins, Just from the ini File.
It's The "InteriorDoors" If it 1 It Enable 0 Is Disable, cannot be used in GetserverSourceValue and SetServerSetting.

Download
Here are Some Mirrors:
2Shared
SendSpace
Uploading


Bugs
You really Think There are bugs in my work? Im Bleeding!!!
Feel Free to PM me or Post here found Bugs

Next Version Features
More Options to Control, Maybe fix a bugs if fund and more.

Peace Out!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)