if(strcmp(cmd, "/ah", true) == 0)
{
if (dini_Int(file, "AdminLevel") >= 1) {
SendClientMessage(playerid, BLUE, "[[ List of admin commands ]]");
SendClientMessage(playerid, COLOR, "[[Level 1 admin: /kick ]]");
SendClientMessage(playerid, COLOR, "[[Level 2 admin: /ban /ip ]]");
SendClientMessage(playerid, COLOR, "[[Level 3 admin: /givegun /setcash /sethealth /setarmour /setscore ]]");
SendClientMessage(playerid, COLOR, "[[Level 4 admin: /noneatm ]]");
SendClientMessage(playerid, COLOR, "[[Level 5 admin: /GMX ]]");
}
else
SendClientMessage(playerid, COLOR, "You our not autherized to use this command.");
}
if(strcmp(cmd, "/login", true) == 0)
{
new PlayerName[24];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /login [password]");
new name[MAX_PLAYER_NAME];
if(IsLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR, "You already are logged in!");
return 1;
}
else
{
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"%s.ini",name);
if(fexist(file))
{
tmp2 = dini_Get(file, "Password");
if(udb_hash(tmp) != strval(tmp2))
{
SendClientMessage(playerid, COLOR, "Login Failed!");
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
printf("%s has failed to login", name);
}
else
{
IsLogged[playerid] = 1;
SetPlayerMoney(playerid, dini_Int(file, "Cash"));
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
SendClientMessage(playerid, COLOR, "[System]: Account Logged into!");
}
}
}
return 1;
}
if(strcmp(cmd, "/ah", true) == 0)
{
if (dini_Int(file, "AdminLevel") >= 1) {
SendClientMessage(playerid, BLUE, "[[ List of admin commands ]]");
SendClientMessage(playerid, COLOR, "[[Level 1 admin: /kick ]]");
SendClientMessage(playerid, COLOR, "[[Level 2 admin: /ban /ip ]]");
SendClientMessage(playerid, COLOR, "[[Level 3 admin: /givegun /setcash /sethealth /setarmour /setscore ]]");
SendClientMessage(playerid, COLOR, "[[Level 4 admin: /noneatm ]]");
SendClientMessage(playerid, COLOR, "[[Level 5 admin: /GMX ]]");
}
else
SendClientMessage(playerid, COLOR, "You our not autherized to use this command.");
return 1;
}
format(file,sizeof(file),"Accounts/%s.ini",name);
.|
Originally Posted by whereschris
One more question though, what is Return 1; and Return 0; used for? Why would a return cause it?
|
if(this == that)
{
print("This will be printed if this == that.");
return 1;
}
print("This will not be printed if this == that.");
return 1;
if(this == that)
{
print("This will be printed if this == that.");
}
print("This will be printed aswell no matter what.");
return 1;
if(this)
{
print("Neither of those below will be printed if this is true.");
return 1;
}
if(this == that)
{
print("This will be printed if this == that.");
return 1;
}
print("This will not be printed if this == that.");
return 1;