30.01.2010, 14:13
I use this admin script for my server
THIS IS 1 PART OF SCRIPT, I CANT PUT ALL ITS MAX ALLOWED 20000
And when anybody come on server nobody can talk evrybody is muted + me we can talk just on PM
THIS IS 1 PART OF SCRIPT, I CANT PUT ALL ITS MAX ALLOWED 20000
Код:
//----------------------------------------------------------------------------// // JAdmin // // By Johnson_boy // // ©Johnson_Boy // // DO NOT REMOVE CREDITS // //----------------------------------------------------------------------------// /* Install: 1. Compile this file using the compiler provided with the sa-mp server package. 2. Copy the .amx file to \filtersripts\ folder. 3. Add the fliterscript to server.cfg You can modify this script, to any kind of you like, but DO NOT remove credits. */ #include <a_samp> #include <dini> #include <dutils> #define FILTERSCRIPT #pragma dynamic 145000 #define blue 0x375FFFFF #define red 0xFF0000AA #define green 0x33FF33AA #define yellow 0xFFFF00AA #define grey 0xC0C0C0AA #define blue1 0x2641FEAA #define lightblue 0x33CCFFAA #define orange 0xFF9900AA #define black 0x2C2727AA #define COLOR_MESSAGE 0x00C7FFAA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOR_BLUE 0x0000BBAA #define COLOR_GREY 0xAFAFAFAA #define COLOR_GREEN 0x33AA33AA #define COLOR_RED 0xFF0000FF #define COLOR_YELLOW 0xFFFF0088 #define COLOR_ORANGE 0xFF9900AA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_LIGHTRED 0xFF6347AA #define COLOR_LIGHTBLUE 0x33CCFFAA #define COLOUR_LIGHTBLUE 0x33CCFFAA #define COLOR_LIGHTGREEN 0x9ACD32AA #define COLOR_GREEN2 0x33FF33AA #define COLOR_ERROR 0xFF0000AA #define COLOR_MSG 0x00FFFFFF #define COLOR_PINK 0xFF66FFAA #define COLOR_WHITE 0xFFFFFFAA #define COLOR_GREEN1 0x33AA33AA #define COLOR_BROWN 0xA52A2AAA #define COLOR_PURPLE 0x800080AA #define COLOR_BLACK 0x000000AA #define COLOR_GREEN1 0x33AA33AA #define REGISTER_DIALOG_INPUT 800 #define LOGIN_DIALOG_INPUT 801 #define REGISTER_DIALOG_SAFETY 802 #define REGISTER_DIALOG_SAFETY_ANSWER 803 #define LOGIN_FORGOT_INPUT 805 #define CHANGE_PASSWORD 806 //DCMD #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 //----------------------------------------------------------------------------// //ENUMS enum PlayerData { Name[MAX_PLAYER_NAME], IP[16], Registered, Password, LoggedIn, Level, Jailed, Frozen, Warnings, FailLogins, Money, Score, Spawned, SafetyQuestion[128], SafetyAnswer, Car, } new PlayerInfo[MAX_PLAYERS][PlayerData]; new Text:Textdraw0; new Text:Textdraw1; new Text:Textdraw2; new Text:Textdraw3; new Text:Textdraw7; new Text:Textdraw6; stock PlayerName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); return name; } stock UserExists(playerid) { new FilePath[128]; format(FilePath, sizeof(FilePath), "JAdminScript/Users/%s.ini", PlayerName(playerid)); if(dini_Exists(FilePath)) return 1; return 0; } public OnFilterScriptInit() { print("________________________________________________________________"); print("\n Las Venturas Party Balkan."); print(" ExtremePower"); print(" Verzija 1.0"); print(" "); print("________________________________________________________________\n"); ShowNameTags(1); ShowPlayerMarkers(1); AllowInteriorWeapons(true); SetTimer("AutoUnjail",1000,1); Textdraw0 = TextDrawCreate(151.000000, 362.000000, "Moras se ulogirati prije igranja"); TextDrawBackgroundColor(Textdraw0, 255); TextDrawFont(Textdraw0, 1); TextDrawLetterSize(Textdraw0, 0.639999, 3.199999); TextDrawColor(Textdraw0, -1); TextDrawSetOutline(Textdraw0, 0); TextDrawSetProportional(Textdraw0, 1); TextDrawSetShadow(Textdraw0, 1); Textdraw1 = TextDrawCreate(0, 0, "_"); TextDrawBackgroundColor(Textdraw1, 255); TextDrawFont(Textdraw1, 1); TextDrawLetterSize(Textdraw1, 0, 0); TextDrawColor(Textdraw1, -1); TextDrawSetOutline(Textdraw1, 0); TextDrawSetProportional(Textdraw1, 1); TextDrawSetShadow(Textdraw1, 1); TextDrawUseBox(Textdraw1, 1); TextDrawBoxColor(Textdraw1, 255); TextDrawTextSize(Textdraw1, 0,0); Textdraw2 = TextDrawCreate(0, 0, "_"); TextDrawBackgroundColor(Textdraw2, 255); TextDrawFont(Textdraw2, 0); TextDrawLetterSize(Textdraw2, 0,0); TextDrawColor(Textdraw2, -1); TextDrawSetOutline(Textdraw2, 0); TextDrawSetProportional(Textdraw2, 1); TextDrawSetShadow(Textdraw2, 1); TextDrawUseBox(Textdraw2, 1); TextDrawBoxColor(Textdraw2, 153); TextDrawTextSize(Textdraw2, 0,0); Textdraw3 = TextDrawCreate(135.000000, 360.000000, "Moras se registrirati prije igranja"); TextDrawBackgroundColor(Textdraw3, 255); TextDrawFont(Textdraw3, 1); TextDrawLetterSize(Textdraw3, 0.639998, 3.199999); TextDrawColor(Textdraw3, -1); TextDrawSetOutline(Textdraw3, 0); TextDrawSetProportional(Textdraw3, 1); TextDrawSetShadow(Textdraw3, 1); Textdraw6 = TextDrawCreate(0, 0, "4EVER"); TextDrawBackgroundColor(Textdraw6, 255); TextDrawFont(Textdraw6, 3); TextDrawLetterSize(Textdraw6,0,0); TextDrawColor(Textdraw6, -1); TextDrawSetOutline(Textdraw6, 1); TextDrawSetProportional(Textdraw6, 1); Textdraw7 = TextDrawCreate(0, 0, "Balkan"); TextDrawBackgroundColor(Textdraw7, 255); TextDrawFont(Textdraw7, 3); TextDrawLetterSize(Textdraw7, 0, 0); TextDrawColor(Textdraw7, -1); TextDrawSetOutline(Textdraw7, 1); TextDrawSetProportional(Textdraw7, 1); return 1; } //------------------------------------------------------------------------------ public OnFilterScriptExit() { TextDrawHideForAll(Textdraw0); TextDrawDestroy(Textdraw0); TextDrawHideForAll(Textdraw1); TextDrawDestroy(Textdraw1); TextDrawHideForAll(Textdraw2); TextDrawDestroy(Textdraw2); TextDrawHideForAll(Textdraw3); TextDrawDestroy(Textdraw3); TextDrawHideForAll(Textdraw6); TextDrawDestroy(Textdraw6); TextDrawHideForAll(Textdraw7); TextDrawDestroy(Textdraw7); return 1; } //------------------------------------------------------------------------------ public OnPlayerConnect(playerid) { TogglePlayerClock(playerid, 1); GameTextForPlayer(playerid,"~b~Las Venturas ~w~ Party server",10000,1); SetPlayerColor(playerid,COLOR_GREY); new file[128]; format(file, sizeof(file), "JAdminScript/Users/%s.ini", PlayerName(playerid)); PlayerInfo[playerid][IP] = 0; PlayerInfo[playerid][Registered] = 0; PlayerInfo[playerid][LoggedIn] = 0; PlayerInfo[playerid][Password] = 0; PlayerInfo[playerid][Level] = 0; PlayerInfo[playerid][Jailed] = 0; PlayerInfo[playerid][Frozen] = 0; PlayerInfo[playerid][Warnings] = 0; PlayerInfo[playerid][FailLogins] = 0; PlayerInfo[playerid][Money] = 0; PlayerInfo[playerid][Score] = 0; PlayerInfo[playerid][Spawned] = 0; PlayerInfo[playerid][Password] = dini_Int(file,"Password"); PlayerInfo[playerid][SafetyAnswer] = dini_Int(file,"SafetyAnswer"); PlayerInfo[playerid][Car] = -1; if(UserExists(playerid)) { ShowPlayerDialog(playerid, LOGIN_DIALOG_INPUT, DIALOG_STYLE_INPUT, "Logiranje", "Napisi svoju lozinku u mijesto za pisanje", "Ulogiraj se", "Odustani"); TextDrawShowForPlayer(playerid, Textdraw0); TextDrawShowForPlayer(playerid, Textdraw1); TextDrawShowForPlayer(playerid, Textdraw2); TextDrawShowForPlayer(playerid, Textdraw6); TextDrawShowForPlayer(playerid, Textdraw7); SendClientMessage(playerid, COLOR_LIGHTGREEN, " "); new WelcomeMsg[128]; format(WelcomeMsg, sizeof(WelcomeMsg), "Dobrodosao nazad %s. Tvoj nick je registriran.", PlayerName(playerid)); SendClientMessage(playerid, COLOR_LIGHTGREEN, WelcomeMsg); SendClientMessage(playerid, COLOR_WHITE, "Napisi svoju lozinku u mijesto za pisanje"); SendClientMessage(playerid, COLOR_LIGHTGREEN, " "); } else { ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Registracija ", "Upisi svoju zeljenu lozinku.","Registriraj","Odustani"); SendClientMessage(playerid, COLOR_LIGHTGREEN, " "); new Welcome[128]; format(Welcome, sizeof(Welcome), "Dobrodosao na nas server %s. Nisi jos registriran, Stoga ces se sada registrirati.", PlayerName(playerid)); SendClientMessage(playerid, COLOR_LIGHTGREEN, Welcome); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Samo prati objasnjenja."); SendClientMessage(playerid, COLOR_LIGHTGREEN, " "); SendClientMessage(playerid, COLOR_WHITE, "Registracija: Ima 3 koraka registracije: (sada si na: 1)"); SendClientMessage(playerid, COLOR_WHITE, "1. Napisi lozinku - Napisi zeljenu lozinku u polje za pisanje."); SendClientMessage(playerid, COLOR_WHITE, "2. Sigurnosno pitanje"); SendClientMessage(playerid, COLOR_WHITE, "3. Odgovor na sigurnosno pitanje"); TextDrawShowForPlayer(playerid, Textdraw1); TextDrawShowForPlayer(playerid, Textdraw2); TextDrawShowForPlayer(playerid, Textdraw3); TextDrawShowForPlayer(playerid, Textdraw6); TextDrawShowForPlayer(playerid, Textdraw7); } return 1; } //------------------------------------------------------------------------------ public OnPlayerDisconnect(playerid, reason) { //-------------------------------------------------------------------------- new file[256]; format(file,sizeof(file),"JAdminScript/Users/%s.ini", PlayerName(playerid)); PlayerInfo[playerid][Money] = GetPlayerMoney(playerid); PlayerInfo[playerid][Score] = GetPlayerScore(playerid); dini_IntSet(file,"Money",PlayerInfo[playerid][Money]); dini_IntSet(file,"Score",PlayerInfo[playerid][Score]); return 1; } forward PutInJail(); public PutInJail() { for(new i=0; i < MAX_PLAYERS; i++) { if(PlayerInfo[i][Jailed] == 1 && !IsPlayerInRangeOfPoint(i, 10, 263.4933, 77.6393, 1001.0391)) { if(PlayerInfo[i][LoggedIn] == 1 && PlayerInfo[i][Spawned] == 1) { SendClientMessage(i, COLOR_GREY, "*Ostani u zatvoru!"); SetPlayerPos(i, 263.4933, 77.6393, 1001.0391); SetPlayerInterior(i, 6); } } } } //------------------------------------------------------------------------------ public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { //REGISTER //Enter password if(dialogid == REGISTER_DIALOG_INPUT) { if(response == 1) { if(!inputtext[0]) { ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Registracija", "Upisi zeljenu lozinku u mjesto za pisanje.","Registriraj","Odustani"); return 1; } new FilePath[128]; format(FilePath, sizeof(FilePath), "JAdminScript/Users/%s.ini", PlayerName(playerid)); new strdate[20], year,month,day; getdate(year, month, day); new Ip[16]; GetPlayerIp(playerid,Ip,sizeof(Ip)); new password = num_hash(inputtext); PlayerInfo[playerid][Password] = password; PlayerInfo[playerid][Registered] = 1; PlayerInfo[playerid][LoggedIn] = 1; dini_Create(FilePath); dini_IntSet(FilePath,"Password",PlayerInfo[playerid][Password]); dini_Set(FilePath,"Ip",Ip); format(strdate, sizeof(strdate), "%d/%d/%d",day,month,year); dini_Set(FilePath,"RegisteredDate",strdate); dini_IntSet(FilePath,"Level",0); dini_IntSet(FilePath,"Jailed",0); dini_IntSet(FilePath,"Frozen",0); dini_IntSet(FilePath,"Warnings", 0); dini_IntSet(FilePath,"Money",0); dini_IntSet(FilePath,"Score",0); SendClientMessage(playerid, COLOR_GREY, " "); SendClientMessage(playerid, COLOR_GREY, "Registracija: Jedan korak je dovrsen (1/3 zavrseno)"); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Nova lozinka je uspjesno spremljena."); new string[256]; format(string, sizeof(string), "Your New Password is: \'%s\'.", inputtext); SendClientMessage(playerid, COLOR_LIGHTGREEN, string); SendClientMessage(playerid, COLOR_LIGHTGREEN, " "); SendClientMessage(playerid, COLOR_LIGHTGREEN, "2 korak, sigurnosno pitanje"); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Napisi svoje pitanje npr. moj datum rodjenja, u slucaju ako zaboravis lozinku!"); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY, DIALOG_STYLE_INPUT, "Safety question - JAdmin", "Please Enter any question as safety question \nRight answer will be asked from you.", "OK", "Cancel"); return 1; } return ShowPlayerDialog(playerid, REGISTER_DIALOG_INPUT ,DIALOG_STYLE_INPUT, "Register - JAdmin", "Please enter your new password.","Register","Cancel");} //Enter Safety Question if(dialogid == REGISTER_DIALOG_SAFETY) { if(response == 1) { new FilePath[128]; format(FilePath, sizeof(FilePath), "JAdminScript/Users/%s.ini", PlayerName(playerid)); new string[128]; format(string, sizeof(string), "%s", inputtext); SendClientMessage(playerid, COLOR_GREY, " "); SendClientMessage(playerid, COLOR_GREY, "Safety question:"); SendClientMessage(playerid, COLOR_LIGHTGREEN, string); SendClientMessage(playerid, COLOR_GREY, " "); dini_Set(FilePath,"SafetyQuestion", string); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); SendClientMessage(playerid, COLOR_GREY, "Registracija: Korak 2 Zavrsen! (2/3 zavrseno)"); SendClientMessage(playerid, COLOR_LIGHTGREEN, " "); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Korak 3 odg. na sigurnosno pitanje"); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Napisi odg. na pitanje koje si napisao prije par sekundi!"); ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY_ANSWER, DIALOG_STYLE_INPUT, "Safety Question Answer - JAdmin", "Please Enter correct answer for your question", "OK", "Cancel"); return 1; } return 1; } //Enter Answer for Safety Question if(dialogid == REGISTER_DIALOG_SAFETY_ANSWER) { if(response == 1) { new answer = num_hash(inputtext); if(!inputtext[0]) { ShowPlayerDialog(playerid, REGISTER_DIALOG_SAFETY_ANSWER, DIALOG_STYLE_INPUT, "Safety Question Answer - JAdmin", "Please Enter correct answer for your question", "OK", "Cancel"); return 1; } new FilePath[128]; format(FilePath, sizeof(FilePath), "JAdminScript/Users/%s.ini", PlayerName(playerid)); new string[128]; format(string, sizeof(string), "%s", inputtext); SendClientMessage(playerid, COLOR_GREY, " "); SendClientMessage(playerid, COLOR_GREY, "Sigurnosno pitanje odgovor:"); SendClientMessage(playerid, COLOR_LIGHTGREEN, string); SendClientMessage(playerid, COLOR_GREY, " "); PlayerInfo[playerid][SafetyAnswer] = answer; dini_IntSet(FilePath,"SafetyAnswer",PlayerInfo[playerid][SafetyAnswer]); PlayerPlaySound(playerid,1057,0.0,0.0,0.0); TextDrawHideForPlayer(playerid, Textdraw0); TextDrawHideForPlayer(playerid, Textdraw1); TextDrawHideForPlayer(playerid, Textdraw2); TextDrawHideForPlayer(playerid, Textdraw3); TextDrawHideForPlayer(playerid, Textdraw6); TextDrawHideForPlayer(playerid, Textdraw7); SendClientMessage(playerid, COLOR_GREY, "Registracija korak 3 (3/3 zavrseno)"); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Cestitamo uspijesno si kreirao svoj account/racun!"); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Sljedeci put kada dodes na server morati ces se ulogirati sa svojom lozinkom!"); SendClientMessage(playerid, COLOR_LIGHTGREEN, "Uzivaj na serveru!"); return 1; } return 1; } //-------------------------------------------------------------------------- //Login if(dialogid == LOGIN_DIALOG_INPUT) { if(response == 1) { new password = num_hash(inputtext); if(PlayerInfo[playerid][Password] == password) { new file[128]; format(file, sizeof(file), "JAdminScript/Users/%s.ini", PlayerName(playerid)); PlayerInfo[playerid][LoggedIn] = 1; PlayerInfo[playerid][Registered] = 1; PlayerInfo[playerid][Level] = dini_Int(file,"Level"); PlayerInfo[playerid][Jailed] = dini_Int(file,"Jailed"); PlayerInfo[playerid][Frozen] = dini_Int(file,"Frozen"); PlayerInfo[playerid][Warnings] = dini_Int(file,"Warnings"); PlayerInfo[playerid][Money] = dini_Int(file,"Money"); GivePlayerMoney(playerid, PlayerInfo[playerid][Money]); PlayerInfo[playerid][Score] = dini_Int(file,"Score"); SetPlayerScore(playerid, PlayerInfo[playerid][Score]); SendClientMessage(playerid, COLOR_GREY, " "); SendClientMessage(playerid, COLOR_WHITE, "Racun informacija"); SendClientMessage(playerid, COLOR_WHITE, "Uspijesno si se ulogirao.");