Szerző Téma: Dadmin  (Megtekintve 687 alkalommal)

Dadmin
« Dátum: 2013. október 25. - 21:00:24 »
0 Show voters
Sziasztok!
Itt a BoOy adminrendszere!
Scriptfiles-be beirom az Adminrendszer/Játékosok
De mégse megy a regisztrácios rendszer!
 
#define FILTERSCRIPT
/*
DAdmin: Készítette: BoOy
Danger\'s FreeRoam Fun szerver használja!
RCON képességek - Az RCON Admin megtudja változtatni a szerver nevet és a map nevet.
        Letudja zárni/oldani a szervert.
Parancsok:
/report - Admin segítõ: A játékos írhat problémákat az adminoknak. Az adminok segítenek.
/admins - Online Adminok.
Admin szintek és parancsok:
Level 1: /clearchat | /announce | /goto | /get | /[un]mute | /getip | /slap | /apm | /achat
Level 2: /healall | /[un]freeze | /setskin | /jetpack | /akill | /warn
Level 3: /kick | /slap | /givemoney | /setweapon | /setweather | /setscore
Level 4: /[un]ban | /killall | /explode | /armourall | /disarm | /rescar
Level 5: /setlevel | /allips | /kickall | /gmx | /muteall| /freezeall /god
------------------------------------------------------------------
*/
#include
#define USE_PLUGIN_FUNCTIONS
#include
#include
#include
#include
#include
#define COLOR_RED 0xFF0606FF
#define DIALOG_REGISTER       200
#define DIALOG_LOGIN        201
#define DIALOG_REGCOMPLETED 202
#define DIALOG_CLICK       203
#define DIALOG_ADMIN         204
#define RCON_DIALOG         205
#define DIALOG_ACMDS       206
#define SKIN_ID 150
#define START_MONEY 1000
#define MAX_CARS  1000
#define MAX_WARNINGS 3
#define TOTAL_ITEMS         300
#define SELECTION_ITEMS    21
#define ITEMS_PER_LINE     7
#define HEADER_TEXT \"Skinek!\"
#define NEXT_TEXT   \"Tovabb\"
#define PREV_TEXT   \"Vissza\"
#define DIALOG_BASE_X      75.0
#define DIALOG_BASE_Y      130.0
#define DIALOG_WIDTH       550.0
#define DIALOG_HEIGHT      180.0
#define SPRITE_DIM_X       60.0
#define SPRITE_DIM_Y       70.0
new timeupdatetimer;
forward LoadPlayerData(playerid);
forward TimeUpdate(playerid);
enum pData {
   pPassword[64],
   pAdmin,
pTime,
   pMoney,
   pScore,
   pMute,
   pFrozen,
   pSpecating,
   pSkin,
   pWarn,
   pSpam,
   bool:LoggedIn
}
new P_Data[MAX_PLAYERS][pData];
new regstring[512];
new loginstring[512];
new registered;
new SkinChange[MAX_PLAYERS];
new SkinChange1[MAX_PLAYERS];
new KilepesMent[MAX_PLAYERS];
new Text:AdatokTextdraw;
new Text:FelhasznTextdraw;
new gTotalItems = TOTAL_ITEMS;
new PlayerText:gCurrentPageTextDrawId[MAX_PLAYERS];
new PlayerText:gHeaderTextDrawId[MAX_PLAYERS];
new PlayerText:gBackgroundTextDrawId[MAX_PLAYERS];
new PlayerText:gNextButtonTextDrawId[MAX_PLAYERS];
new PlayerText:gPrevButtonTextDrawId[MAX_PLAYERS];
new PlayerText:gSelectionItems[MAX_PLAYERS][sELECTION_ITEMS];
new gSelectionItemsTag[MAX_PLAYERS][sELECTION_ITEMS];
new gItemAt[MAX_PLAYERS];
new gItemList[TOTAL_ITEMS] = {
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,
50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,
97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,
132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,
167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,
202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,
237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,
272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299
};
public OnFilterScriptInit()
{
new year,month,day;   getdate(year, month, day);
new hour,minute,second; gettime(hour,minute,second);
print(\" \");
print(\" \");
print(\"---------------------------------\");
print(\"     Adminrendszer betöltése..   \");
print(\"---------------------------------\");
printf(\"Dátum: %02i/%02i/%02i    Idõ: %02i:%02i :%02i\",year, month, day, hour, minute, second);
printf(\"Eddig összesen: %d Játékos regisztrált a szerverre!\",registered);
print(\"---------------------------------\");
print(\" \");
print(\" \");
timeupdatetimer = SetTimer(\"TimeUpdater\", 1000, true);
if(!dfile_DirectoryExists(\"Scriptfiles/Adminrendszer\")) {
    dfile_CreateDirectory(\"Adminrendszer\");
    print(\"Az Adminrendszer mappa létrehozása a Scriptfiles mappába..\");
}
if(!dfile_DirectoryExists(\"Scriptfiles/Adminrendszer/Játékosok\")) {
    dfile_CreateDirectory(\"Adminrendszer/Játékosok\");
    print(\"A Adminrendszer/Játékosok mappa létrehozása a Scriptfiles mappába..\");
}
   for(new i; i < MAX_PLAYERS; i++) SetTimerEx(\"TimeUpdate\", 1000, true, \"i\", i);
   format(loginstring, 512, \"{FFFFFF}Üdvözöllek újra a {FF9900}Danger\'s FreeRoam Fun™ Szerveren{FFFFFF}! \\n Kérlek {33FF00}jelentkezz be{FFFFFF}, hogy adataidat betölthessük!\");
format(regstring, 512, \"{FFFFFF}Üdvözöllek a {FF9900}Danger\'s FreeRoam Fun™ Szerveren{FFFFFF}! \\n Kérlek {33FF00}Regisztrálj{FFFFFF}, hogy adataidat sikeresen elmentsük!\");
AdatokTextdraw = TextDrawCreate(43.125, 217.583, \"Adataid Betöltése...\");
TextDrawLetterSize(AdatokTextdraw, 0.660, 3.110);
TextDrawAlignment(AdatokTextdraw, 1);
TextDrawColor(AdatokTextdraw, -1);
TextDrawSetOutline(AdatokTextdraw, 1);
TextDrawBackgroundColor(AdatokTextdraw, 51);
TextDrawFont(AdatokTextdraw, 1);
TextDrawSetProportional(AdatokTextdraw, 1);
FelhasznTextdraw = TextDrawCreate(43.125, 217.583, \"Felhasználód Készítése...\");
TextDrawLetterSize(FelhasznTextdraw, 0.660, 3.110);
TextDrawAlignment(FelhasznTextdraw, 1);
TextDrawColor(FelhasznTextdraw, -1);
TextDrawSetOutline(FelhasznTextdraw, 1);
TextDrawBackgroundColor(FelhasznTextdraw, 51);
TextDrawFont(FelhasznTextdraw, 1);
TextDrawSetProportional(FelhasznTextdraw, 1);
 
new varo = CreateObject(19353, 518.9199, -3681.6926, 3.8118, 0.0000, 0.0000, -94.4026);
SetObjectMaterialText(varo, \"Kérlek várj..\", 0, 140, \"Arial\", 100, 0, -16468988, 0, 1);
new udv = CreateObject(19353, 512.4999, -3755.7707, 2.8493, 0.0000, 0.0000, -80.0663);
SetObjectMaterialText(udv, \"Üdv a szerveren!\", 0, 140, \"Arial\", 70, 1, -65536, 0, 1);
new parancs = CreateObject(19353, -339.2107, 1544.3071, 76.0625, 0.0000, 0.0000, 179.9443);
SetObjectMaterialText(parancs, \"Parancsokért: /cmds\", 0, 140, \"Arial\", 60, 0, -1, 0, 1);
new telesek = CreateObject(19353, -347.0748, 1543.1376, 76.0625, 0.0000, 0.0000, 0.0961);
SetObjectMaterialText(telesek, \"Teleportok: /teles\", 0, 140, \"Arial\", 70, 0, -1, 0, 1);
print(\" \");
print(\"---------------------------------\");
print(\"     Adminrendszer betöltve...   \");
print(\"---------------------------------\");
print(\" \");
return 1;
}
public OnFilterScriptExit()
{
KillTimer(timeupdatetimer);
TextDrawHideForAll(FelhasznTextdraw);
TextDrawDestroy(FelhasznTextdraw);
TextDrawHideForAll(AdatokTextdraw);
TextDrawDestroy(AdatokTextdraw);
return 1;
}
public OnPlayerConnect(playerid)
{
TogglePlayerSpectating(playerid,1);
SetTimerEx(\"Skin\", 1000, false, \"i\", playerid);
new year,month,day;   getdate(year, month, day);
new hour,minute,second; gettime(hour,minute,second);
new dName[MAX_PLAYER_NAME];
   new string[512];
if(IsRegistered(pName(playerid)))
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Bejelentkezés\", loginstring, \"Bejelentkez\", \"Kick\");
SkinChange[playerid] = 0;
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, \"Regisztráció\", regstring, \"Regisztrál\", \"Kick\");
SkinChange[playerid] = 1;
}
KilepesMent[playerid] = 0;
PlayerPlaySound(playerid,1097,0.0,0.0,0.0);
P_Data[playerid][pWarn] = 0;
   GetPlayerName(playerid, dName, sizeof(dName));
   format(string, sizeof(string), \"{DAEB26}%s {19E620}Csatlakozott a Danger\'s FreeRoam Fun™ szerverhez! {E31010}[idõ: %d/%d/%d %d:%d:%d]\", dName, year, month, day, hour, minute, second);
   SendClientMessageToAll(-1, string);
gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   for(new x=0; x < SELECTION_ITEMS; x++) {
       gSelectionItems[playerid]
  • = PlayerText:INVALID_TEXT_DRAW;

}
gItemAt[playerid] = 0;
SkinChange1[playerid] = 0;
return 1;
}
forward Skin(playerid);
public Skin(playerid)
{
SetPlayerCameraPos(playerid, 513.362792, -3760.221679, 3.622610);
   SetPlayerCameraLookAt(playerid,513.760009, -3755.255126, 3.202853);
}
forward Adatok(playerid);
public Adatok(playerid)
{
TextDrawHideForPlayer(playerid,FelhasznTextdraw);
TextDrawHideForPlayer(playerid,AdatokTextdraw);
    GivePlayerMoney(playerid,P_Data[playerid][pMoney]);
    SetPlayerScore(playerid,P_Data[playerid][pScore]);
}
forward Spawn(playerid);
public Spawn(playerid)
{
TogglePlayerSpectating(playerid, 0);
}
public OnPlayerDisconnect(playerid, reason)
{
new string[512];
   if(KilepesMent[playerid] == 1)
   {
format(string, sizeof(string), \"Adminrendszer/Játékosok/%s.ini\", GetName(playerid));
dfile_Open(string);
dfile_MultiSet(\"iiiiii\",
   \"Admin\",      P_Data[playerid][pAdmin],
   \"Time\",      P_Data[playerid][pTime],
   \"Money\",    GetPlayerMoney(playerid),
   \"Score\",    GetPlayerScore(playerid),
   \"Skin\",     GetPlayerSkin(playerid),
   \"Warn\",     P_Data[playerid][pWarn]
);
dfile_SaveFile();
}
   new dName[MAX_PLAYER_NAME];
   GetPlayerName(playerid, dName, sizeof(dName));
new year,month,day;   getdate(year, month, day);
new hour,minute,second; gettime(hour,minute,second);
switch(reason)
{
case 0:
{
GetPlayerName(playerid, dName, sizeof(dName));
format(string,sizeof(string),\"{DAEB26}%s {19E620}Elhagyta a szervert!(Idõtúllépés) {E31010}[idõ: %d/%d/%d %d:%d:%d]\", dName, year, month, day, hour, minute, second);
}
case 1:
{
GetPlayerName(playerid, dName, sizeof(dName));
format(string,sizeof(string),\"{DAEB26}%s {19E620}Elhagyta a szervert!(Kilépés) {E31010}[idõ: %d/%d/%d %d:%d:%d]\", dName, year, month, day, hour, minute, second);
}
case 2:
{
GetPlayerName(playerid, dName, sizeof(dName));
format(string,sizeof(string),\"{DAEB26}%s {19E620}Elhagyta a szervert!(Kick/Ban) {E31010}[idõ: %d/%d/%d %d:%d:%d]\", dName, year, month, day, hour, minute, second);
}
}
SendClientMessageToAll(-1,string);
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerPos(playerid,-343.9589,1544.7606,75.5625);
   SetPlayerFacingAngle(playerid,185.5671);
   SetCameraBehindPlayer(playerid);
   PlayerPlaySound(playerid,1098,0.0,0.0,0.0);
     GivePlayerWeapon(playerid, 28, 9999999);
GivePlayerWeapon(playerid, 43, 9999999);
   if(SkinChange[playerid] == 1)
   {
DestroySelectionMenu(playerid);
SetPVarInt(playerid, \"skinc_active\", 1);
CreateSelectionMenu(playerid);
SelectTextDraw(playerid, 0xACCBF1FF);
SendClientMessage(playerid,0x10F441AA, \"Elsõ lépésként válassz egy skint!\");
   }
   else
   {
   SetPlayerSkin(playerid,P_Data[playerid][pSkin]);
   }
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
if(P_Data[playerid][pMute] == 1)
{
SendClientMessage(playerid, COLOR_RED, \"Le vagy némítva ezért nem tudsz írni a chat-be!\");
return 0;
}
P_Data[playerid][pSpam] += 1;
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
     if(GetPVarInt(playerid, \"skinc_active\") == 0) return 0;
// Handle: They cancelled (with ESC)
if(clickedid == Text:INVALID_TEXT_DRAW) {
       DestroySelectionMenu(playerid);
       SetPVarInt(playerid, \"skinc_active\", 0);
       PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
       return 1;
}
return 0;
}
//------------------------------------------------
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(GetPVarInt(playerid, \"skinc_active\") == 0) return 0;
new curpage = GetPVarInt(playerid, \"skinc_page\");
// Handle: next button
if(playertextid == gNextButtonTextDrawId[playerid]) {
    if(curpage < (GetNumberOfPages() - 1)) {
        SetPVarInt(playerid, \"skinc_page\", curpage + 1);
        ShowPlayerModelPreviews(playerid);
           UpdatePageTextDraw(playerid);
           PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
} else {
    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
return 1;
}
// Handle: previous button
if(playertextid == gPrevButtonTextDrawId[playerid]) {
    if(curpage > 0) {
       SetPVarInt(playerid, \"skinc_page\", curpage - 1);
       ShowPlayerModelPreviews(playerid);
       UpdatePageTextDraw(playerid);
       PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
} else {
    PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
}
return 1;
}
// Search in the array of textdraws used for the items
new x=0;
while(x != SELECTION_ITEMS) {
    if(playertextid == gSelectionItems[playerid]
  • ) {

        HandlePlayerItemSelection(playerid, x);
        PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
        DestroySelectionMenu(playerid);
        CancelSelectTextDraw(playerid);
          SetPVarInt(playerid, \"skinc_active\", 0);
          return 1;
}
x++;
}
return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
       case DIALOG_REGISTER:
       {
   if(!response)
   {
   SendClientMessage(playerid,0xFF0606FF, \"Sajnálom, de kötelezõ a regisztráció!\");
   return Kick(playerid);
   }
           if(response)
   {
      if(!(3 < strlen(inputtext) < 19))
      {
         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, \"Regisztráció\", \"{FF0000}A jelszónak 3-nál nagyobb és 19-nél\\nkissebb karakterbõl kell állnia!\", \"Regisztrál\", \"Kick\");
         return 1;
      }
      new string[128];
      format(string, sizeof(string), \"Adminrendszer/Játékosok/%s.ini\", pName(playerid));
      dfile_Create(string);
      dfile_Open(string);
      dfile_WriteString(\"Password\", inputtext);
      dfile_MultiSet(\"iiiiii\",
         \"Admin\",      0,
         \"Time\",    0,
         \"Money\",    START_MONEY,
         \"Score\",    10,
         \"Skin\",      SKIN_ID,
         \"Warn\",      0
      );
      dfile_SaveFile();
      KilepesMent[playerid] = 1;
      SetPVarInt(playerid, \"Registered\", 1);
      SetPVarInt(playerid, \"Logged\", 1);
      SpawnPlayer(playerid);
      ShowPlayerDialog(playerid, DIALOG_REGCOMPLETED, DIALOG_STYLE_MSGBOX, \"{FFFFFF}Sikeresen regisztráltál\", \"{FFFFFF}Mostmár minden adatot:{33FF00} Pénzt, Pontot, Szerveren eltöltött idõt Elmentünk! \\n {FFFFFF} További jó játékot kívánunk!\", \"Tovább\", \"\");
      SendClientMessage(playerid,0x10F441AA, \"Automatikusan bejelentkeztél..\");
      registered++;
           }
       }
       case DIALOG_LOGIN: {
          if(!response) {
            SendClientMessage(playerid,0xFF0606FF, \"Sajnálom, de kötelezõ a bejelentkezés!\");
            return Kick(playerid);
        }
   LoadPlayerData(playerid);
           if(response)
   {
      if(!(3 < strlen(inputtext) < 19))
      {
         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Bejelentkezés\", \"{FF0000}Sikertelen bejelentkezés. Kérlek próbáld újra! \\n Tipp: Figyelj arra hogy nincs-e bekapcsolva a Caps-Lock!\", \"Bejelentkez\", \"Kick\");
         return 1;
      }
      if(!strcmp(inputtext, P_Data[playerid][pPassword])) {
         SetPVarInt(playerid, \"Logged\", 1);
         KilepesMent[playerid] = 1;
         SendClientMessage(playerid,0x10F441AA, \"Jelszó elfogadva! Sikeres Bejelentkezés..\");
         TextDrawShowForPlayer(playerid,AdatokTextdraw);
         InterpolateCameraPos(playerid, 513.362792, -3760.221679, 3.622610, 518.286621, -3686.658203, 4.141963, 10000);
         InterpolateCameraLookAt(playerid, 513.760009, -3755.255126, 3.202853, 518.598937, -3681.671142, 3.963344, 10000);
         SetTimerEx(\"Adatok\", 8000, false, \"i\", playerid);
         SetTimerEx(\"Spawn\", 10000, false, \"i\", playerid);
      }else{
         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, \"Bejelentkezés\", \"{FF0000}Sikertelen bejelentkezés. Kérlek próbáld újra! \\n Tipp: Figyelj arra hogy nincs-e bekapcsolva a Caps-Lock!\", \"Bejelentkez\", \"Kick\");
      }
          }
       }
       case DIALOG_REGCOMPLETED:
{
   if(response)
   {
   KilepesMent[playerid] = 1;
   TextDrawShowForPlayer(playerid,FelhasznTextdraw);
   InterpolateCameraPos(playerid, 513.362792, -3760.221679, 3.622610, 518.286621, -3686.658203, 4.141963, 10000);
   InterpolateCameraLookAt(playerid, 513.760009, -3755.255126, 3.202853, 518.598937, -3681.671142, 3.963344, 10000);
           SetTimerEx(\"Adatok\", 8000, false, \"i\", playerid);
           SetTimerEx(\"Spawn\", 10000, false, \"i\", playerid);
           return 1;
   }
}
       case DIALOG_CLICK:
       {
              if(!response) return SendClientMessage(playerid,-1,\"Admin Control Panel bezárva!\");
              new text[128];
              switch(listitem)
              {
      case 0:
      {
      Kick(GetPVarInt(playerid,\"pplayerid\"));
      SetPVarInt(playerid,\"pplayerid\",999);
      format(text,sizeof(text),\"%s Kickelt a szerverrõl!\",GetName(playerid));
      SendClientMessage(GetPVarInt(playerid,\"pplayerid\"),-1,text);}
      case 1:
      {
      Ban(GetPVarInt(playerid,\"pplayerid\"));
      SetPVarInt(playerid,\"pplayerid\",999);
      format(text,sizeof(text),\"%s Bannolt a szerverrõl!\",GetName(playerid));
      SendClientMessage(GetPVarInt(playerid,\"pplayerid\"),-1,text);            }
      case 2:
      {
      ShowPlayerDialog(playerid,DIALOG_ADMIN,DIALOG_STYLE_INPUT,\"Admin Control Panel\",\"Válassz admin szintet [1-5]\",\"Választ\",\"Mégse\");
      }
   }
     }
case DIALOG_ADMIN:
      {
       if(!response) return SendClientMessage(playerid,-1,\"Admin Control Panel bezárva!\");
new string[128];
       P_Data[GetPVarInt(playerid,\"pplayerid\")][pAdmin] = strval(inputtext);
format(string,sizeof(string),\"Mostmár az admin szinted: %d\",strval(inputtext));
SendClientMessage(GetPVarInt(playerid,\"pplayerid\"),-1,string);
format(string,sizeof(string),\"%s új admin szintje: %d\",GetName(GetPVarInt(playerid,\"pplayerid\")),strval(inputtext));
SendClientMessage(playerid,-1,string);
SetPVarInt(playerid,\"pplayerid\",999);
}
case RCON_DIALOG:
{
    if(!response) return SendClientMessage(playerid,-1,\"Admin Control Panel bezárva!\");
new string[128];
switch(listitem)
{
case 0: {//Server name
    ShowPlayerDialog(playerid,RCON_DIALOG+1,DIALOG_STYLE_INPUT,\"Szerver Név\",\"Írd be az új szerver nevet!\",\"Választ\",\"Exit\");
}
case 1: {//Map name
    ShowPlayerDialog(playerid,RCON_DIALOG+2,DIALOG_STYLE_INPUT,\"Map Név\",\"Írd be az új map nevet!\",\"Választ\",\"Exit\");
}
case 2: {//Unlock
SendRconCommand(\"password 0\");
}
case 3: {//lock
ShowPlayerDialog(playerid,RCON_DIALOG+3,DIALOG_STYLE_INPUT,\"Szerver Lezárás\",\"Írd be a jelszót!\",\"Választ\",\"Exit\");
}
case 4: {//GMX
format(string,sizeof(string),\"%s Újraindítja a szervert!\",GetName(playerid));
SendClientMessageToAll(-1,string);
SendRconCommand(\"gmx\");
SendRconCommand(\"reloadfs Badmin\");
}
case 5: {//Password
ShowPlayerDialog(playerid,RCON_DIALOG+4,DIALOG_STYLE_INPUT,\"Jelszó változtatás\",\"Írd be az új RCON jelszót!\",\"Választ\",\"Exit\");
}
case 6: {//Turn Off
format(string,sizeof(string),\"%s Leállította a szervert!\",GetName(playerid));
SendClientMessageToAll(-1,string);
SendRconCommand(\"exit\");
}
}
}
case RCON_DIALOG+1:
{
   new string[32];
   format(string, 16, \"hostname %s\",inputtext);
   SendRconCommand(string);
}
case RCON_DIALOG+2:
{
   new string[32];
   format(string, 16, \"mapname %s\",inputtext);
   SendRconCommand(string);
}
case RCON_DIALOG+3:
{
           new string[32];
   format(string, 16, \"password %s\",inputtext);
   SendRconCommand(string);
}
case RCON_DIALOG+4:
{
           new string[32];
   format(string, 16, \"rcon_password %s\",inputtext);
   SendRconCommand(string);
}
}
return 1;
}
public TimeUpdate(playerid)
{
if(!IsPlayerConnected(playerid) || !GetPVarInt(playerid, \"Logged\")) return 1;
   P_Data[playerid][pTime]++;
SetPVarInt(playerid, \"Time\", GetPVarInt(playerid, \"Time\")+1);
if(random(512) == 4) {
    new o, h, m, s, string[256];
    o = GetPVarInt(playerid, \"Time\");
    h = o / 3600;
    o = o - (h * 3600);
    m = o / 60;
    o = o - (m * 60);
    s = o;
    o = o - (s);
    if(o) return print(\"WARNING!!!!!!! TimeUpdate!!!!\");
    format(string, sizeof(string), \"Szerveren eltöltött idõd: %d óra, %d perc, %d másodperc!\", h, m, s);
    SendClientMessage(playerid, 0xffbb00aa, string);
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(P_Data[playerid][pAdmin] > 0 && P_Data[playerid][pAdmin] < 5)
{
ShowPlayerDialog(playerid,DIALOG_CLICK,DIALOG_STYLE_LIST,\"Admin Control Panel\",\"Kick\\nBan\",\"Választ\",\"Bezár\");
SetPVarInt(playerid,\"pplayerid\",clickedplayerid);
}
else if(P_Data[playerid][pAdmin] == 5)
{
ShowPlayerDialog(playerid,DIALOG_CLICK,DIALOG_STYLE_LIST,\"Admin Control Panel\",\"Kick\\nBan\\nAdminjog adás\",\"Választ\",\"Választ\");
SetPVarInt(playerid,\"pplayerid\",clickedplayerid);
}
return 1;
}
public LoadPlayerData(playerid)
{
new string[128];
format(string, sizeof(string), \"Adminrendszer/Játékosok/%s.ini\", pName(playerid));
dfile_Open(string);
dfile_MultiGet(\"siiiiii\",
    \"Password\", P_Data[playerid][pPassword],
    \"Admin\",    P_Data[playerid][pAdmin],
    \"Time\",      P_Data[playerid][pTime],
    \"Money\",    P_Data[playerid][pMoney],
    \"Score\",    P_Data[playerid][pScore],
    \"Skin\",    P_Data[playerid][pSkin],
    \"Warn\",    P_Data[playerid][pWarn]
);
   dfile_SaveFile();
     SetPVarInt(playerid, \"Time\", P_Data[playerid][pTime]);
   return 1;
}
stock GetName(playerid)
{
   new Pname[MAX_PLAYER_NAME];
   GetPlayerName(playerid, Pname, sizeof(Pname));
   return Pname;
}
 
CMD:admins(playerid)
{
   new string[512], c;
   SendClientMessage(playerid,-1,\"{19E620}|===========================================|\");
   for(new i; i < MAX_PLAYERS; i++)
{
    if(!IsPlayerConnected(i)) continue;
    if(P_Data[pAdmin] > 0 || IsPlayerAdmin(i))
       {
        if(P_Data[pAdmin] == 1) { format(string,sizeof(string),\"{19E620}[Level 1] %s - Segítõkész\",GetName(i)); }
        else if(P_Data[pAdmin] == 2) { format(string,sizeof(string),\"{F0B630}[Level 2] %s - Segítõkész\",GetName(i)); }
        else if(P_Data[pAdmin] == 3) { format(string,sizeof(string),\"{197FE6}[Level 3] %s - Moderátor\",GetName(i)); }
        else if(P_Data[pAdmin] == 4) { format(string,sizeof(string),\"{113ABF}[Level 4] %s - Globális Moderátor\",GetName(i)); }
        else if(P_Data[pAdmin] == 5) { format(string,sizeof(string),\"{E31010}[Level 5] %s - Fõ Adminisztrátor\",GetName(i)); }
        if(IsPlayerAdmin(i)) { format(string,sizeof(string),\"{E31010}[RCON] %s - RCON Adminisztátor\",GetName(i)); }
        SendClientMessage(playerid,-1,string);
   c ++;
}
}
if(!c)
{
SendClientMessage(playerid,-1,\"{E31010}      Nincs online Admin a szerveren!        \");
SendClientMessage(playerid,-1,\"{19E620}|===========================================|\");
return 1;
}
SendClientMessage(playerid,-1,\"{19E620}|===========================================|\");
   return 1;
}
CMD:report(playerid, params[])
{
   new string[128], text[48];
   if(sscanf(params, \"s[48]\", text)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /report [kérdés]\");
   foreach(Player, i) {
   if(P_Data[pAdmin] > 0) {
   format(string,sizeof(string),\"{197FE6}%s Feltett egy kérdést: %s \",GetName(playerid),text);
   SendClientMessage(i,-1,string);
AskLog(playerid,text);} }
   return 1;
}
CMD:skin(playerid, params[])
{
   SkinChange1[playerid] = 1;
DestroySelectionMenu(playerid);
SetPVarInt(playerid, \"skinc_active\", 1);
CreateSelectionMenu(playerid);
SelectTextDraw(playerid, 0xACCBF1FF);
SendClientMessage(playerid,0x10F441AA, \"Válassz egy megtetszõ skint!\");
return 1;
}
//==================================================== Level 1 =============================================
CMD:clearchat(playerid)
{
       if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy Admin!\");
for(new chat = 0; chat <= 25; chat++)
SendClientMessageToAll(-1, \" \");
new string[128];
   format(string,sizeof(string),\"{197FE6}Adminisztrátor %s megtisztította a Chat-et.\",GetName(playerid));
SendClientMessageToAll(-1,string);
       return 1;
}
CMD:announce(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy Admin!\");
   new string[128],style,time;
   if(sscanf(params, \"s[128]ii\",string,time,style)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /announce [Üzenet] [idõ] [Üzenet Stílus 0-6]\");
   GameTextForAll(string,time,style);
   return 1;
}
CMD:goto(playerid, params[])
{
   new string[128];
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
   new pplayerid,Float:Pos[3];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /goto [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
     format(string,sizeof(string),\"{197FE6}Adminisztrátor %s elteleportált %s -hoz/hez.\",GetName(playerid),GetName(pplayerid));
SendClientMessageToAll(-1,string);
GetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
if(IsPlayerInAnyVehicle(playerid))
   {
   new tmpcar = GetPlayerVehicleID(playerid);
   SetVehiclePos(tmpcar,Pos[0],Pos[1],Pos[2]);
   LinkVehicleToInterior(tmpcar, 0);
   SetPlayerVirtualWorld(playerid, 0);
   }
   else
   {
     SetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
SetPlayerInterior(playerid,GetPlayerInterior(pplayerid));
   }
return 1;
}
CMD:get(playerid, params[])
{
   new string[128];
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
   new pplayerid,Float:Pos[3];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /get [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
     format(string,sizeof(string),\"{197FE6}Adminisztrátor %s magáhozteleportálta %s -t.\",GetName(playerid),GetName(pplayerid));
   SendClientMessageToAll(-1,string);
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
if(IsPlayerInAnyVehicle(pplayerid))
   {
   new tmpcar = GetPlayerVehicleID(pplayerid);
   SetVehiclePos(tmpcar,Pos[0],Pos[1],Pos[2]);
   LinkVehicleToInterior(tmpcar, 0);
   SetPlayerVirtualWorld(pplayerid, 0);
   }
   else
   {
     SetPlayerPos(pplayerid,Pos[0],Pos[1],Pos[2]);
SetPlayerInterior(pplayerid,GetPlayerInterior(pplayerid));
   }
return 1;
}
CMD:mute(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
   new pplayerid,reason[48],string[128];
   if(sscanf(params, \"us[48]\", pplayerid,reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /mute [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
   format(string,sizeof(string),\"{17E310}Adminisztrátor %s lenémította %s -t! Indok: %s\",GetName(playerid),GetName(pplayerid),reason);
   SendClientMessageToAll(COLOR_RED,string);
   P_Data[pplayerid][pMute] = 1;
   return 1;
}
CMD:unmute(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
   new   pplayerid,string[128];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /unmute [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz játékos ID!\");
   format(string,sizeof(string),\"{E31010}Adminisztrátor %s feloldotta %s -t!\",GetName(playerid),GetName(pplayerid));
   SendClientMessageToAll(COLOR_RED,string);
   P_Data[pplayerid][pMute] = 0;
   return 1;
}
CMD:getip(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
   new   pplayerid,ip[64],string[128];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /getip [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz játékos ID!\");
   GetPlayerIp(pplayerid,ip,50);
   format(string,sizeof(string),\"{19E620}%s Ip-je: %s\",GetName(playerid),ip);
   SendClientMessage(playerid,COLOR_RED,string);
   return 1;
}
CMD:slap(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy Admin!\");
   new pplayerid,Float:x,Float:y,Float:z,string[128],reason[48];
   if(sscanf(params, \"us[48]\", pplayerid,reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /slap [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
SetPlayerPos(pplayerid,x,y,z+20);
   format(string,sizeof(string),\"{197FE6}Adminisztrátor %s Feldobta %s -t. Indok: %s\",GetName(playerid),GetName(pplayerid),reason);
   SendClientMessageToAll(COLOR_RED,string);
   return 1;
}
CMD:apm(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
   new pplayerid,string[128],message[48];
   if(sscanf(params, \"us[48]\", pplayerid,message)) return SendClientMessage(playerid, COLOR_RED, \": /apm [Játékos ID/Játékos Név] [Üzenet]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
   format(string,sizeof(string),\"{CFE82A}Admin Privát Üzenet: %s üzenete: %s\",GetName(playerid),message);
   SendClientMessage(pplayerid,COLOR_RED,string);
   GameTextForPlayer(playerid,\"Admin üzenet elküldve!\",3000,3);
   return 1;
}
CMD:achat(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem Vagy Admin!\");
   new text[128];
   if(sscanf(params, \"s[128]\",text)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /achat [Üzenet]\");
   format(text,sizeof(text),\"{CFE82A}Admin Chat: %s üzenete: %s\",GetName(playerid),params[0]);
   foreach(Player, i) {
   if(P_Data[pAdmin] > 0){
SendClientMessage(i,COLOR_RED,text);}}
   return 1;
}
 
//==================================================== Level 2 =============================================
CMD:warn(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new   pplayerid,string[128],reason[48];
   if(sscanf(params, \"us[48]\", pplayerid,reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /warn [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
P_Data[playerid][pWarn]++;
if(P_Data[playerid][pWarn] == MAX_WARNINGS)
{
format(string, sizeof(string), \"{DAEB26}Adminisztrátor %s kirúgta %s -t. (Indok: %s) (Figyelmeztetések: %d/%d)\", GetName(playerid), GetName(pplayerid), reason, P_Data[playerid][pWarn], MAX_WARNINGS);
SendClientMessageToAll(-1, string);
P_Data[playerid][pWarn] = 0;
Kick(playerid);
return 1;
}
else
{
format(string,sizeof(string),\"{DAEB26}Adminisztrátor %s figyelmeztette %s -t. (Indok: %s) (Figyelmeztetések: %d/%d)\",GetName(playerid),GetName(pplayerid), reason, P_Data[playerid][pWarn], MAX_WARNINGS );
SendClientMessageToAll(-1,string);
}
return 1;
}
CMD:jail(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new   pplayerid,string[128],reason[48];
   if(sscanf(params, \"us[48]\", pplayerid,reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /jail [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
format(string, sizeof(string), \"{DAEB26}Adminisztrátor %s Börtönbe zárta %s -t. (Indok: %s)\", GetName(playerid), GetName(pplayerid), reason);
SendClientMessageToAll(-1, string);
SetPlayerPos(playerid,-9.9, 2336.8999, 24.3);
return 1;
}
CMD:freeze(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new pplayerid,string[128],reason[48];
   if(sscanf(params, \"us[48]\", pplayerid,reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /freeze [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
if(P_Data[pplayerid][pFrozen] == 1)  return SendClientMessage(playerid, COLOR_RED, \"A játékos lefagyasztva!\");
TogglePlayerControllable(pplayerid, false);
   P_Data[pplayerid][pFrozen] = 1;
   format(string,sizeof(string),\"{197FE6}Adminisztrátor %s lefagyasztotta %s. Indok: %s\",GetName(playerid),GetName(pplayerid),reason);
   SendClientMessageToAll(COLOR_RED,string);
   return 1;
}
CMD:unfreeze(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new pplayerid,string[128];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /unfreeze [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
if(P_Data[pplayerid][pFrozen] == 0)  return SendClientMessage(playerid, COLOR_RED, \"A játékos nincs lefagyasztva!\");
TogglePlayerControllable(pplayerid, true);
   P_Data[pplayerid][pFrozen] = 0;
   format(string,sizeof(string),\"{197FE6}Adminisztrátor %s feloldotta a lefagyasztásból %s -t.\",GetName(playerid),GetName(pplayerid));
   SendClientMessageToAll(COLOR_RED,string);
   return 1;
}
CMD:heal(playerid)
{
   GameTextForPlayer(playerid,\"~g~Életed feltöltve!\",3000,3);
SetPlayerHealth(playerid,100);
   return 1;
}
CMD:kill(playerid)
{
   GameTextForPlayer(playerid,\"~r~Meghaltál!!\",3000,3);
SetPlayerHealth(playerid,0);
   return 1;
}
CMD:setskin(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new pplayerid,skin,string[128];
   if(sscanf(params, \"ui\", pplayerid,skin)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /setskin [Játékos ID/Játékos Név] [skin ID]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
P_Data[pplayerid][pSkin] = skin;
SetPlayerSkin(pplayerid,skin);
format(string,sizeof(string),\"{DAEB26}Adminisztrátor %s Átállította a Skined: %d -ra/re.\",GetName(playerid),skin);
SendClientMessage(pplayerid,-1,string);
format(string,sizeof(string),\"{DAEB26}Adminisztrátor %s Átállította %s skinjét %d -ra/re.\",GetName(playerid),GetName(playerid),skin);
SendClientMessageToAll(-1,string);
   return 1;
}
CMD:kidob(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new pplayerid,string[128], vehicleid;
   new Float:x,Float:y,Float:z;
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /kidob [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
   vehicleid = GetPlayerVehicleID(pplayerid);
if(IsPlayerInAnyVehicle(pplayerid))
{
GetVehiclePos(vehicleid,x,y,z);
SetPlayerPos(pplayerid,x+2,y,z);
format(string,sizeof(string),\"{E31010}Adminisztrátor %s Kidobott a jármûvedbõl.\",GetName(playerid));
SendClientMessage(pplayerid,-1,string);
format(string,sizeof(string),\"{E31010}Adminisztrátor %s Kidobota %s -t a jármûvébõl.\",GetName(playerid),GetName(pplayerid));
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid,COLOR_RED,\"A megadott játékos nem ül jármûben!\");
   return 1;
}
CMD:jetpack(playerid)
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
SetPlayerSpecialAction(playerid, 2);
   return 1;
}
CMD:healall(playerid)
{
   if(P_Data[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 2-es színtû adminnak kell lenned!\");
   new string[128];
for(new i = 0; i   SetPlayerHealth(i,100); }
   format(string,sizeof(string),\"{19E620}Adminisztrátor %s Mindenkinek feltöltötte az életét.\",GetName(playerid));
   SendClientMessageToAll(-1,string);
return 1;
}
//=============================================== Level 3 =================================================
 
CMD:akill(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 3-as színtû adminnak kell lenned!\");
   new pplayerid,string[128];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /akill [Játékos ID/Játékos Név]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
SetPlayerHealth(pplayerid,0);
format(string,sizeof(string),\"{197FE6}Adminisztrátor %s megölte %s -t.\",GetName(playerid),GetName(pplayerid));
SendClientMessageToAll(-1,string);
return 1;
}
CMD:kick(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 3-as színtû adminnak kell lenned!\");
   new string[128],pplayerid, reason[48];
   if(sscanf(params, \"us[48]\", pplayerid, reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /kick [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rosz játékos ID!\");
   if(P_Data[pplayerid][pAdmin] == 3) return SendClientMessage(playerid, COLOR_RED, \"A Parancs használatához legalább 3-as színtû adminnak kell lenned!\");
format(string,sizeof(string),\"{197FE6}Adminisztrátor %s kirúgta %s -t. Indok: %s.\",GetName(playerid),GetName(pplayerid),reason);
   SendClientMessageToAll(-1,string);
Kick(pplayerid);
   return 1;
}
CMD:givemoney(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 3-as színtû adminnak kell lenned!\");
   new pplayerid,money,string[128];
   if(sscanf(params, \"ui\", pplayerid,money)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /givemoney [Játékos ID/Játékos Név] [Pénz]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
GivePlayerMoney(pplayerid, money);
format(string,sizeof(string),\"{DAEB26}Adminisztrátor %s küldött neked %d $-t\",GetName(playerid),money);
SendClientMessage(pplayerid,-1,string);
format(string,sizeof(string),\"{DAEB26}Adminisztrátor %s Küldött %s-nak/nek %d $-t\",GetName(playerid),GetName(pplayerid),money);
SendClientMessage(playerid,-1,string);
return 1;
}
CMD:giveweapon(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 3-as színtû adminnak kell lenned!\");
   new pplayerid,gun,ammo,string[128],gunname[128];
   if(sscanf(params, \"uii\", pplayerid,gun,ammo)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /giveweapon [Játékos ID/Játékos Név] [Fegyver ID] [Töltény]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
GivePlayerWeapon(pplayerid, gun,ammo);
GetWeaponName(gun,gunname,sizeof(gunname));
if(gun > 46 || gun < 1) return SendClientMessage(playerid, COLOR_RED, \"Rossz Fegyver ID\");
format(string,sizeof(string),\"{197FE6}Adminisztrátor %s adott neked egy %s fegyvert, %d tölténnyel!\",GetName(playerid),gunname, ammo);
SendClientMessage(pplayerid,-1,string);
format(string,sizeof(string),\"{197FE6}Adminisztrátor %s adott %s-nak/nek egy %s fegyvert, %d tölténnyel!\",GetName(playerid),GetName(pplayerid),gunname,ammo);
SendClientMessageToAll(-1,string);
return 1;
}
CMD:setweather(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 3-as színtû adminnak kéne lenned!\");
   new   pplayerid, string[128],weather;
   if(sscanf(params, \"ui\", pplayerid,weather)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /setweather [Játékos ID/Játékos Név] [idõjárás ID (0 - 45)]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
   if(weather > 45 || weather < 0) return SendClientMessage(playerid, COLOR_RED, \"Rossz Idõjárás ID!\");
   SetPlayerWeather(pplayerid,weather);
   format(string,sizeof(string),\"{197FE6}%s Megváltoztatta az idõjárásodat: %d -ra/re\",GetName(playerid),weather);
   SendClientMessage(pplayerid,-1,string);
   format(string,sizeof(string),\"{197FE6}Megváltoztattad az idõjárást %-nak/nek: %d -ra/re\",GetName(pplayerid),weather);
   SendClientMessage(playerid,-1,string);
return 1;
}
CMD:settime(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 3-as színtû adminnak kéne lenned!\");
   new time, string[128];
   if(sscanf(params, \"i\", time)) return SendClientMessage(playerid, -1, \"Használat: /settime [idõ]\");
   if(time > 24 || time < 0) return SendClientMessage(playerid, -1, \"Rossz idõ lett megadva!\");
   SetWorldTime(time);
   format(string, 128, \"{ff0000}Adminisztrátor %s Megváltoztatta a Szerver Idõt: %d-ra/re!\", GetName(playerid),time);
   SendClientMessageToAll(0xff00FF,string);
   return 1;
}
CMD:setscore(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 3-as színtû adminnak kéne lenned!\");
   new   pplayerid,string[128],score;
   if(sscanf(params, \"ui\", pplayerid,score)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /setscore [Játékos ID/Játékos Név] [Pont]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
format(string,sizeof(string),\"{F0B630}%s Beállította a pontjaidat: %d -ra/re\",GetName(playerid),score);
   SendClientMessage(pplayerid,-1,string);
   format(string,sizeof(string),\"{F0B630}%s -nak/nek beállítottad a pontjait. Jelenlegi Pontjai: %d\",GetName(pplayerid),score);
   SendClientMessage(playerid,-1,string);
SetPlayerScore(pplayerid,score);
P_Data[playerid][pScore] = score;
return 1;
}
//====================================================== Level 4 =================================================
 
CMD:ban(playerid, params[])
{
new year, month, day; getdate(year, month, day);
new hour, minute, second; gettime(hour, minute, second);
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 4-es színtû adminnak kell lenned!\");
   new string[128],pplayerid, reason[48];
   if(sscanf(params, \"us[48]\", pplayerid, reason)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /ban [Játékos ID/Játékos Név] [indok]\");
   if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz Játékos ID!\");
format(string,sizeof(string),\"{197FE6}%s bannolva lett %s Adminisztrátor által. (Indok: %s) [idõ: %d/%d/%d %d:%d:%d ]\",GetName(playerid),GetName(pplayerid),reason, year, month, day, hour, minute, second);
   SendClientMessageToAll(-1,string);
Bans(playerid,pplayerid,reason);
   Ban(pplayerid);
   return 1;
}
CMD:unban(playerid, params[])
{
   new year, month, day; getdate(year, month, day);
   new hour, minute, second; gettime(hour, minute, second);
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 4-es színtû adminnak kell lenned!\");
   new name[48],string[64];
   if(sscanf(params, \"s[48]\",name)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /unban [Játékos Név]\");
format(string,sizeof(string),\"%s.ini\",name);
fremove(string);
format(string,sizeof(string),\"{197FE6}Adminisztrátor %s unbannolta %s -t. [idõ: %d/%d/%d %d:%d:%d ]\",GetName(playerid), name, year, month, day, hour, minute, second);
SendClientMessageToAll(-1, string);
SendRconCommand(string);
SendRconCommand(\"reloadbans\");
   return 1;
}
CMD:disarm(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 4-es színtû adminnak kell lenned!\");
   new pplayerid,string[64];
   if(sscanf(params, \"u\",pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /disarm [Játékos ID/Játékos Név]\");
format(string,sizeof(string),\"{197FE6}Adminisztrátor %s Lefegyverezett téged!\",GetName(playerid));
SendClientMessage(pplayerid,-1,string);
format(string,sizeof(string),\"{197FE6}Lefegyvereszted %s -t.\",GetName(pplayerid));
SendClientMessage(playerid,-1,string);
ResetPlayerWeapons(pplayerid);
   return 1;
}
CMD:killall(playerid)
{
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 4-es színtû adminnak kell lenned!\");
   for(new i=0; i    {
   SetPlayerHealth(i,0);
   }
   return 1;
}
CMD:explode(playerid, params[])
{
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"A parancs használatához legalább 4-es színtû adminnak kell lenned!\");
   new   pplayerid,string[128];
   if(sscanf(params, \"u\", pplayerid)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /explode [Játékos ID/Játékos Név]\");
   Explode(pplayerid);
   format(string,sizeof(string),\"{F0B630}Adminisztrátor %s Felrobbantotta %s-t.\",GetName(playerid),GetName(pplayerid));
   SendClientMessageToAll(-1,string);
return 1;
}
CMD:armourall(playerid) {
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 4-es színtû adminnak kéne lenned!\");
   new
       string[128];
for(new i = 0; i   SetPlayerArmour(i,100); }
   format(string,sizeof(string),\"{197FE6}%s Felfegyverezett mindenkit.\",GetName(playerid));
   SendClientMessageToAll(-1,string);
return 1;
}
CMD:rescar(playerid) {
   if(P_Data[playerid][pAdmin] < 4) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 4-es színtû adminnak kéne lenned!\");
   new string[128];
for(new car = 0; car    VehicleHaveDriver(car);
SetVehicleToRespawn(car); }
   format(string,sizeof(string),\"{19E620}%s újraspawnolta az összes kocsit.\",GetName(playerid));
   SendClientMessageToAll(-1,string);
return 1;
}
//Level 5
CMD:setlevel(playerid, params[])
{
if(P_Data[playerid][pAdmin] < 5 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!\");
new string[128], pplayerid, level;
new year,month,day;   getdate(year, month, day);
new hour,minute,second; gettime(hour,minute,second);
if(sscanf(params, \"ui\", pplayerid, level)) return SendClientMessage(playerid, COLOR_RED, \"Használat: /setlevel [Játékos ID/Játékos Név] [Admin Level]\");
if(level > 5 || level < 0) return SendClientMessage(playerid,COLOR_RED,\"Maximum szint 5.\");
if(pplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, \"Rossz játékod ID!\");
format(string,sizeof(string),\"{19E620}%s fokozta az admin szinted: %d -ra/re! [idõ %d/%d/%d %d:%d:%d]\",GetName(playerid),level, year, month, day, hour, minute, second);
SendClientMessage(pplayerid,-1,string);
format(string,sizeof(string),\"{19E620}Adminisztrátor %s fokozta %s -nak/nek az admin szintjét: %d -ra/re. [idõ: %d/%d/%d %d:%d:%d]\",GetName(playerid),GetName(pplayerid),level, year, month, day, hour, minute, second);
SendClientMessageToAll(-1,string);
P_Data[pplayerid][pAdmin] = level;
return 1;
}
CMD:god(playerid)
{
if(P_Data[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!\");
if(!GetPVarInt(playerid, \"god\"))
{
SetPVarInt(playerid, \"god\", 1);
SendClientMessage(playerid,0x00ff1eAA,\"God Mód Aktiválva!\");
SetPlayerHealth(playerid,99999);
}else{
SetPVarInt(playerid, \"god\", 0);
SendClientMessage(playerid,0xff0000AA,\"God Mód Kikapcsolva!\");
SetPlayerHealth(playerid,100);
}
return 1;
}
CMD:allips(playerid) {
   if(P_Data[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!\");
   new   string[128],playersip[20];
   foreach(Player, i) {
   GetPlayerIp(i,playersip,sizeof(playersip));
   format(string,sizeof(string),\"{19E620}%s IP-je: %s\",GetName(i),playersip);
   SendClientMessage(playerid,-1,string);  }
   return 1;
}
CMD:kickall(playerid)
{
   if(P_Data[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!\");
   for(new i=0; i    {
Kick(i);
   }
   return 1;
}
CMD:gmx(playerid)
{
   if(P_Data[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!\");
     SendRconCommand(\"gmx\");
   return 1;
}
CMD:muteall(playerid) {
   if(P_Data[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!!\");
   new string[32];
   SendClientMessage(playerid, -1, \"{E31010}Lenémítottad az összes Játékost!\");
     foreach(Player, i) {
     if(P_Data[pMute] == 1) {format(string,sizeof(string),\"{E31010}%s\",GetName(i)); SendClientMessage(playerid, -1, string);} }
   return 1;
}
CMD:freezeall(playerid) {
   if(P_Data[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_RED, \"Ehhez a parancshoz legalább 5-ös színtû adminnak kéne lenned!\");
   new string[32];
   SendClientMessage(playerid, -1, \"{197FE6}Lefagyasztott minden játékost!\");
     foreach(Player, i) {
     if(P_Data[pFrozen] == 1) {format(string,sizeof(string),\"{197FE6}%s\",GetName(i)); SendClientMessage(playerid, -1, string);} }
   return 1;
}
CMD:acmds(playerid, params[])
{
   if(P_Data[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy admin!\");
if(P_Data[playerid][pAdmin] == 1) {
new acmdstr[2048];
    acmdstr[0] = EOS;
strcat(acmdstr,\"{19E620}\\t\\t\\t\\t.: Admin Parancsok :.\\n\");
strcat(acmdstr,\"{19E620}Level 1: /clearchat | /announce | /goto | /get | /[un]mute | /getip | /slap | /apm | /achat\\n\");
      ShowPlayerDialog(playerid,DIALOG_ACMDS,DIALOG_STYLE_MSGBOX,\"Admin Parancsok\",acmdstr,\"Bezár\",\"\");
}
if(P_Data[playerid][pAdmin] == 2) {
   new acmdstr[2048];
    acmdstr[0] = EOS;
strcat(acmdstr,\"{19E620}\\t\\t\\t\\t.: Admin Parancsok :.\\n\");
strcat(acmdstr,\"{19E620}Level 1: /clearchat | /announce | /goto | /get | /[un]mute | /getip | /slap | /apm | /achat\\n\");
strcat(acmdstr,\"{F0B630}Level 2: /healall | /[un]freeze | /setskin | /jetpack | /akill | /warn\\n\");
ShowPlayerDialog(playerid,DIALOG_ACMDS,DIALOG_STYLE_MSGBOX,\"Admin Parancsok\",acmdstr,\"Bezár\",\"\");
}
if(P_Data[playerid][pAdmin] == 3) {
   new acmdstr[2048];
    acmdstr[0] = EOS;
strcat(acmdstr,\"{19E620}\\t\\t\\t\\t.: Admin Parancsok :.\\n\");
strcat(acmdstr,\"{19E620}Level 1: /clearchat | /announce | /goto | /get | /[un]mute | /getip | /slap | /apm | /achat\\n\");
strcat(acmdstr,\"{F0B630}Level 2: /healall | /[un]freeze | /setskin | /jetpack | /akill | /warn\\n\");
strcat(acmdstr,\"{197FE6}Level 3: /kick | /kidob | /givemoney | /setweapon | /setweather | /setscore\\n\");
ShowPlayerDialog(playerid,DIALOG_ACMDS,DIALOG_STYLE_MSGBOX,\"Admin Parancsok\",acmdstr,\"Bezár\",\"\");
}
if(P_Data[playerid][pAdmin] == 4) {
   new acmdstr[2048];
    acmdstr[0] = EOS;
strcat(acmdstr,\"{19E620}\\t\\t\\t\\t.: Admin Parancsok :.\\n\");
strcat(acmdstr,\"{19E620}Level 1: /clearchat | /announce | /goto | /get | /[un]mute | /getip | /slap | /apm | /achat\\n\");
strcat(acmdstr,\"{F0B630}Level 2: /healall | /[un]freeze | /setskin | /jetpack | /akill | /warn\\n\");
strcat(acmdstr,\"{197FE6}Level 3: /kick | /kidob | /givemoney | /setweapon | /setweather | /setscore\\n\");
strcat(acmdstr,\"{113ABF}Level 4: /[un]ban | /killall | /explode | /armourall | /disarm | /rescar\\n\");
ShowPlayerDialog(playerid,DIALOG_ACMDS,DIALOG_STYLE_MSGBOX,\"Admin Parancsok\",acmdstr,\"Bezár\",\"\");
}
if(P_Data[playerid][pAdmin] == 5) {
    new acmdstr[2048];
    acmdstr[0] = EOS;
strcat(acmdstr,\"{19E620}\\t\\t\\t\\t.: Admin Parancsok :.\\n\");
strcat(acmdstr,\"{19E620}Level 1: /clearchat | /announce | /goto | /get | /[un]mute | /getip | /slap | /apm | /achat\\n\");
strcat(acmdstr,\"{F0B630}Level 2: /healall | /[un]freeze | /setskin | /jetpack | /akill | /warn\\n\");
strcat(acmdstr,\"{197FE6}Level 3: /kick | /kidob | /givemoney | /setweapon | /setweather | /setscore\\n\");
strcat(acmdstr,\"{113ABF}Level 4: /[un]ban | /killall | /explode | /armourall | /disarm | /rescar\\n\");
strcat(acmdstr,\"{E31010}Level 5: /setlevel | /allips | /kickall | /gmx | /muteall| /freezeall /god\\n\");
ShowPlayerDialog(playerid,DIALOG_ACMDS,DIALOG_STYLE_MSGBOX,\"Admin Parancsok\",acmdstr,\"Bezár\",\"\");
}
return 1;
}
//============RCON Support==============
CMD:panel(playerid)
{
   if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, \"Nem vagy RCON Admin hogy használni tudd a parancsot!\");
   ShowPlayerDialog(playerid,RCON_DIALOG,DIALOG_STYLE_LIST,\"RCON Beállítások\",\"Szerver név beállítás\\nMap név beállítás\\nSzerver Feloldás\\nSzerver Lezárás\\nÚjraindítás\\nJelszó változtatás\\nKikapcsolás\",\"Választ\",\"Bezárás\");
return 1;
}
//============================Stock============================================
stock Explode(playerid) {
new Float:Pos[3];
GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 10);
}
stock VehicleHaveDriver(car) {
foreach(Player, i) {
if(IsPlayerInVehicle(i, car)) return 1;
}
return 1;
}
stock Bans(playerid,targetid,reason[]) {
new string[128];
format(string, sizeof(string), \"%s Bannolta %s -t. Indok: %s \\r\\n\", GetName(playerid),GetName(targetid),reason);
   new File:hFile;
   hFile = fopen(\"/Adminrendszer/Bans.txt\", io_append);
   fwrite(hFile, string);
   fclose(hFile);
}
stock AskLog(playerid,text[]) {
new string[128];
format(string, sizeof(string), \"%s Üzenete: %s \\r\\n\", GetName(playerid),text);
   new File:hFile;
   hFile = fopen(\"/Adminrendszer/ReportLog.txt\", io_append);
   fwrite(hFile,string);
   fclose(hFile);
}
stock Cars(playerid, model, color1, color2) {
new Float:Pos[4];
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]);
if(GetPVarInt(playerid,\"VipCar\") != -1) DestroyVehicle(GetPVarInt(playerid,\"VipCar\"));
new vehicleid = CreateVehicle(model,Pos[0],Pos[1],Pos[2], Pos[3],color1, color2, 3600);
SetPVarInt(playerid,\"VipCar\", vehicleid);
SendClientMessage(playerid,-1,\"\"COL_YELLOW\"Jármû spawnolva!\");
}
stock IsRegistered(name[]) {
new string[128];
format(string, sizeof(string), \"Adminrendszer/Játékosok/%s.ini\", name);
if(dfile_FileExists(string)) return true;
return false;
}
stock pName(playerid) {
static getName[24];
GetPlayerName(playerid, getName, 24);
return getName;
}
//Skin fasz
GetNumberOfPages()
{
if((gTotalItems >= SELECTION_ITEMS) && (gTotalItems % SELECTION_ITEMS) == 0)
{
return (gTotalItems / SELECTION_ITEMS);
}
else return (gTotalItems / SELECTION_ITEMS) + 1;
}
//------------------------------------------------
PlayerText:CreateCurrentPageTextDraw(playerid, Float:Xpos, Float:Ypos)
{
new PlayerText:txtInit;
     txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, \"0/0\");
     PlayerTextDrawUseBox(playerid, txtInit, 0);
PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
PlayerTextDrawFont(playerid, txtInit, 1);
PlayerTextDrawSetShadow(playerid, txtInit, 0);
   PlayerTextDrawSetOutline(playerid, txtInit, 1);
   PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
   PlayerTextDrawShow(playerid, txtInit);
   return txtInit;
}
//------------------------------------------------
// Creates a button textdraw and returns the textdraw ID.
PlayerText:CreatePlayerDialogButton(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height, button_text[])
{
new PlayerText:txtInit;
     txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, button_text);
     PlayerTextDrawUseBox(playerid, txtInit, 1);
     PlayerTextDrawBoxColor(playerid, txtInit, 0x000000FF);
     PlayerTextDrawBackgroundColor(playerid, txtInit, 0x000000FF);
PlayerTextDrawLetterSize(playerid, txtInit, 0.4, 1.1);
PlayerTextDrawFont(playerid, txtInit, 1);
PlayerTextDrawSetShadow(playerid, txtInit, 0); // no shadow
   PlayerTextDrawSetOutline(playerid, txtInit, 0);
   PlayerTextDrawColor(playerid, txtInit, 0x4A5A6BFF);
   PlayerTextDrawSetSelectable(playerid, txtInit, 1);
   PlayerTextDrawAlignment(playerid, txtInit, 2);
   PlayerTextDrawTextSize(playerid, txtInit, Height, Width); // The width and height are reversed for centering.. something the game does
   PlayerTextDrawShow(playerid, txtInit);
   return txtInit;
}
//------------------------------------------------
PlayerText:CreatePlayerHeaderTextDraw(playerid, Float:Xpos, Float:Ypos, header_text[])
{
new PlayerText:txtInit;
     txtInit = CreatePlayerTextDraw(playerid, Xpos, Ypos, header_text);
     PlayerTextDrawUseBox(playerid, txtInit, 0);
PlayerTextDrawLetterSize(playerid, txtInit, 1.25, 3.0);
PlayerTextDrawFont(playerid, txtInit, 0);
PlayerTextDrawSetShadow(playerid, txtInit, 0);
   PlayerTextDrawSetOutline(playerid, txtInit, 1);
   PlayerTextDrawColor(playerid, txtInit, 0xACCBF1FF);
   PlayerTextDrawShow(playerid, txtInit);
   return txtInit;
}
//------------------------------------------------
PlayerText:CreatePlayerBackgroundTextDraw(playerid, Float:Xpos, Float:Ypos, Float:Width, Float:Height)
{
new PlayerText:txtBackground = CreatePlayerTextDraw(playerid, Xpos, Ypos,
\"                                            ~n~\"); // enough space for everyone
   PlayerTextDrawUseBox(playerid, txtBackground, 1);
   PlayerTextDrawBoxColor(playerid, txtBackground, 0x4A5A6BBB);
PlayerTextDrawLetterSize(playerid, txtBackground, 5.0, 5.0);
PlayerTextDrawFont(playerid, txtBackground, 0);
PlayerTextDrawSetShadow(playerid, txtBackground, 0);
   PlayerTextDrawSetOutline(playerid, txtBackground, 0);
   PlayerTextDrawColor(playerid, txtBackground,0x000000FF);
   PlayerTextDrawTextSize(playerid, txtBackground, Width, Height);
     PlayerTextDrawBackgroundColor(playerid, txtBackground, 0x4A5A6BBB);
   PlayerTextDrawShow(playerid, txtBackground);
   return txtBackground;
}
//------------------------------------------------
// Creates a model preview sprite
PlayerText:CreateModelPreviewTextDraw(playerid, modelindex, Float:Xpos, Float:Ypos, Float:width, Float:height)
{
   new PlayerText:txtPlayerSprite = CreatePlayerTextDraw(playerid, Xpos, Ypos, \"\"); // it has to be set with SetText later
   PlayerTextDrawFont(playerid, txtPlayerSprite, TEXT_DRAW_FONT_MODEL_PREVIEW);
   PlayerTextDrawColor(playerid, txtPlayerSprite, 0xFFFFFFFF);
   PlayerTextDrawBackgroundColor(playerid, txtPlayerSprite, 0x88888899);
   PlayerTextDrawTextSize(playerid, txtPlayerSprite, width, height); // Text size is the Width:Height
   PlayerTextDrawSetPreviewModel(playerid, txtPlayerSprite, modelindex);
   PlayerTextDrawSetSelectable(playerid, txtPlayerSprite, 1);
   PlayerTextDrawShow(playerid,txtPlayerSprite);
   return txtPlayerSprite;
}
//------------------------------------------------
DestroyPlayerModelPreviews(playerid)
{
new x=0;
while(x != SELECTION_ITEMS) {
    if(gSelectionItems[playerid]
  • != PlayerText:INVALID_TEXT_DRAW) {

   PlayerTextDrawDestroy(playerid, gSelectionItems[playerid]
  • );

   gSelectionItems[playerid]
  • = PlayerText:INVALID_TEXT_DRAW;

}
x++;
}
}
//------------------------------------------------
ShowPlayerModelPreviews(playerid)
{
   new x=0;
new Float:BaseX = DIALOG_BASE_X;
new Float:BaseY = DIALOG_BASE_Y - (SPRITE_DIM_Y * 0.33); // down a bit
new linetracker = 0;
new itemat = GetPVarInt(playerid, \"skinc_page\") * SELECTION_ITEMS;
// Destroy any previous ones created
DestroyPlayerModelPreviews(playerid);
while(x != SELECTION_ITEMS && itemat < gTotalItems) {
    if(linetracker == 0) {
        BaseX = DIALOG_BASE_X + 25.0; // in a bit from the box
        BaseY += SPRITE_DIM_Y + 1.0; // move on the Y for the next line
}
       gSelectionItems[playerid]
  • = CreateModelPreviewTextDraw(playerid, gItemList[itemat], BaseX, BaseY, SPRITE_DIM_X, SPRITE_DIM_Y);

       gSelectionItemsTag[playerid]
  • = gItemList[itemat];

BaseX += SPRITE_DIM_X + 1.0; // move on the X for the next sprite
linetracker++;
if(linetracker == ITEMS_PER_LINE) linetracker = 0;
itemat++;
x++;
}
}
//------------------------------------------------
UpdatePageTextDraw(playerid)
{
new PageText[64+1];
format(PageText, 64, \"%d/%d\", GetPVarInt(playerid,\"skinc_page\") + 1, GetNumberOfPages());
PlayerTextDrawSetString(playerid, gCurrentPageTextDrawId[playerid], PageText);
}
//------------------------------------------------
CreateSelectionMenu(playerid)
{
   gBackgroundTextDrawId[playerid] = CreatePlayerBackgroundTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y + 20.0, DIALOG_WIDTH, DIALOG_HEIGHT);
   gHeaderTextDrawId[playerid] = CreatePlayerHeaderTextDraw(playerid, DIALOG_BASE_X, DIALOG_BASE_Y, HEADER_TEXT);
   gCurrentPageTextDrawId[playerid] = CreateCurrentPageTextDraw(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y + 15.0);
   gNextButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 30.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, NEXT_TEXT);
   gPrevButtonTextDrawId[playerid] = CreatePlayerDialogButton(playerid, DIALOG_WIDTH - 90.0, DIALOG_BASE_Y+DIALOG_HEIGHT+100.0, 50.0, 16.0, PREV_TEXT);
   ShowPlayerModelPreviews(playerid);
   UpdatePageTextDraw(playerid);
}
//------------------------------------------------
DestroySelectionMenu(playerid)
{
DestroyPlayerModelPreviews(playerid);
PlayerTextDrawDestroy(playerid, gHeaderTextDrawId[playerid]);
PlayerTextDrawDestroy(playerid, gBackgroundTextDrawId[playerid]);
PlayerTextDrawDestroy(playerid, gCurrentPageTextDrawId[playerid]);
PlayerTextDrawDestroy(playerid, gNextButtonTextDrawId[playerid]);
PlayerTextDrawDestroy(playerid, gPrevButtonTextDrawId[playerid]);
gHeaderTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gBackgroundTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gCurrentPageTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gNextButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
   gPrevButtonTextDrawId[playerid] = PlayerText:INVALID_TEXT_DRAW;
}
//------------------------------------------------
HandlePlayerItemSelection(playerid, selecteditem)
{
    if(gSelectionItemsTag[playerid][selecteditem] >= 0 && gSelectionItemsTag[playerid][selecteditem] < 300)
{
       SetPlayerSkin(playerid, gSelectionItemsTag[playerid][selecteditem]);
       gSelectionItemsTag[playerid][selecteditem] = P_Data[playerid][pSkin];
if(SkinChange1[playerid] == 1)
       {
       SendClientMessage(playerid,0x10F441AA, \"Skined megváltoztatva!\");
}
       else
       {
       SendClientMessage(playerid,0x10F441AA, \"Skined kiválasztva! Ha változtatni akarod a skined, írd be a /skin parancsot!\");
       }
return;
}
}
« Utoljára szerkesztve: 2013. október 25. - 21:03:52 írta Szily88 »

Nem elérhető ZSOLTI99

  • 1827
    • Profil megtekintése
Dadmin
« Válasz #1 Dátum: 2013. október 25. - 23:07:13 »
0 Show voters
Ez tök jó script régen használtam és ment! Pedig ennek menni kéne!

Dadmin
« Válasz #2 Dátum: 2013. október 26. - 06:24:22 »
0 Show voters
Nem megy!!

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal