Setting a variable for Vips
#1

Hey , i hve a problem , whene a player connect he be Vip , so i must to give a value for Vip[playerid] How & where should i put it ? thanks .
Reply
#2

You probably got something like an enum for the playerinfo, which could look like this, right?

pawn Code:
enum pInfo
{
  VIP
}
To put it into a compare / command / etc., simply format it for the compiler like that:

pawn Code:
PlayerInfo[playerid][VIP]
Reply
#3

If you have a register system with dialogs, then post your OnDialogResponse code. If you don't have a register system, just show your OnPlayerConnect part of your script.
Reply
#4

Actualy , i'm setting it as a variable :
new Vip[MAX_PLAYERS]; and it be saved
So i don't have ANY ENUMS
pawn Code:
public OnPlayerRegister(playerid, Password[])
{
    if(IsPlayerConnected(playerid)) {
        if(strlen(Password) == 0) return ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "{00CCFF}Registration", "{FFFFFF}Please enter password for registration \n\n\n{FF0000}Registration is required", "Register", "");
        dini_Create(file[playerid]);
        dini_Set(file[playerid], "Password", Password);
        IsLogged[playerid] = true;
        SendClientMessage(playerid, COLOR_MODRA, " *You've successfully registered an account !");
    }
    return 1;
}


public OnPlayerLogin(playerid, Password[])
{
    if(IsPlayerConnected(playerid)) {
        if(strlen(Password) == 0) return ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{00CCFF}Login", "{FFFFFF}Please enter password for login \n\n\n{FF0000}Login is required", "Login", "");
        if(strcmp(dini_Get(file[playerid], "Password"), Password, true) == 0) {
            IsLogged[playerid] = true;
            SendClientMessage(playerid, COLOR_YELLOW, "Welcome Back in Swat 5 Server !");
            GivePlayerMoney(playerid, dini_Int(file[playerid], "Money"));
            SetPlayerScore(playerid, dini_Int(file[playerid], "Score"));
            Vip[playerid] = dini_Int(file[playerid], "Vip");
            AdminLevel[playerid] = dini_Int(file[playerid], "Admin");
        }
        else {
            ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_PASSWORD, "{00CCFF}Login", "{FF0000}Incorrect Password{FFFFFF}\nplease try again", "Login", "");
        }
    }
    return 1;
}
pawn Code:
public OnPlayerSaveAcount(playerid)
{
    if(IsPlayerConnected(playerid)) {
        dini_IntSet(file[playerid], "Money", GetPlayerMoney(playerid));
        dini_IntSet(file[playerid], "Score", GetPlayerScore(playerid));
        dini_IntSet(file[playerid], "Vip", Vip[playerid]);
        dini_IntSet(file[playerid], "Admin", AdminLevel[playerid]);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)