17.03.2011, 06:15
Before i said anything... i post a code first!
at those cmds... the dini_Int thingy to get the player lvl doesnt work..
any solution?
pawn Код:
YCMD:login(playerid, params[], help) {
if(help) {
new
str[MAX_STRINGS];
format(str, sizeof(str), "YCMD: This Command Allowed Player To Loging In In Specify Account");
SendClientMessage(playerid, COLOR_ORANGE, str);
}
else {
if(isnull(params)) {
if(_Player_Logged[playerid] >= 1) {
SendClientMessage(playerid, COLOR_RED, "ERROR: You Are Already Logged In");
}
else {
new
str2[MAX_STRINGS];
format(str2, sizeof(str2), "USAGE: /%s [password]", Command_GetDisplayNamed("login", playerid));
SendClientMessage(playerid, COLOR_ORANGE, str2);
}
}
else {
new
pName[MAX_NAMES],
filepath[MAX_STRINGS];
GetPlayerName(playerid, pName, sizeof(pName));
format(filepath, sizeof(filepath), "\\SMAdmin\\Users\\%s.ini", pName);
new
RPass = dini_Int(filepath, "Password");
if(INI_Hash(params) != RPass) {
_Player_Logged[playerid] = 1;
Account[playerid][Level] = dini_Int(filepath, "Level");
GivePlayerMoney(playerid, dini_Int(filepath, "Money"));
SetPlayerScore(playerid, dini_Int(filepath, "Score"));
if(Account[playerid][Level] >= 1) {
new
str3[MAX_STRINGS];
format(str3, sizeof(str3), "Account: Welcome Administrator %s", pName);
SendClientMessage(playerid, COLOR_LIGHTGREEN, str3);
}
else {
new
str4[MAX_STRINGS];
format(str4, sizeof(str4), "Account: You have successfully logged in");
SendClientMessage(playerid, COLOR_LIGHTGREEN, str4);
}
}
else {
new
str5[MAX_STRINGS];
format(str5, sizeof(str5), "ERROR: You enter a wrong password");
SendClientMessage(playerid, COLOR_RED, str5);
}
}
}
return 1;
}
pawn Код:
Account[playerid][Level] = dini_Int(filepath, "Level");