Szerző Téma: Admin parancsok  (Megtekintve 369 alkalommal)

Admin parancsok
« Dátum: 2013. július 30. - 12:04:41 »
0 Show voters
Udv all
Keszitettem egy szriptet amiben admin parancsok talalhatok
Keszitesi ido : 30 perc
Tesztelve
 
[/#include <a_samp>
#include <sscanf>
#include <dini>
#if defined FILTERSCRIPT
 
if(strcmp(cmd, \"/stats\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        new vehicle[MAX_PLAYERS], business[MAX_PLAYERS];
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"/stats [playerid]\");
   return 1;
}
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalassahoz!\");
   return 1;
}
if(PlayerInfo[playerid][pAdmin] < 2)
{
    SendClientMessage(playerid, COLOR_BRIGHTRED, \"2-es szintu adminnak kene lenned ,hogy ezt a parancsot hasznalhasd!\");
    return 1;
}
 
if(strcmp(cmd, \"/ban\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /ban [playerid]\");
   return 1;
}
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalasahoz !\");
   return 1;
}
if(strcmp(cmd, \"/kick\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /kick [playerid]\");
   return 1;
}
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jeletnkezz be a parancs hasznalasahoz!\");
   return 1;
}
if(strcmp(cmd, \"/jail\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /jail [playerid]\");
   return 1;
}
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalasahoz!\");
   return 1;
}
if(strcmp(cmd, \"/unjail\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /unjail [playerid]\");
   return 1;
}
if(strcmp(cmd, \"/freeze\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalasahoz!\");
   return 1;
}
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /freeze [playerid]\");
   return 1;
}
if(strcmp(cmd, \"/unfreeze\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
        PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalasahoz!\");
   return 1;
}
if(!strlen(tmp))
 {
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /unfreeze [playerid]\");
   return 1;
}
if(strcmp(cmd, \"/givemoney\", true) == 0) {
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(playerid, sendername, sizeof(sendername));
        PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
if(logged[playerid] == 0) {
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalasahoz!\");
   return 1;
}
if(!strlen(tmp)) {
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /givemoney [playerid] [Mennyiseg]\");
   return 1;
}
   moneys[playerid] = strval(tmp);
if (IsPlayerConnected(giveplayerid)) {
   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
   GetPlayerName(playerid, sendername, sizeof(sendername));
   GetPlayerMoney(playerid);
   GivePlayerMoney(giveplayerid, moneys[playerid]);
   format(string, sizeof(string), \"Te adtal penzt $%d jatekosnak %s (id: %d).\",moneys[playerid],giveplayer,giveplayerid);
   SendClientMessage(playerid, COLOR_ORANGE, string);
   format(string, sizeof(string), \"Te adtal penzt $%d a jatekosnak %s (id: %d).\", moneys[playerid], sendername, playerid);
   SendClientMessage(giveplayerid, COLOR_ORANGE, string);
}
else {
   format(string, sizeof(string), \"%d a jatekos nem onlie .\", giveplayerid);
   SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
return 1;
}
if(strcmp(cmd, \"/setadmin\", true) == 0)
{
tmp = strtok(cmdtext, idx);
giveplayerid = strval(tmp);
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /setadmin [playerid] [level]\");
   return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"USAGE: /setadmin [playerid] [level]\");
   return 1;
}
if(logged[playerid] == 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Jelentkezz be a parancs hasznalasahoz!\");
   return 1;
}
PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), \"level\");
if (PlayerInfo[playerid][pAdmin] < 1)
{
            SendClientMessage(playerid, COLOR_BRIGHTRED, \"5 os adminnak kell legyel ,hogy a parancsot hasznalhasd!\");
            return 1;
}
level[playerid] = strval(tmp);
if(level[playerid] < 0)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Ervenytelen szint\");
            return 1;
}
if(level[playerid] > 2)
{
   SendClientMessage(playerid, COLOR_BRIGHTRED, \"Invalid Admin Level -=(0 = no admin/1 = min admin/2 = full admin)=-\");
            return 1;
}
if(level[playerid] == PlayerInfo[giveplayerid][pAdmin])
{
            format(string, sizeof(string), \" %d .\", level[playerid]);
            SendClientMessage(playerid, COLOR_BRIGHTRED, string);
            return 1;
}
if (IsPlayerConnected(giveplayerid))
{
   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
   GetPlayerName(playerid, sendername, sizeof(sendername));
   dini_IntSet(udb_encode(giveplayer), \"level\", level[playerid]);
   format(string, sizeof(string), \"Adminisztrator %s (id: %d),  %s (id: %d)  %d .\",sendername,playerid,giveplayer,giveplayerid,level[playerid]);
   SendClientMessageToAll(COLOR_ORANGE, string);
   format(string, sizeof(string), \" %s (id: %d),  %d.\", giveplayer,giveplayerid, level[playerid]);
   SendClientMessage(playerid, COLOR_ORANGE, string);
   format(string, sizeof(string), \" %d  %s (id: %d).\", level[playerid], sendername, playerid);
   SendClientMessage(giveplayerid, COLOR_ORANGE, string);
   PlayerInfo[giveplayerid][pAdmin] = dini_Int(udb_encode(giveplayer), \"level\");
}
else
{
   format(string, sizeof(string), \"ID:%d a jatekos nem onlie.\", giveplayerid);
            SendClientMessage(playerid, COLOR_BRIGHTRED, string);
}
return 1;
}
if(strcmp(cmd, \"/login\", true) == 0)
{
if(Spawned[playerid] == 0)
{
   
    return 1;
}
if(logged[playerid] == 1)
{
    SendClientMessage(playerid, COLOR_BRIGHTRED, \"Sikeresen bejelentkeztel\");
    return 1;
}
    tmp = strtok(cmdtext, idx);
   GetPlayerName(playerid, playername, sizeof(playername));
    if(!strlen(tmp))
   SendClientMessage(playerid, COLOR_LIGHTBLUE, \"Hasznalat: /login [password]\");
else
{
   if (dini_Exists(udb_encode(playername)))
   {
         tmp2 = dini_Get(udb_encode(playername), \"password\");
           if (udb_hash(tmp) != strval(tmp2))
           {
             SendClientMessage(playerid, COLOR_BRIGHTRED, \"Helytelen jelszo.\");
         }
         else {
            logged[playerid] = 1;
            dini_Set(udb_encode(playername),\"pass\",tmp);
            new tmp4[256];
                     new Float:x, Float:y, Float:z;
            new Float:a;
            playercount[playerid] = dini_Int(udb_encode(playername), \"vehicleresetcount\");
            if(playercount[playerid] != gVC)
            {
                dini_IntSet(udb_encode(playername), \"carowned\", 0);
                dini_IntSet(udb_encode(playername), \"car\", 0);
                dini_IntSet(udb_encode(playername), \"notified\", 1);
               
            }
            x = dini_Int(udb_encode(playername), \"x\");
            y = dini_Int(udb_encode(playername), \"y\");
            z = dini_Int(udb_encode(playername), \"z\");
            a = dini_Int(udb_encode(playername), \"a\");
            carowned[playerid] = dini_Int(udb_encode(playername), \"carowned\");
            moneys[playerid] = dini_Int(udb_encode(playername), \"money\");
            if(moneys[playerid] < 10000)
            {
               bank[playerid] = dini_Int(udb_encode(playername), \"bank\");
               if(bank[playerid] > 20000)
               {
               }
               if(bank[playerid] < 20000)
               {
                  moneys[playerid] = 10000;
               }
               GivePlayerMoney(playerid,moneys[playerid]);
            }
            if(moneys[playerid] >= 10000)
            {
                GivePlayerMoney(playerid,moneys[playerid]);
            }
                tmp4 = dini_Get(udb_encode(playername), \"bank\");
                PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(playername), \"level\");
                bank[playerid] = strval(tmp4);
                   SetPlayerPos(playerid,x,y,z);
            SetPlayerFacingAngle(playerid,a);
            biznote[playerid] = dini_Int(udb_encode(playername), \"bizsold\");
            carnote[playerid] = dini_Int(udb_encode(playername), \"carsold\");
            if(biznote[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, \"~~~~~~~...........::::::::::::.........!\");
                dini_IntSet(udb_encode(playername), \"bizsold\", 0);
            }
            if(carnote[playerid] == 1)
            {
                SendClientMessage(playerid, COLOR_BRIGHTRED, \"~~~~~........:::::::::........!\");
                dini_IntSet(udb_encode(playername), \"carsold\", 0);
            }
      }
   }
   else {
       format(string, sizeof(string), \"Nem vagy %s, regisztralva. Kerlek regisztralj /register [password].\", playername);
      SendClientMessage(playerid, COLOR_BRIGHTRED, string);
   }
}
return 1;
}
if(strcmp(cmd, \"/register\", true) == 0)
{
if(Spawned[playerid] == 0)
{
    SendClientMessage(playerid, COLOR_BRIGHTRED, \"Spawnolj le a parancs hasznalatahoz /login /register\");
    return 1;
}
    tmp = strtok(cmdtext, idx);
   GetPlayerName(playerid, playername, sizeof(playername));
        if(20 < strlen(tmp) || strlen(tmp) < 5)
{
   SendClientMessage(playerid, COLOR_YELLOW, \"A jelszo minimum 5-10 betubol aljon.\");
   return 1;
}
    if(!strlen(tmp))
   SendClientMessage(playerid, COLOR_YELLOW, \"Hasznalat: /register [password]\");
else {
   if (!dini_Exists(udb_encode(playername)))
   {
      dini_Create(udb_encode(playername));
      dini_IntSet(udb_encode(playername), \"password\", udb_hash(tmp));
      dini_Set(udb_encode(playername),\"pass\",tmp);
      new Float:x, Float:y, Float:z;
               new Float:a;
      GetPlayerFacingAngle(playerid,a);
      dini_IntSet(udb_encode(playername), \"a\", floatround(a));
         GetPlayerPos(playerid,x,y,z);
      dini_IntSet(udb_encode(playername), \"x\", floatround(x));
      dini_IntSet(udb_encode(playername), \"y\", floatround(y));
      dini_IntSet(udb_encode(playername), \"z\", floatround(z));
             dini_IntSet(udb_encode(playername), \"carowned\", 0);
             dini_IntSet(udb_encode(playername), \"car\", 0);
             dini_IntSet(udb_encode(playername), \"level\", 0);
      format(string, sizeof(string), \"--- %s (id: %d) Felhasznalo. Jelszo: %s.\", playername, playerid, tmp);
      printf(string);
      format(string, sizeof(string), \"Keszitettel egy felhasznalot %s ! Jelentkezz be a jelszoval ! %s.\", playername, tmp);
      SendClientMessage(playerid, COLOR_YELLOW, string);
   }
   else {
      format(string, sizeof(string), \"%s Regisztralt.\", playername,tmp);
      SendClientMessage(playerid, COLOR_BRIGHTRED, string);
   }
}
return 1;
}
CMD:goto(playerid,params[]) 
    {
            if(IsPlayerConnected(playerid))
            {
                {
                    new id;
                    if(!IsPlayerAdmin(playerid)) return msg(playerid,red,\"Nem vagy admin!\");
                    if(sscanf(params,\"u\",id)) return SendClientMessage(playerid,red,\"Használat: /goto [playerID]\");
                    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, red, \"Nem aktív játékos!\");
                    new Float:x,Float:y,Float:z;
                    GetPlayerPos(id,x,y,z);
                    if(IsPlayerInAnyVehicle(playerid))
                    {
                                new carid = GetPlayerVehicleID(playerid);
                                SetVehiclePos(carid, x+3,y,z);
                                PutPlayerInVehicle(playerid, carid, 1);
                            }
                            else
                            {
                                SetPlayerPos(playerid,x,y,z);
                            }
                    }
            }
            return 1;
    }
   
  CMD:get(playerid,params[])
    {
            if(IsPlayerConnected(playerid))
            {
                {
                    new id;
                    if(!IsPlayerAdmin(playerid)) return msg(playerid,red,\"Nem vagy admin!\");
                    if(sscanf(params,\"u\",id)) return SendClientMessage(playerid,red,\"Használat: /get [PLayerID]\");
                    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, red, \"Nem aktív játékos!\");
                    new Float:x,Float:y,Float:z;
                    GetPlayerPos(id,x,y,z);
                    if(IsPlayerInAnyVehicle(id))
                    {
                                new carid = GetPlayerVehicleID(id);
                                SetVehiclePos(carid, x+3,y,z);
                                PutPlayerInVehicle(id, carid, 1);
                            }
                            else
                            {
                                SetPlayerPos(id,x,y,z);
                            }
                    }
            }
            return 1;
    }
   
     CMD:asay(playerid, params[])
    {
            {
            new say[128];
            new nev[MAX_PLAYER_NAME];
            GetPlayerName(playerid,nev,sizeof(nev));
            new string[128];
            if(!IsPlayerAdmin(playerid)) return msg(playerid,red,\"Nem vagy admin!\");
            if(sscanf(params,\"s[128]\",say)) return msg(playerid,green,\"Használat: /asay [szöveg]\");
            else {
            format(string,sizeof(string),\"Admin:%s:%s\",nev,say);
            msgall(red,string);
            }
            }
            return 1;
    }
CMD:ahelp(playerid, params[])
{
ShowPlayerDialog(playerid,DIALOG_RM,DIALOG_STYLE_LIST,\"Admin help:\",\"/ban\\n/kick\\n/freeze\\n/unfreeze\\n/asay\\n/goto\\n/get\\n/setadmin\\n/givemonney\\n/jail\\n/unjail\\n/stats);
}
#endif]

Nem elérhető BoOy

  • 3209
  • 2013-as év szkriptere
    • Profil megtekintése
Admin parancsok
« Válasz #1 Dátum: 2013. július 30. - 13:24:25 »
0 Show voters
Õõõ tuti lett tesztelve??
Vedd le a
#if defined FILTERSCRIPT-et és a legaljáról az:
#endif-et és futtasd le.
Végeredmény: Pawn lefagyás.
Meg ez most hogy van hogy az egyik rész OnPlayerCommandText-es a másik ZCMD?

Nem elérhető jana4

  • 5929
  • Ex Staff
    • Profil megtekintése
Admin parancsok
« Válasz #2 Dátum: 2013. július 30. - 13:39:56 »
+2 Show voters
Zárok, ez mûködésképtelen, összelopott hányadék, sajnálom.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal