PDA

View Full Version : Need help with Offline Prison


Stefand
06/06/2012, 06:42 PM
Hey,

I made a Offline prison command,
But when i enter time e.g. 5 mins, and the player logs in it gives him 0.

can someone look at it?


command(oprison, playerid, params[])
{
new Name[128], string[128], time, Reason[128];
if(sscanf(params, "zdz", Name, time, Reason))
{
if(Player[playerid][AdminLevel] >= 6)
{
SendClientMessage(playerid, WHITE, "SYNTAX: /oprison [name] [time] [reason]");
SendClientMessage(playerid, GREY, "NOTE: This command is CaSe SeNsItIvE.");
}
}
else
{
if(Player[playerid][AdminLevel] >= 6)
{
if(strlen(Name) >= 3 && strlen(Name) < MAX_PLAYER_NAME+1)
{
format(string, sizeof(string), "Accounts/%s.ini", Name);
if(fexist(string))
{
if(dini_Int(string, "AdminLevel") < Player[playerid][AdminLevel])
{
dini_IntSet(string, "PrisonDuration", time);
dini_IntSet(string, "PrisonID", 1);
format(string, sizeof(string), "Prison: %s has been prisoned by %s, reason: %s (%d minutes).", Name, GetName(playerid), Reason, time);
SendClientMessageToAll(RED, string);
format(string, sizeof(string), "%s has offine prisoned %s", GetName(playerid), Name);
SendToAdmins(ADMINORANGE, string, 1);
}
else
{
SendClientMessage(playerid, WHITE, "You can't prison a higher level admins' account.");
}
}
else
{
SendClientMessage(playerid, WHITE, "Account not found.");
}
}
}
}
}

Stefand
06/06/2012, 08:24 PM
Someone?

Stefand
07/06/2012, 10:00 AM
Really nobody that can help?

MadeMan
07/06/2012, 10:32 AM
How do you know it gives 0 on login? Show the code.

Stefand
07/06/2012, 11:00 AM
Look up, I tested this with a friend, he logged in again, and it said Released from prison(and it says that when your time is over) so it sets the time to 0 seconds...

MadeMan
07/06/2012, 11:04 AM
Show the code that loads the time from file and releases the player from jail.

Stefand
07/06/2012, 11:10 AM
if(Player[i][PrisonID] >= 1)
{
if(Player[i][PrisonDuration] >= 1)
{
new string[128];
Player[i][PrisonDuration]--;
format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~ ~R~%d seconds (%d minutes)", Player[i][PrisonDuration], SecondsToMinutes(Player[i][PrisonDuration]));
GameTextForPlayer(i, string, 1000, 3);
}
else
{
if(Player[i][PrisonID] == 1)
{
Player[i][PrisonDuration] = 0;
Player[i][PrisonID] = 0;
SetPlayerPos(i, SpawnX, SpawnY, SpawnZ);
SetPlayerVirtualWorld(i, SpawnWorld);
SetPlayerInterior(i, SpawnInt);
SendClientMessage(i, WHITE, "You have been released from Admin Prison.");
TogglePlayerControllable(i, true);
}
else
{
Player[i][PrisonDuration] = 0;
Player[i][PrisonID] = 0;
SetPlayerPos(i, 1480.5245, -1777.0061, 3281.7954);
SetPlayerVirtualWorld(i, SpawnWorld);
SetPlayerInterior(i, Groups[1][HQInteriorID]);
SendClientMessage(i, WHITE, "You have been released from Jail.");
TogglePlayerControllable(i, true);
}
}
}
}
}
return 1;
}

MadeMan
07/06/2012, 11:13 AM
Show the code that loads the time from file

This one too.

Stefand
07/06/2012, 11:15 AM
Player[i][PrisonDuration]


It loads the Time when he logs in.

MadeMan
07/06/2012, 11:22 AM
Player[i][PrisonDuration]


It loads the Time when he logs in.

If you want somebody to help you, you have to show the code.

Stefand
07/06/2012, 01:10 PM
What freaking code!
With that what i sent it loads.....

MadeMan
07/06/2012, 01:16 PM
What freaking code!
With that what i sent it loads.....

No, it doesn't, it only uses it.

Show the code that logs player in.

Stefand
07/06/2012, 01:47 PM
This is under OnplayerSpawn

if(Player[playerid][Authenticated] == 1)
{
if(Player[playerid][PrisonDuration] >= 1)
{
Player[playerid][InGroupHQ] = 0;
Player[playerid][InBusiness] = 0;
Player[playerid][InHouse] = 0;

if(Player[playerid][PrisonID] == 1)
{
SetPlayerInterior(playerid, Prison1Int);
SetPlayerPos(playerid, Prison1X, Prison1Y, Prison1Z);
SetPlayerVirtualWorld(playerid, Prison1World);
}
else if(Player[playerid][PrisonID] == 2)
{
SetPlayerInterior(playerid, Prison2Int);
SetPlayerPos(playerid, Prison2X, Prison2Y, Prison2Z);
SetPlayerVirtualWorld(playerid, Prison2World);
}
}
else
{

MadeMan
07/06/2012, 01:49 PM
Do you type in a password when you log in?

Stefand
07/06/2012, 02:05 PM
Yes, its a RP server so with login system

MadeMan
07/06/2012, 02:17 PM
Yes, its a RP server so with login system

Can you show the code of login system?

Stefand
07/06/2012, 05:29 PM
if(strlen(inputtext) > 128 || strlen(inputtext) < 1)
{
SetPlayerCameraPos(playerid, 1421.2194, -1724.0134, 30.7422);
SetPlayerCameraLookAt(playerid, 1421.2194, -1724.0134, 30.7422);
new Sum, string[128];
Sum = 3-Player[playerid][LoginAttempts];
SendClientMessage(playerid, ADMINORANGE, "The password you have entered does not match your account. Please try again or use the forums.");
Player[playerid][LoginAttempts]++;
format(string, sizeof(string), "You have %d remaining login attempts, before you are auto-banned.", Sum);
SendClientMessage(playerid, WHITE, string);
ShowPlayerDialog(playerid, 3894, DIALOG_STYLE_PASSWORD, "Authentication", "Welcome back to Volcom Roleplay\n\nYou have an account, please enter your password to authenticate.", "Login", "Help");
}
else
{
if(Player[playerid][Authenticated] == 0)
{
OnPlayerLoginAttempt(playerid, inputtext);
}
else
{
SendClientMessage(playerid, GREY, "You're already authenticated.");
}
}
}

MadeMan
07/06/2012, 05:36 PM
OnPlayerLoginAttempt?

Stefand
07/06/2012, 06:10 PM
public OnPlayerLoginAttempt(playerid, password[])
{
new string[128], Year, Month, Day, Minute, Hour, Second, Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "Accounts/%s.ini", Name);

if(Player[playerid][LoginAttempts] == 3)
{
SendClientMessage(playerid, ADMINORANGE, "You have used your three attempts.");
Kick(playerid);
}

getdate(Year, Month, Day);
gettime(Hour, Minute, Second);

if(fexist(string))
{
if(strcmp(dini_Get(string, "Password"), password, false) == 0)
{
MaxLoggedIn++;
Player[playerid][Authenticated] = 1;
Player[playerid][Password] = dini_Get(string, "Password");
Player[playerid][AdminLevel] = dini_Int(string, "AdminLevel");
Player[playerid][LastX] = dini_Float(string, "LastX");
Player[playerid][LastY] = dini_Float(string, "LastY");
Player[playerid][LastZ] = dini_Float(string, "LastZ");
Player[playerid][LastWorld] = dini_Int(string, "LastWorld");
Player[playerid][LastInterior] = dini_Int(string, "LastInterior");
Player[playerid][LastSkin] = dini_Int(string, "LastSkin");
Player[playerid][LastHealth] = dini_Float(string, "LastHealth");
Player[playerid][LastArmour] = dini_Float(string, "LastArmour");
Player[playerid][LastLoginYear] = dini_Int(string, "LastLoginYear");
Player[playerid][LastLoginMonth] = dini_Int(string, "LastLoginMonth");
Player[playerid][LastLoginDay] = dini_Int(string, "LastLoginDay");
Player[playerid][Group] = dini_Int(string, "Group");
Player[playerid][GroupRank] = dini_Int(string, "GroupRank");
Player[playerid][House] = dini_Int(string, "House");
Player[playerid][Banned] = dini_Int(string, "Banned");
Player[playerid][Muted] = dini_Int(string, "Muted");
Player[playerid][Money] = dini_Int(string, "Money");
Player[playerid][WepSlot1] = dini_Int(string, "WepSlot1");
Player[playerid][WepSlot2] = dini_Int(string, "WepSlot2");
Player[playerid][WepSlot3] = dini_Int(string, "WepSlot3");
Player[playerid][WepSlot4] = dini_Int(string, "WepSlot4");
Player[playerid][WepSlot5] = dini_Int(string, "WepSlot5");
Player[playerid][WepSlot6] = dini_Int(string, "WepSlot6");
Player[playerid][WepSlot7] = dini_Int(string, "WepSlot7");
Player[playerid][WepSlot8] = dini_Int(string, "WepSlot8");
Player[playerid][WepSlot9] = dini_Int(string, "WepSlot9");
Player[playerid][WepSlot10] = dini_Int(string, "WepSlot10");
Player[playerid][WepSlot11] = dini_Int(string, "WepSlot11");
Player[playerid][WepSlot0] = dini_Int(string, "WepSlot0");
Player[playerid][Warning1] = dini_Get(string, "Warning1");
Player[playerid][Warning2] = dini_Get(string, "Warning2");
Player[playerid][Warning3] = dini_Get(string, "Warning3");
Player[playerid][Identity] = dini_Int(string, "Identity");
Player[playerid][Age] = dini_Int(string, "Age");
Player[playerid][ContractPrice] = dini_Int(string, "ContractPrice");
Player[playerid][Contract] = dini_Get(string, "Contract");
Player[playerid][PrisonDuration] = dini_Int(string, "PrisonDuration");
Player[playerid][PrisonID] = dini_Int(string, "PrisonID");
Player[playerid][Tutorial] = dini_Int(string, "Tutorial");
Player[playerid][Hospitalized] = dini_Int(string, "Hospitalized");
Player[playerid][CriminalOffences] = dini_Int(string, "CriminalOffences");
Player[playerid][Offence1] = dini_Get(string, "Offence1");
Player[playerid][Offence2] = dini_Get(string, "Offence2");
Player[playerid][Offence3] = dini_Get(string, "Offence3");
Player[playerid][Offence4] = dini_Get(string, "Offence4");
Player[playerid][Offence5] = dini_Get(string, "Offence5");
Player[playerid][Offence6] = dini_Get(string, "Offence6");
Player[playerid][Gender] = dini_Int(string, "Gender");
Player[playerid][Job] = dini_Int(string, "Job");
Player[playerid][Materials] = dini_Int(string, "Materials");
Player[playerid][AdminActions] = dini_Int(string, "AdminActions");
Player[playerid][SecondsLoggedIn] = dini_Int(string, "SecondsLoggedIn");
Player[playerid][BankMoney] = dini_Int(string, "BankMoney");
Player[playerid][Cocaine] = dini_Int(string, "Crack");
Player[playerid][Pot] = dini_Int(string, "Pot");
Player[playerid][nMuted] = dini_Int(string, "nMuted");
Player[playerid][Business] = dini_Int(string, "Business");
Player[playerid][PhoneN] = dini_Int(string, "PhoneN");
Player[playerid][PlayingHours] = dini_Int(string, "PlayingHours");
Player[playerid][PhoneBook] = dini_Int(string, "PhoneBook");
Player[playerid][InabilityToMatrun] = dini_Int(string, "InabilityToMatrun");
Player[playerid][InabilityToDropCar] = dini_Int(string, "InabilityToDropCar");
Player[playerid][CantFish] = dini_Int(string, "CantFish");
Player[playerid][CollectedFish] = dini_Int(string, "CollectedFish");
Player[playerid][CarX] = dini_Float(string, "CarX");
Player[playerid][CarY] = dini_Float(string, "CarY");
Player[playerid][CarZ] = dini_Float(string, "CarZ");
Player[playerid][PlayerCarModel] = dini_Int(string, "CarModel");
Player[playerid][CarZAngle] = dini_Float(string, "CarZAngle");
Player[playerid][CarCol1] = dini_Int(string, "CarCol1");
Player[playerid][CarCol2] = dini_Int(string, "CarCol2");
Player[playerid][Rope] = dini_Int(string, "Rope");
Player[playerid][Rags] = dini_Int(string, "Rags");
Player[playerid][FailedHits] = dini_Int(string, "FailedHits");
Player[playerid][SuccessfulHits] = dini_Int(string, "SuccessfulHits");
Player[playerid][LockedCar] = dini_Int(string, "CarLock");
Player[playerid][HasRadio] = dini_Int(string, "Radio");
Player[playerid][CollegeMedia] = dini_Int(string, "CollegeMedia");
Player[playerid][CollegeLaw] = dini_Int(string, "CollegeLaw");
Player[playerid][CollegeEng] = dini_Int(string, "CollegeEng");
Player[playerid][CollegeMath] = dini_Int(string, "CollegeMath");
Player[playerid][CollegeChem] = dini_Int(string, "CollegeChem");
Player[playerid][MarriedTo] = dini_Get(string, "MarriedTo");
Player[playerid][FightBox] = dini_Int(string, "FightBox");
Player[playerid][FightKungfu] = dini_Int(string, "FightKungfu");
Player[playerid][FightKneehead] = dini_Int(string, "FightKneehead");
Player[playerid][FightGrabkick] = dini_Int(string, "FightGrabkick");
Player[playerid][FightElbow] = dini_Int(string, "FightElbow");
Player[playerid][VipRank] = dini_Int(string, "VipRank");
Player[playerid][WalkieTalkie] = dini_Int(string, "WalkieTalkie");
Player[playerid][BankStatus] = dini_Int(string, "BankStatus");
Player[playerid][PhoneCredit] = dini_Int(string, "PhoneCredit");
Player[playerid][PlayerSkinSlot1] = dini_Int(string, "PlayerSkinSlot1");
Player[playerid][PlayerSkinSlot2] = dini_Int(string, "PlayerSkinSlot2");
Player[playerid][PlayerSkinSlot3] = dini_Int(string, "PlayerSkinSlot3");
Player[playerid][AdminPIN] = dini_Int(string, "AdminPIN");
Player[playerid][OwnedCarModSlot0] = dini_Int(string, "OwnedCarModSlot0");
Player[playerid][OwnedCarModSlot1] = dini_Int(string, "OwnedCarModSlot1");
Player[playerid][OwnedCarModSlot2] = dini_Int(string, "OwnedCarModSlot2");
Player[playerid][OwnedCarModSlot3] = dini_Int(string, "OwnedCarModSlot3");
Player[playerid][OwnedCarModSlot4] = dini_Int(string, "OwnedCarModSlot4");
Player[playerid][OwnedCarModSlot5] = dini_Int(string, "OwnedCarModSlot5");
Player[playerid][OwnedCarModSlot6] = dini_Int(string, "OwnedCarModSlot6");
Player[playerid][OwnedCarModSlot7] = dini_Int(string, "OwnedCarModSlot7");
Player[playerid][OwnedCarModSlot8] = dini_Int(string, "OwnedCarModSlot8");
Player[playerid][OwnedCarModSlot9] = dini_Int(string, "OwnedCarModSlot9");
Player[playerid][OwnedCarModSlot10] = dini_Int(string, "OwnedCarModSlot10");
Player[playerid][OwnedCarModSlot11] = dini_Int(string, "OwnedCarModSlot11");
Player[playerid][OwnedCarModSlot12] = dini_Int(string, "OwnedCarModSlot12");
Player[playerid][OwnedCarModSlot13] = dini_Int(string, "OwnedCarModSlot13");
Player[playerid][AdminName] = dini_Get(string, "AdminName");
Player[playerid][NormalName] = dini_Get(string, "NormalName");
Player[playerid][AdminSkin] = dini_Int(string, "AdminSkin");
Player[playerid][Accent] = dini_Get(string, "Accent");
Player[playerid][WalkieFrequency] = dini_Int(string, "WalkieFrequency");
Player[playerid][PortableRadio] = dini_Int(string, "PortableRadio");
Player[playerid][Note] = dini_Get(string, "Note");
Player[playerid][CarPaintJobID] = dini_Int(string, "CarPaintJobID");
Player[playerid][MeActions] = dini_Int(string, "MeActions");
Player[playerid][AdsPlaced] = dini_Int(string, "AdsPlaced");
Player[playerid][MatrunsExecuted] = dini_Int(string, "MatrunsExecuted");
Player[playerid][HasMapApp] = dini_Int(string, "HasMapApp");
Player[playerid][HasAdApp] = dini_Int(string, "HasAdApp");
Player[playerid][HasPagesApp] = dini_Int(string, "HasPagesApp");
Player[playerid][HasRadioApp] = dini_Int(string, "HasRadioApp");
Player[playerid][AnsweredQuizQuestions] = dini_Int(string, "AnsweredQuizQuestions");
Player[playerid][AchievementRank] = dini_Int(string, "AchievementRank");
Player[playerid][Moderator] = dini_Int(string, "Moderator");
Player[playerid][oMuted] = dini_Int(string, "oMuted");
Player[playerid][Car2OwnedCarModSlot0] = dini_Int(string, "Car2OwnedCarModSlot0");
Player[playerid][Car2OwnedCarModSlot1] = dini_Int(string, "Car2OwnedCarModSlot1");
Player[playerid][Car2OwnedCarModSlot2] = dini_Int(string, "Car2OwnedCarModSlot2");
Player[playerid][Car2OwnedCarModSlot3] = dini_Int(string, "Car2OwnedCarModSlot3");
Player[playerid][Car2OwnedCarModSlot4] = dini_Int(string, "Car2OwnedCarModSlot4");
Player[playerid][Car2OwnedCarModSlot5] = dini_Int(string, "Car2OwnedCarModSlot5");
Player[playerid][Car2OwnedCarModSlot6] = dini_Int(string, "Car2OwnedCarModSlot6");
Player[playerid][Car2OwnedCarModSlot7] = dini_Int(string, "Car2OwnedCarModSlot7");
Player[playerid][Car2OwnedCarModSlot8] = dini_Int(string, "Car2OwnedCarModSlot8");
Player[playerid][Car2OwnedCarModSlot9] = dini_Int(string, "Car2OwnedCarModSlot9");
Player[playerid][Car2OwnedCarModSlot10] = dini_Int(string, "Car2OwnedCarModSlot10");
Player[playerid][Car2OwnedCarModSlot11] = dini_Int(string, "Car2OwnedCarModSlot11");
Player[playerid][Car2OwnedCarModSlot12] = dini_Int(string, "Car2OwnedCarModSlot12");
Player[playerid][Car2OwnedCarModSlot13] = dini_Int(string, "Car2OwnedCarModSlot13");
Player[playerid][Car3OwnedCarModSlot0] = dini_Int(string, "Car3OwnedCarModSlot0");
Player[playerid][Car3OwnedCarModSlot1] = dini_Int(string, "Car3OwnedCarModSlot1");
Player[playerid][Car3OwnedCarModSlot2] = dini_Int(string, "Car3OwnedCarModSlot2");
Player[playerid][Car3OwnedCarModSlot3] = dini_Int(string, "Car3OwnedCarModSlot3");
Player[playerid][Car3OwnedCarModSlot4] = dini_Int(string, "Car3OwnedCarModSlot4");
Player[playerid][Car3OwnedCarModSlot5] = dini_Int(string, "Car3OwnedCarModSlot5");
Player[playerid][Car3OwnedCarModSlot6] = dini_Int(string, "Car3OwnedCarModSlot6");
Player[playerid][Car3OwnedCarModSlot7] = dini_Int(string, "Car3OwnedCarModSlot7");
Player[playerid][Car3OwnedCarModSlot8] = dini_Int(string, "Car3OwnedCarModSlot8");
Player[playerid][Car3OwnedCarModSlot9] = dini_Int(string, "Car3OwnedCarModSlot9");
Player[playerid][Car3OwnedCarModSlot10] = dini_Int(string, "Car3OwnedCarModSlot10");
Player[playerid][Car3OwnedCarModSlot11] = dini_Int(string, "Car3OwnedCarModSlot11");
Player[playerid][Car3OwnedCarModSlot12] = dini_Int(string, "Car3OwnedCarModSlot12");
Player[playerid][Car3OwnedCarModSlot13] = dini_Int(string, "Car3OwnedCarModSlot13");
Player[playerid][PlayerCarModel3] = dini_Int(string, "PlayerCarModel3");
Player[playerid][PlayerCarModel2] = dini_Int(string, "PlayerCarModel2");
Player[playerid][Car2X] = dini_Float(string, "Car2X");
Player[playerid][Car2Y] = dini_Float(string, "Car2Y");
Player[playerid][Car2Z] = dini_Float(string, "Car2Z");
Player[playerid][Car3X] = dini_Float(string, "Car3X");
Player[playerid][Car3Y] = dini_Float(string, "Car3Y");
Player[playerid][Car3Z] = dini_Float(string, "Car3Z");
Player[playerid][Car2PaintJobID] = dini_Int(string, "Car2PaintJobID");
Player[playerid][Car3PaintJobID] = dini_Int(string, "Car3PaintJobID");
Player[playerid][Car2ZAngle] = dini_Int(string, "Car2ZAngle");
Player[playerid][Car3ZAngle] = dini_Int(string, "Car3ZAngle");
Player[playerid][Car2Col1] = dini_Int(string, "Car2Col1");
Player[playerid][Car2Col2] = dini_Int(string, "Car2Col2");
Player[playerid][Car3Col1] = dini_Int(string, "Car3Col1");
Player[playerid][Car3Col2] = dini_Int(string, "Car3Col2");
Player[playerid][CheckBalance] = dini_Int(string, "CheckBalance");
Player[playerid][LockedCar2] = dini_Int(string, "LockedCar2");
Player[playerid][LockedCar3] = dini_Int(string, "LockedCar3");
Player[playerid][ReportBanStatus] = dini_Int(string, "ReportBanStatus");
Player[playerid][AdminDuty] = dini_Int(string, "AdminDuty");
Player[playerid][DriverLic] = dini_Int(string, "DriverLic");
Player[playerid][ModeratorDuty] = dini_Int(string, "ModeratorDuty");
Player[playerid][WeaponLic] = dini_Int(string, "WeaponLic");
Player[playerid][Helper] = dini_Int(string, "Helper");
Player[playerid][HelperDuty] = dini_Int(string, "HelperDuty");

if(Player[playerid][AdminDuty] == 1)
{
if(strlen(Player[playerid][AdminName]) >= 1 || strcmp(Player[playerid][AdminName], "Nothing", true) == 0)
{
SendClientMessage(playerid, WHITE, "You are now on admin duty. You will appear on the /admins list and you'll be able to view reports.");
Player[playerid][AdminDuty] = 1;

if(Player[playerid][AdminLevel] >= 3)
{
SetPlayerHealth(playerid, 500000);
}

format(Player[playerid][NormalName], 255, "%s", GetName(playerid));

SetPlayerName(playerid, Player[playerid][AdminName]);
SetPlayerSkin(playerid, Player[playerid][AdminSkin]);

if(Player[playerid][HospitalTime] >= 1)
{
Player[playerid][HospitalTime] = 0;
SetCameraBehindPlayer(playerid);
SetPlayerPos(playerid, SpawnX, SpawnY, SpawnZ);
SetPlayerDrunkLevel(playerid, 0);
SendClientMessage(playerid, WHITE, "You have been de-hospitalized.");
}

format(string, sizeof(string), "%s is now on Admin Duty (just authenticated, but logged on duty).", Player[playerid][NormalName]);
SendToAdmins(ADMINORANGE, string, 0);
}
else
{
SendClientMessage(playerid, WHITE, "You haven't set an administrators' name yet.");
}
}

if(strlen(Player[playerid][AdminName]) < 1)
{
format(Player[playerid][AdminName], 128, "Nothing");
}

if(strlen(Player[playerid][NormalName]) < 1)
{
format(Player[playerid][NormalName], 255, "%s", GetName(playerid));
}

if(strfind(Player[playerid][Note], "Nothing", false))
{
if(strlen(Player[playerid][Note]) == 0)
{
format(Player[playerid][Note], 128, "Nothing");
}
else
{
format(string, sizeof(string), "OFFLINE NOTE FROM AN ADMIN: %s", Player[playerid][Note]);
SendClientMessage(playerid, ADMINORANGE, string);

format(Player[playerid][Note], 128, "Nothing");
}
}
else
{
format(Player[playerid][Note], 128, "Nothing");
}

if(strlen(Player[playerid][Password]) < 1)
{
ShowPlayerDialog(playerid, 3666, DIALOG_STYLE_PASSWORD, "Password", "Please change your password.", "Login", "Cancel");
}

if(Player[playerid][GroupRank] >= 1 && Player[playerid][Group] < 1)
{
Player[playerid][GroupRank] = 0;
}

if(Player[playerid][AdminLevel] == -1)
{
SendClientMessage(playerid, WHITE, "You are no longer an administrator.");
Player[playerid][AdminLevel] = 0;
}

if(Player[playerid][Banned] == -1)
{
SendClientMessage(playerid, WHITE, "Unban Successful.");
Player[playerid][Banned] = 0;
}

SpawnOwnedCar(playerid, 1);
SpawnOwnedCar(playerid, 2);
SpawnOwnedCar(playerid, 3);

if(Player[playerid][Banned] == 1 || Player[playerid][Banned] == 2 || Player[playerid][Banned] == 4)
{
new hour, minute, second, day, year, month;
gettime(hour, minute, second);
getdate(year, month, day);
new IP[21];
GetPlayerIp(playerid, IP, sizeof(IP));
format(string, sizeof(string), "%d/%d/%d | %d:%d | %s | %s | CONNECTING ON A BANNED ACCOUNT | System", day, month, year, hour, minute, IP, Name);
BanLog(string);
SendClientMessage(playerid, ANNOUNCEMENT, "You are banned from this server!");
format(string, sizeof(string), "Ban: %s has been auto-banned, defined reason: Attempted Ban Evasion.", Name);
printf("[system] %s has been auto-banned for attempting to login on a banned account.", Name);
Ban(playerid);
SendClientMessageToAll(LIGHTRED, string);
return 1;
}

if(Player[playerid][AdminLevel] >= 1)
{
format(string, sizeof(string), "%s has authenticated (authenticating using their character password).", Name);
SendToAdmins(ADMINORANGE, string, 0);
}

if(strlen(Player[playerid][Accent]) < 1)
{
SendClientMessage(playerid, WHITE, "You currently don't have an accent set, it has been set to 'American' by default (use /accent).");
format(Player[playerid][Accent], 128, "American");
}

if(Player[playerid][Group] >= 1)
{
format(string, sizeof(string), "%s from your group has logged in.", Name);
GroupMessage(playerid, ANNOUNCEMENT, string);

format(string, sizeof(string), "Group MOTD: %s", Groups[Player[playerid][Group]][MOTD]);
SendClientMessage(playerid, ANNOUNCEMENT, string);
}

GivePlayerMoney(playerid, Player[playerid][Money]);

if(Player[playerid][AdminLevel] >= 1)
{
if(Player[playerid][AdminPIN] == 0)
{
TogglePlayerControllable(playerid, false);
SendClientMessage(playerid, WHITE, "You don't have an admin PIN set. Please now set one, it must be numeric only and 6 characters in length.");
ShowPlayerDialog(playerid, 9843, DIALOG_STYLE_INPUT, "Authentication (Admin PIN)", "Please enter your desired PIN.", "Done", "Cancel");
}
else
{
Player[playerid][PINUnauthedTime] = 1;
SendClientMessage(playerid, WHITE, "You have 10 seconds to login before you are auto-kicked.");
TogglePlayerControllable(playerid, false);
ShowPlayerDialog(playerid, 9842, DIALOG_STYLE_INPUT, "Authentication (Admin PIN)", "Please enter your additional admin PIN to continue.", "Login", "Cancel");
}
}

if(Player[playerid][Tutorial] < 1)
{
SetSpawnInfo(playerid, 0, Player[playerid][LastSkin], Player[playerid][LastX], Player[playerid][LastY], Player[playerid][LastZ], 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);

Player[playerid][ResetTimer] = 1;

SetPlayerInterior(playerid, Player[playerid][LastInterior]);
SetPlayerVirtualWorld(playerid, Player[playerid][LastWorld]);

new Flaw = floatround(Player[playerid][LastHealth], floatround_ceil);
SetPlayerHealth(playerid, Flaw);

Flaw = floatround(Player[playerid][LastArmour], floatround_ceil);
SetPlayerArmour(playerid, Flaw);

if(strcmp(Player[playerid][Offence1], "None", true) != 0)
{
SetPlayerWantedLevel(playerid, 1);
}
if(strcmp(Player[playerid][Offence2], "None", true) != 0)
{
SetPlayerWantedLevel(playerid, 2);
}
if(strcmp(Player[playerid][Offence3], "None", true) != 0)
{
SetPlayerWantedLevel(playerid, 3);
}
if(strcmp(Player[playerid][Offence4], "None", true) != 0)
{
SetPlayerWantedLevel(playerid, 4);
}
if(strcmp(Player[playerid][Offence5], "None", true) != 0)
{
SetPlayerWantedLevel(playerid, 5);
}
if(strcmp(Player[playerid][Offence6], "None", true) != 0)
{
SetPlayerWantedLevel(playerid, 6);
}
}
else
{
PutPlayerInTutorial(playerid, 0);
}

if(Day == Player[playerid][LastLoginDay] && Month == Player[playerid][LastLoginMonth] && Year == Player[playerid][LastLoginYear])
{
format(string, sizeof(string), "Welcome back, %s. You last logged in earlier today at %d:%d (-5 GMT).", Name, Player[playerid][LastLoginHour], Player[playerid][LastLoginMinute]);
SendClientMessage(playerid, WHITE, string);
}
else
{
format(string, sizeof(string), "Welcome back, %s. You last logged in on %d/%d/%d at %d:%d (-5 GMT).", Name, Player[playerid][LastLoginDay], Player[playerid][LastLoginMonth], Player[playerid][LastLoginYear], Player[playerid][LastLoginHour], Player[playerid][LastLoginMinute]);
SendClientMessage(playerid, WHITE, string);
}

Player[playerid][LastLoginMinute] = Minute;
Player[playerid][LastLoginHour] = Hour;
Player[playerid][LastLoginDay] = Day;
Player[playerid][LastLoginMonth] = Month;
Player[playerid][LastLoginYear] = Year;

SetPlayerSkin(playerid, Player[playerid][LastSkin]);
}
else
{
SetPlayerCameraPos(playerid, 1421.2194, -1724.0134, 30.7422);
SetPlayerCameraLookAt(playerid, 1421.2194, -1724.0134, 30.7422);
new Sum;
Sum = 3-Player[playerid][LoginAttempts];
SendClientMessage(playerid, ADMINORANGE, "The password you have entered does not match your account. Please try again or use the forums.");
Player[playerid][LoginAttempts]++;
format(string, sizeof(string), "You have %d remaining login attempts, before you are auto-banned.", Sum);
SendClientMessage(playerid, WHITE, string);
ShowPlayerDialog(playerid, 3894, DIALOG_STYLE_PASSWORD, "Authentication", "Welcome back to Volcom Roleplay\n\nYou have an account, please enter your password to authenticate.", "Login", "Help");
if(Player[playerid][LoginAttempts] == 3)
{
SendClientMessage(playerid, ADMINORANGE, "You have used your three attempts.");
Kick(playerid);
}

}
}
else
{
SendClientMessage(playerid, WHITE, "You must register first.");
}
return 1;
}

Stefand
09/06/2012, 07:57 AM
MadeMan can you continue helping me ;D

MadeMan
09/06/2012, 08:05 AM
No, I don't know the problem.