Looking for a filterscript
#1

I searched alot for some script in my mind and i didn't find it, I want a Register - Login Script with dialog, I found some in the forums and helped me a little
But what i want is :
Register Script with dialog +
Owner - Admins - moderators - helpers script with commands +
Someway to store the stats like : Kills, Deaths, Total hours on +
The problem is that everything depends on the other, Like the admins script depends on the register script, Etc
So i need one script to gather them all, Is there a script like that, if not, I guess I'll have to download a game mode and edit it to my liking.
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=356383
Click that bro, and look some.
Reply
#3

I checked that, But as i said, I don't know how to make two scripts together, Like the admins with the login-register one.
Reply
#4

Quote:
Originally Posted by xVIP3Rx
Посмотреть сообщение
I checked that, But as i said, I don't know how to make two scripts together, Like the admins with the login-register one.
Hmm..how about show the code.
Reply
#5

Umm, At the moment, I just made a Login-Register with dialog, Here's the codes if you wanna see em
Код:
#include <a_samp>
#include <dutils>
#include <Dini>
#pragma unused ret_memcpy

#define WHITE             0xFFFFFFAA
#define RED               0xFF0000AA
#define GREEN             0x00FF00AA

enum pInfo {
    AdminLevel,
    level,
    cash,
    pw,
}

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
    new name[MAX_PLAYER_NAME], file[128]; // the name and the file
    GetPlayerName(playerid, name, MAX_PLAYER_NAME); // getting client's name
    format(file, sizeof(file), ".../Users/%s.ini", name); // the location of the file
    if(!fexist(file)) { // if the file does not exists
        SendClientMessage(playerid, RED, "You are not registered, please register");
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Please Register", "Enter Your Password Below", "Register", "Cancel"); // this is the dialog type
    }
    else {
        new str[128]; // if the player IS registered
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(str, sizeof(str), "Welcome Back ~r~%s. Enjoy!", name);
        SendClientMessage(playerid, RED, str);
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new file[128], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    format(file, sizeof(file), ".../Users/%s.ini", name);
    if(dini_Exists(file)) {
        dini_IntSet(file, "pw", PlayerInfo[playerid][pw]);
        dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
        dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
        dini_IntSet(file, "level", PlayerInfo[playerid][level]);
    }
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1) {
        new file[128], name[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(file, sizeof(file), ".../Users/%s.ini", name);
        if(response) {
            if(strlen(inputtext)) {
                dini_Create(file);
                dini_IntSet(file, "pw", num_hash(inputtext));
                dini_IntSet(file, "AdminLevel", PlayerInfo[playerid][AdminLevel]);
                dini_IntSet(file, "cash", PlayerInfo[playerid][cash]);
                dini_IntSet(file, "level", PlayerInfo[playerid][level]);
                format(str, sizeof(str), "You are registered as ~r~%s. Your password is ~r~%s. /changepass to change it", name, inputtext);
                SendClientMessage(playerid, RED, str);
                PlayerInfo[playerid][level] = dini_Int(file, "level");
                PlayerInfo[playerid][cash] = dini_Int(file, "cash");
                PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
            }
        }
        else {
            Kick(playerid);
        }
    }
    if(dialogid == 2) {
        new file[128], name[MAX_PLAYER_NAME], str[128];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(str, sizeof(str), ".../Users/%s.ini", name);
        if(response) {
            if(strlen(inputtext)) {
                if(num_hash(inputtext) != dini_Int(file, "pw")) {
                    SendClientMessage(playerid, RED, "Wrong Password");
                    ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Please Login", "Enter Your Password Below", "Login", "Cancel");
                }
                else {
                    SendClientMessage(playerid, RED, "Succesfuly logged in");
                    PlayerInfo[playerid][level] = dini_Int(file, "level");
                    PlayerInfo[playerid][cash] = dini_Int(file, "cash");
                    GivePlayerMoney(playerid, dini_Int(file, "cash"));
                    PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
                }
            }
        }
        else {
            Kick(playerid);
        }
    }
    return 1;
}
the problem...It dosn't save the location when i relog..
also, i want to make 4 classes and VIP, Helper-moderator-admin-Owner
Plus, Save the stats of the players and make him able to see it..
Reply
#6

Adding VIP is easy.
Just add :-
pawn Код:
enum pInfo {
    AdminLevel,
    level,
    cash,
    pw,
    vip
}
And add vip to every things.
Reply
#7

The Problem for me now, i wanna learn how to check if the player is admin or no when he login, also, how to save the location of the player and respawn at the same location when he spawn, I'll try to learn it from other scripts that have that Feature...
Reply
#8

pawn Код:
if(pInfo[playerid][AdminLevel] == 1) // 1 Here means his level 1 admin, change it to whatever level you want to
{
  ///////////// Script
}
if(pInfo[playerid][AdminLevel] == 0) // It means his not admin
{
  ////////////// Script
}
Reply
#9

Okay, Helped a little, Thank you...
I'll try to learn more from other scripts..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)