Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This is a comment
- // uncomment the line below if you want to write a filterscript
- //#define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #include <dini>
- #define FILE_MODS "Mods/ListaModow.ini"
- #define FILE_SETTINGS "Mods/PassMod.ini"
- new Moderator[MAX_PLAYERS];
- new ModPass[60];
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_ADMIN 0xFF0000AA
- #define COLOR_RED2 0xFF0000FF
- CMD:mhaslo(playerid,cmdtext[]){//Na Dole Mapy!
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED2,"Nie jesteś administratorem RCON!");
- new haslo[61];
- if(sscanf(cmdtext,"s[61]",haslo)){
- SendClientMessage(playerid, COLOR_WHITE,"wpisz: /Mhaslo [haslo]");
- return 1;
- }
- if(strlen(haslo) > 60) return SendClientMessage(playerid, COLOR_WHITE,"Hasło może mieć max. 60 znaków");
- format(ModPass,sizeof(ModPass),"%s",haslo);
- dini_Set(FILE_SETTINGS,"Mod_Pass",haslo);
- new tmp[80];
- format(tmp,sizeof(tmp),"Haslo Moderatora To -->> %s <<--",haslo);
- SendClientMessage(playerid,-1,tmp);
- return 1;
- }
- CMD:mlogin(playerid,cmdtext[]){//Na Dole Mapy!
- new haslo[64];
- if(sscanf(cmdtext,"s[64]",haslo)){
- SendClientMessage(playerid, COLOR_WHITE,"wpisz: /Mlogin [haslo]");
- return 1;
- }
- if(Moderator[playerid]){
- SendClientMessage(playerid,COLOR_RED2,"Jestes juz zalogowany(a) na moderatora!");
- return 1;
- }
- if(strfind(haslo,ModPass,false) == 0){
- new playername[MAX_PLAYER_NAME];
- GetPlayerName(playerid,playername,sizeof(playername));
- new tmp[256];
- tmp = dini_Get(FILE_MODS,playername);
- new CanLog = strval(tmp);
- if(CanLog < 1){
- format(tmp, sizeof(tmp), "%s zostal(a) wyrzucony(a) , Powod: Nieautoryzowane logowanie na Moderatora", playername, playerid);
- SendClientMessageToAll(COLOR_ADMIN, tmp);
- Kick(playerid);
- return 1;
- }
- Moderator[playerid] = true;
- SetPlayerColor(playerid, 0xFF0000AA);
- PlayerPlaySound(playerid, 1133, 0.0, 0.0, 10.0);
- format(tmp, sizeof(tmp), "%s (ID: %d) zalogował(a) się jako Moderator", playername, playerid);
- SendClientMessageToAll(COLOR_RED2, tmp);
- }else{
- SendClientMessage(playerid,COLOR_RED2,"Bledne Haslo !");
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment