29.01.2009, 20:10
..........still cant compile my old admin script
and my old topic got deleted, se i made a new 
here the script comes, and if u can help me, could u post the script in a code?
admin script:
and i rly need help, so plz reply thanx :P


here the script comes, and if u can help me, could u post the script in a code?
admin script:
Код:
#include <a_samp> #include <dini> #define FILTERSCRIPT #if defined FILTERSCRIPT #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1 #define COLOUR_GREEN 0x33AA33AA #define COLOUR_RED 0xAA3333AA #define COLOUR_YELLOW 0xFFFF00AA #define COLOUR_LIGHTBLUE 0x33CCFFAA #define COLOUR_ORANGE 0xFF9900AA #define PlayerFile "AdminScript/Users/%s.ini" #define SettingFile "AdminScript/Settings/MainSettings.ini" #define CommandFile "AdminScript/Settings/Commands.ini" enum PLAYER_MAIN { PLAYER_NAME[MAX_PLAYER_NAME], PLAYER_IP[16], PLAYER_REGGED, PLAYER_PASS, PLAYER_LOGGED, PLAYER_LEVEL, PLAYER_WIRED, PLAYER_JAILED } enum SETTINGS_MAIN { POCKET_MONEY, JAIL_COMMANDS, ANNOUNCE_SECONDS, PASS_MIN, PASS_MAX } enum COMMANDS_MAIN { AKILL, ANNOUNCE, ARMOURALL, BAN, CARHP, EXPLODE, FLIP, GOTO, GETHERE, GIVEARMOUR, GIVEHEALTH, GIVEWEAPON, GOD, HEALALL, IMITATE, IP, KICK, MAXAMMO, PING, SETLEVEL, SETWANTED, TBAN, TIME, WEATHER, VCLEAR, MCLEAR } new gCommands[COMMANDS_MAIN]; new gSettings[SETTINGS_MAIN]; new gPlayerInfo[PLAYER_MAIN]; public OnFilterScriptInit() { print("\n****************************************"); print("* Admin Filterscript by My_Waffles_Bitch *"); print("****************************************\n"); if(!fexist(SettingFile)) { dini_Create(SettingFile); dini_IntSet(SettingFile, "PocketMoney", 3000); dini_IntSet(SettingFile, "JailCommands", 0); dini_IntSet(SettingFile, "AnnounceSeconds", 3); dini_IntSet(SettingFile, "PassMin", 3); dini_IntSet(SettingFile, "PassMax", 15); } gSettings[POCKET_MONEY] = dini_Int(SettingFile, "PocketMoney"); gSettings[JAIL_COMMANDS] = dini_Int(SettingFile, "JailCommands"); gSettings[ANNOUNCE_SECONDS] = dini_Int(SettingFile, "AnnounceSeconds"); gSettings[PASS_MIN] = dini_Int(SettingFile, "PassMin"); gSettings[PASS_MAX] = dini_Int(SettingFile, "PassMax"); if(!fexist(CommandFile)) { dini_Create(CommandFile); dini_IntSet(CommandFile, "Akill", 5); dini_IntSet(CommandFile, "Announce", 1); dini_IntSet(CommandFile, "Armourall", 2); dini_IntSet(CommandFile, "Ban", 5); dini_IntSet(CommandFile, "Carhp", 1); dini_IntSet(CommandFile, "Explode", 2); dini_IntSet(CommandFile, "Goto", 0); dini_IntSet(CommandFile, "Gethere", 1); dini_IntSet(CommandFile, "Givearmour", 3); dini_IntSet(CommandFile, "Givehealth", 3); dini_IntSet(CommandFile, "Giveweapon", 3); dini_IntSet(CommandFile, "God", 0); dini_IntSet(CommandFile, "Healall", 3); dini_IntSet(CommandFile, "Imitate", 3); dini_IntSet(CommandFile, "Ip", 2); dini_IntSet(CommandFile, "Kick", 3); dini_IntSet(CommandFile, "Maxammo", 4); dini_IntSet(CommandFile, "Ping", 1); dini_IntSet(CommandFile, "Setlevel", 5); dini_IntSet(CommandFile, "Setwanted", 4); dini_IntSet(CommandFile, "Tban", 5); dini_IntSet(CommandFile, "Time", 1); dini_IntSet(CommandFile, "Weather", 1); dini_IntSet(CommandFile, "Vclear", 1); dini_IntSet(CommandFile, "Mclear", 1); } gCommands[AKILL] = dini_Int(CommandFile, "Akill"); gCommands[ANNOUNCE] = dini_Int(CommandFile, "Announce"); gCommands[ARMOURALL] = dini_Int(CommandFile, "Armourall"); gCommands[BAN] = dini_Int(CommandFile, "Ban"); gCommands[CARHP] = dini_Int(CommandFile, "Carhp"); gCommands[EXPLODE] = dini_Int(CommandFile, "Explode"); gCommands[GOTO] = dini_Int(CommandFile, "Goto"); gCommands[GETHERE] = dini_Int(CommandFile, "Gethere"); gCommands[GIVEARMOUR] = dini_Int(CommandFile, "Givearmour"); gCommands[GIVEHEALTH] = dini_Int(CommandFile, "Givehealth"); gCommands[GIVEWEAPON] = dini_Int(CommandFile, "Giveweapon"); gCommands[GOD] = dini_Int(CommandFile, "God"); gCommands[HEALALL] = dini_Int(CommandFile, "Healall"); gCommands[IMITATE] = dini_Int(CommandFile, "Imitate"); gCommands[IP] = dini_Int(CommandFile, "Ip"); gCommands[KICK] = dini_Int(CommandFile, "Kick"); gCommands[MAXAMMO] = dini_Int(CommandFile, "Maxammo"); gCommands[SETLEVEL] = dini_Int(CommandFile, "Setlevel"); gCommands[SETWANTED] = dini_Int(CommandFile, "Setwanted"); gCommands[TBAN] = dini_Int(CommandFile, "Tban"); gCommands[TIME] = dini_Int(CommandFile, "Time"); gCommands[WEATHER] = dini_Int(CommandFile, "Weather"); gCommands[VCLEAR] = dini_Int(CommandFile, "Vclear"); gCommands[MCLEAR] = dini_Int(CommandFile, "Mclear"); return 1; } public OnPlayerConnect(playerid) { new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name); if(!dini_Exists(file)) { dini_Create(file); dini_Set(file,"Name",Name); dini_Set(file,"Ip",Ip); dini_IntSet(file,"Registered",-1); dini_IntSet(file,"Password",0); dini_IntSet(file,"Level",0); dini_IntSet(file,"Wired",0); dini_IntSet(file,"Jailed",0); } strcat(gPlayerInfo[playerid][PLAYER_NAME], dini_Get(file,"Name")); strcat(gPlayerInfo[playerid][PLAYER_IP], dini_Get(file,"Ip")); gPlayerInfo[playerid][PLAYER_REGGED] = dini_Int(file,"Registered"); gPlayerInfo[playerid][PLAYER_PASS] = dini_Int(file,"Password"); gPlayerInfo[playerid][PLAYER_LEVEL] = dini_Int(file,"Level"); gPlayerInfo[playerid][PLAYER_WIRED] = dini_Int(file,"Wired"); gPlayerInfo[playerid][PLAYER_JAILED] = dini_Int(file,"Jailed"); else if(gPlayerInfo[playerid][PLAYER_REGGED] == 1) SendClientMessage(playerid,COLOUR_YELLOW,"You're username %s is recognised, please login, or you will be kicked.",pName); gPlayerInfo[playerid][PLAYER_REGGED] = 0; return 1; } public OnPlayerDisconnect(playerid, reason) { new file[100]; format(file,sizeof(file),PlayerFile,gPlayerInfo[playerid][PLAYER_NAME]); dini_Set(file,"Name",gPlayerInfo[playerid][PLAYER_NAME]); dini_Set(file,"Ip",gPlayerInfo[playerid][PLAYER_IP]); dini_IntSet(file,"Registered",gPlayerInfo[playerid][PLAYER_REGGED]); dini_IntSet(file,"Password",gPlayerInfo[playerid][PLAYER_PASS]); dini_IntSet(file,"Level",gPlayerInfo[playerid][PLAYER_LEVEL]); dini_IntSet(file,"Wired",gPlayerInfo[playerid][PLAYER_WIRED]); dini_IntSet(file,"Jailed",gPlayerInfo[playerid][PLAYER_JAILED]); gPlayerInfo[playerid][PLAYER_NAME] = 0; gPlayerInfo[playerid][PLAYER_IP] = 0; gPlayerInfo[playerid][PLAYER_REGGED] = 0; gPlayerInfo[playerid][PLAYER_LOGGED] = 0; gPlayerInfo[playerid][PLAYER_PASS] = 0; gPlayerInfo[playerid][PLAYER_LEVEL] = 0; gPlayerInfo[playerid][PLAYER_WIRED] = 0; gPlayerInfo[playerid][PLAYER_JAILED] = 0; return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { dcmd(register, 8, cmdtext); dcmd(login, 5, cmdtext); dcmd(logout, 6, cmdtext); dcmd(setpass, 8, cmdtext); dcmd(akill, 5, cmdtext); dcmd(announce, 8, cmdtext); dcmd(vclear, 2, cmdtext); return 0; } dcmd_register(playerid, params[]) { if(gPlayerInfo[playerid][PLAYER_REGGED] == 1) return SendClientMessage(playerid, COLOUR_RED, "ERROR: You have already registered."); else if(!params[0]) return SendClientMessage(playerid, COLOUR_YELLOW, "USAGE: /register <PASSWORD>"); else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX]) { new string[200]; format(string, sizeof(string), "ERROR: Password must be between %d and $d characters long.", gSettings[PASS_MIN], gSettings[PASS_MAX]); return SendClientMessage(playerid, COLOUR_RED, string); } else { new password = num_hash(params); gPlayerInfo[playerid][PLAYER_PASS] = password; gPlayerInfo[playerid][PLAYER_REGGED] = 1; gPlayerInfo[playerid][PLAYER_LOGGED] = 1; GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16); new string[256]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string); } } dcmd_login(playerid, params[]) { if(gPlayerInfo[playerid][PLAYER_REGGED] != 1) return SendClientMessage(playerid, COLOUR_WHITE, "SERVER: Unknown command."); else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 1) return SendClientMessage(playerid, COLOUR_RED, "ERROR: You are already logged-in."); else if(!params[0]) return SendClientMessage(playerid, COLOUR_YELLOW, "USAGE: /login <PASSWORD>"); else { new password = num_hash(params); if(gPlayerInfo[playerid][PLAYER_PASS] == password) { gPlayerInfo[playerid][PLAYER_LOGGED] = 1; GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16); new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged in as %s", pName); } else return SendClientMessage(playerid, COLOUR_RED, "ERROR: Incorrect password."); } dcmd_logout(playerid, params[]) { #pragma unused params if(gPlayerInfo[playerid][PLAYER_REGGED] != 1) return SendClientMessage(playerid, COLOUR_RED, "ERROR: You must log in first to log out! Use /login <PASSWORD> to login."); else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0) return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You are already logged out."); else { gPlayerInfo[playerid][PLAYER_LOGGED] = 0; return SendClientMessage(playerid, COLOUR_LIGHTBLUE, "You have successfully logged out of your account."); } } dcmd_setpass(playerid, params[]) { if(gPlayerInfo[playerid][PLAYER_REGGED] != 1) return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must log in first to set your password! Use /login <PASSWORD> to login."); else if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0) return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You must log in first to set your password! Use /login <PASSWORD> to login."); else { new tmp[30], tmp2[30], index; tmp = strtok(params, index); if(!strlen(tmp)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /setpass <OLD PASSEORD> <NEW PASSWORD>"); tmp2 = strtok(params, index); if(!strlen(tmp2)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /setpass <OLD PASSEORD> <NEW PASSWORD>"); new oldpassword = num_hash(tmp), newpassword = num_hash(tmp2); if(gPlayerInfo[playerid][PLAYER_PASS] == oldpassword) { if(oldpassword == newpassword) return SendClientMessage(playerid, COLOUR_RED, "ERROR: Your old password can not be the same as your new password."); else if(strlen(tmp2) < gSettings[PASS_MIN] || strlen(tmp2) > gSettings[PASS_MAX]) { new string[100]; format(string, sizeof(string), "ERROR: Your new password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]); return SendClientMessage(playerid, COLOUR_ORANGE, string); } gPlayerInfo[playerid][PLAYER_PASS] = newpassword; new string[256]; format(string, sizeof(string), "You have successfully changed your password from \'%s\' to \'%s\'.", tmp, tmp2); return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string); } else return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: Incorrect password."); } } dcmd_akill(playerid, params[]) { if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[AKILL]) { new string[100]; format(string, sizeof(string), "SERVER: Unknown command.", gCommands[AKILL]); return SendClientMessage(playerid, COLOUR_WHITE, string); } else if(!strlen(params)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /akill <PLAYER ID/NAME> { new id = (isNumeric(params)) ? strval(params) : GetPlayerId(params); if(IsPlayerConnected(id) && id != playerid) { SetPlayerHealth(id, 0.0); new string[150]; format(string, sizeof(string), "You have been killed by administrator \'%s\'.", gPlayerInfo[playerid][PLAYER_NAME]); SendClientMessage(id, COLOUR_YELLOW, string); format(string, sizeof(string), "You have killed player \'%s\'.", gPlayerInfo[id][PLAYER_NAME]); return SendClientMessage(playerid, COLOUR_YELLOW, string); } else return SendClientMessage(playerid, COLOUR_WHITE, "SERVER: Unknown command."); } } dcmd_announce(playerid, params[]) {if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[ANNOUNCE]) { new string[100]; format(string, sizeof(string), "SERVER: Unknown command.", gCommands[ANNOUNCE]); return SendClientMessage(playerid, COLOUR_WHITE, string); } else if(!strlen(params)) return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /announce <MESSAGE>"); else return GameTextForAll(params, gSettings[ANNOUNCE_SECONDS] * 1000, 3); } dcmd_vclear(playerid, params[]) {if(gPlayerInfo[playerid][PLAYER_LEVEL] < gCommands[VCLEAR]) { new idx, iString[128]; iString = strtok(params, idx); for(new v = 1; v <= MAX_VEHICLES; v++) { DestroyVehicle(v); new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid, pName, sizeof(pName)); format(iString, 128, "All vehicles cleared by %s)", pName); return SendClientMessageToAll(COLOR_GREEN, iString); }