03.08.2018, 02:35
You have to get the int value of player's admin level before checking for it. Also your code is too unoptimized, so, let me give you fully corrected and optimized code.
PHP код:
if(DOF2_CheckLogin(file,inputtext)) // We check if the password match
{
PlayerInfo[playerid][pAdmin] = DOF2_GetInt(file,"AdminLevel");// the code of getting admin level
switch(PlayerInfo[playerid][pAdmin])
{
case 1: {
SendClientMessage(playerid, -1, "Welcome back{FFFFFF}, you are a {00FFFF}An Admin Level 1{FFFFFF}Player. Language: {E33667}English{FFFFFF}.");
SendClientMessage(playerid, -1, "{A82FED}[To remember you]: {FFFFFF}If you want to check admins commands level 1 just type {A82FED}/level1{FFFFFF}.");
}
case 2: {
SendClientMessage(playerid, -1, "Welcome back{FFFFFF}, you are a {00FFFF}An Admin Level 2{FFFFFF}Player. Language: {E33667}English{FFFFFF}.");
SendClientMessage(playerid, -1, "{A82FED}[To remember you]: {FFFFFF}If you want to check admins commands level 2 just type {A82FED}/level2{FFFFFF}.");
}
case 3: {
SendClientMessage(playerid, -1, "Welcome back{FFFFFF}, you are a {00FFFF}An Admin Level 3{FFFFFF}Player. Language: {E33667}English{FFFFFF}.");
SendClientMessage(playerid, -1, "{A82FED}[To remember you]: {FFFFFF}If you want to check admins commands level 3 just type {A82FED}/level3{FFFFFF}.");
}
case 4: {
SendClientMessage(playerid, -1, "Welcome back{FFFFFF}, you are a {00FFFF}An Admin Level 4{FFFFFF}Player. Language: {E33667}English{FFFFFF}.");
SendClientMessage(playerid, -1, "{A82FED}[To remember you]: {FFFFFF}If you want to check admins commands level 4 just type {A82FED}/level4{FFFFFF}.");
}
case 5: {
SendClientMessage(playerid, -1, "Welcome back{FFFFFF}, you are a {00FFFF}Owner Server {FFFFFF}Player. Language: {E33667}English{FFFFFF}.");
SendClientMessage(playerid, -1, "{A82FED}[To remember you]: {FFFFFF}If you want to check admins commands level 5 just type {A82FED}/level5{FFFFFF}.");
}
default: {
SendClientMessage(playerid, -1, "Welcome back{FFFFFF}, you are a {00FFFF}Registerd {FFFFFF}Player. Language: {E33667}English{FFFFFF}.");
}
}
PlayerPlaySound(playerid,1058, 0.0, 0.0, 0.0); //Start Sound
PlayerInfo[playerid][pKills] = DOF2_GetInt(file,"Kills"); // We load our settings
PlayerInfo[playerid][pDeaths] = DOF2_GetInt(file,"Deaths");
PlayerInfo[playerid][pMoney] = DOF2_GetInt(file,"Money");
PlayerInfo[playerid][pScore] = DOF2_GetInt(file,"Score");
return 1;
}