05.03.2012, 13:11
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 .
enum pInfo
{
VIP
}
PlayerInfo[playerid][VIP]
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;
}
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;
}