Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_commands>
- forward KickT(playerid);
- new ServerLocked;
- new PlayerAdmin[MAX_PLAYERS];
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- ServerLocked = 0;
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- main()
- {
- print("\n----------------------------------");
- print(" Server Lock System By Ciandlah");
- print("----------------------------------\n");
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- PlayerAdmin[playerid] = 0;
- return 1;
- }
- public OnPlayerRequestClass(playerid)
- {
- if(ServerLocked == 1)
- {
- SendClientMessage(playerid, -1, "Server Note: The server has been locked and therfore it has kicked you.");
- SetTimerEx("KickT", 1000, playerid, "i", false);
- }
- return 1;
- }
- public KickT(playerid)
- {
- Kick(playerid);
- return 1;
- }
- CMD:setadmin(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerAdmin[playerid] == 0)
- {
- PlayerAdmin[playerid] = 1;
- }
- else
- {
- PlayerAdmin[playerid] = 0;
- }
- }
- return 1;
- }
- CMD:lock(playerid, params[])
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerAdmin[playerid] == 1)
- {
- if(ServerLocked == 0)
- {
- ServerLocked = 1;
- }
- else
- {
- ServerLocked = 0;
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement