Help with new GM (i started it from 0)
#1

So.. Hi everybody.I need a help. I started my gm and i have a problem now.. With admin commands.

How to make admin command on this server (and registration).Just make one command for admin on this server.. Who works good.

Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <dini>
#include <dudb>

#pragma unused ret_memcpy

#define COLOR_WHITE             0xFFFFFFAA
#define COLOR_RED               0xFF0000AA
#define COLOR_GREEN             0x00FF00AA
#define COLOR_BLUE              0x0000FFAA
#define COLOR_GRAY              0xAFAFAFAA
#define COLOR_YELLOW            0xFFFF00AA
#define COLOR_LIGHTBLUE         0x0AFFFFAA
#define COLOR_PURPLE            0xFF00FFAA
#define COLOR_ORANGE            0xFFBB00AA


enum pInfo
{
    pAdminLevel,
    pCash,
    pScore,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
new gPlayerLogged[MAX_PLAYERS];

#define SERVER_USER_FILE "users/%s.ini"

main()
{
        print("\n----------------------------------");
        print(" New 1");
        print("----------------------------------\n");
}

public OnGameModeInit()
{
        // Don't use these lines if it's a filterscript
        SetGameModeText("Blank Script");
        AddPlayerClass(0, 628.3459, -552.4622, 16.6102, 272.5572, 0, 0, 0, 0, 0, 0);
    AddStaticVehicle(520, 2038.0841, 1342.9535, 10.6719, 178.2983, 0, 1);
        return 1;
}

public OnGameModeExit()
{
        return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
        SetPlayerPos(playerid, 658.1409,-811.5725,86.3309);
        SetPlayerCameraPos(playerid, 658.1409, -811.5725, 86.3309);
        SetPlayerCameraLookAt(playerid, 658.1409, -811.5725, 86.3309);
        return 1;
}

public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if (!dini_Exists(file))
    {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Sveiki jūs neuћsiregistravę", "Sveiki,įveskite savo slaptaћodį laukelyje", "Registruotis", "Iљeiti");
    }
    if(fexist(file))
    {
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Sveiki, jūs uћsiregistravęs", "Įveskite savo slaptaћodį laukelyje", "Prisijungti", "Iљeiti");
    }
        return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    if(gPlayerLogged[playerid] == 1)
    {
        dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
        dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    }
    gPlayerLogged[playerid] = 0;
        return 1;
}

public OnPlayerSpawn(playerid)
{
 return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
        return 1;
}

public OnVehicleSpawn(vehicleid)
{
        return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
        return 1;
}

public OnPlayerText(playerid, text[])
{
        return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
        return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
        return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
        return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
        return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
        return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
        return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
        return 1;
}

public OnRconCommand(cmd[])
{
        return 1;
}

public OnPlayerRequestSpawn(playerid)
{
        return 1;
}

public OnObjectMoved(objectid)
{
        return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
        return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
        return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
        return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
        return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
        return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
        return 1;
}

public OnPlayerExitedMenu(playerid)
{
        return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
        return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
        return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
        return 1;
}

public OnPlayerUpdate(playerid)
{
        return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
        return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
        return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
        return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
        return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if (dialogid == 1)
    {
        new name[MAX_PLAYER_NAME], file[256], string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Sveiki jūs neuћsiregistravęs", "Sveiki,jūs neuћsiregistravęs įveskite slaptaћodį laukelyje", "Registruotis", "Iљeiti");
        dini_Create(file);
        dini_IntSet(file, "Password", udb_hash(inputtext));
        dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
        dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
        dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
        format(string, 128, "[SISTEMA]: Jūs sėkmingai uћsiregistravote jūsu Vardas_Pavardė yra %s o slaptaћodis %s, jūs prijungtas automatiљkai.", name, inputtext);
        SendClientMessage(playerid, COLOR_YELLOW, string);
        gPlayerLogged[playerid] = 1;
    }
    if (dialogid == 2)
    {
        new name[MAX_PLAYER_NAME], file[256];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Sveiki,jūs uћsiregistravę", "Sveiki,jūs esate uћsiregistravęs,įveskite savo slaptaћodį laukelyje", "Prisijungti", "Iљeiti");
        new tmp;
        tmp = dini_Int(file, "Password");
        if(udb_hash(inputtext) != tmp) {
            SendClientMessage(playerid, COLOR_RED, "Neteisintas slaptaћodis!.");
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Sveiki jūs uћsiregistravęs", "Sveiki,jūs esate uћsiregistravęs,įveskite savo slaptaћodį laukelyje", "Prisijungti", "Iљeiti");
        }
        else
        {
            gPlayerLogged[playerid] = 1;
            PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
            SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
            GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
            SendClientMessage(playerid,COLOR_RED, "[SISTEMA]: Sėkmingai prisijungta!");
        }
    }
        return 1;
}

public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
        return 1;
}
Reply
#2

LoL, so you want an admin system? Just look on filterscripts section, there are alot of admin filterscripts, if you can't make your own, download one!
EDIT:
Buuut. You can make a level system:
pawn Код:
new gPlayerLevel[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid) {
    gPlayerLevel[playerid] = 0;
    return true;
}
And, if you want to set player's level:
pawn Код:
gPlayerLevel[playerid] = somelevelhere;
And, to make cmds only for some level:
pawn Код:
if(gPlayerLevel[playerid] < 2) return SendClientMessage(playerid, 0xAAAAAA, "You need to be level 2 to use this");
Will make a cmd for level 2
Reply
#3

I don't now how to make that on my GM i need to insert admin system.Could anyone do that pls ?
Reply
#4

You don't need to insert anything in your GM, you can use them as a FS.
Reply
#5

Check my EDIT
Reply
#6

i wan to insert that to GM i see Mean admin .. But i want to insert that to my GM
Reply
#7

Why would you insert it, use it as a FS! Add mAdmin to your filterscripts line if you wanna use my MeanAdmin
Reply
#8

i need admin system to make in my GM Example : Your filescript admin "Mean" i want to insert into my gm.You see i don't want to have any FS in my GM.I will insert all in GM.So i want to iinsert admin system.
Reply
#9

I don't really see the purpose of adding everything to your GM.
You can just look through Mean's FS and learn from it, then you can make your own.
Reply
#10

if someone can made one command for my gm with admin.. i will be very happy,and i will say "Thank you very much".Pls make one command like Kick or smth
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)