CMD:register crashes the server?
#1

Title explains it. Whenever I go to test my script I need to register (since I don't have an account.) Every time the server console just closes, the process ends, without warning or anything.
Here's the command.
Код:
CMD:register(playerid, params[])
{
	if(PlayerInfo[playerid][pRegistered] == 1 && PlayerInfo[playerid][pLoggedIn] == 1) return SendClientMessage(playerid, COLOR_GREY, "You've already registered!");
	if(PlayerInfo[playerid][pRegistered] == 1 && PlayerInfo[playerid][pLoggedIn] == 0) return SendClientMessage(playerid, COLOR_GREY, "You've already registered! Login with /login [Your Password]");
	if(PlayerInfo[playerid][pRegistered] == 0)
	{
 		if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "Please enter a password.");
 		if(!strlen(params)) return SendClientMessage(playerid, COLOR_GREY, "Try again! /register [Desired Password]");
  		new INI:File = INI_Open(UserPath(playerid));
   		INI_SetTag(File,"data");
   		INI_WriteString(File,"Password", params[22]);
		INI_WriteInt(File,"Cash",0);
		INI_WriteInt(File,"Admin",0);
		INI_WriteInt(File,"Kills",0);
		INI_WriteInt(File,"Deaths",0);
		INI_WriteInt(File,"Skin",0);
		// -76.8952, 1211.4984, 19.7422, 185.254 - Spawn Coords (Use for XYZ&A, respectively.)
		INI_WriteFloat(File,"pLastX",-76.8952);
		INI_WriteFloat(File,"pLastY",1211.4984);
		INI_WriteFloat(File,"pLastZ",19.7422);
		INI_WriteFloat(File,"Angle",185.254);
		INI_WriteInt(File,"W1",0);
		INI_WriteInt(File,"A1",0);
		INI_WriteInt(File,"W2",0);
		INI_WriteInt(File,"A2",0);
		INI_WriteInt(File,"W3",0);
		INI_WriteInt(File,"A3",0);
		INI_WriteInt(File,"W4",0);
		INI_WriteInt(File,"A4",0);
		INI_WriteInt(File,"W5",0);
		INI_WriteInt(File,"A5",0);
		INI_WriteInt(File,"W6",0);
		INI_WriteInt(File,"A6",0);
		INI_WriteInt(File,"W7",0);
		INI_WriteInt(File,"A7",0);
		INI_WriteInt(File,"W8",0);
		INI_WriteInt(File,"A8",0);
		INI_WriteInt(File,"Interior",0);
		INI_WriteInt(File,"V.W.",0);
		INI_WriteFloat(File,"Health",100);
		INI_WriteFloat(File,"Armor",0);
		INI_WriteInt(File,"Car License",0);
		INI_WriteInt(File,"Boat License",0);
		INI_WriteInt(File,"Pilot License",0);
		INI_WriteInt(File,"Muted",0);
		INI_WriteInt(File,"Aduty",0);
		INI_WriteInt(File,"Scanner",0);
		INI_WriteInt(File,"Scanner On/Off",0);
		INI_WriteInt(File,"Walkie Talkie",0);
		INI_WriteInt(File,"Walkie Channel",0);
		INI_WriteString(File,"Faction Name",PlayerInfo[playerid][pFactionName]);
		INI_WriteInt(File,"Warnings",0);
		INI_WriteInt(File,"Logged In",0);
		INI_WriteInt(File,"Phone",0);
		INI_WriteString(File,"Phone Number","None!");
		INI_WriteInt(File,"In Phone Call With",0);
		INI_WriteInt(File,"Phone On/Off",0);
		INI_WriteInt(File,"In Phone Call",0);
		INI_WriteInt(File,"Caller ID Name",0);
		INI_WriteInt(File,"Speed Dial One",0);
		INI_WriteInt(File,"Speed Dial Two",0);
		INI_WriteInt(File,"Speed Dial Three",0);
		INI_WriteInt(File,"Speed Dial Four",0);
		INI_WriteInt(File,"Speed Dial Five",0);
		INI_WriteInt(File,"Speed Dial Six",0);
		INI_WriteInt(File,"Speed Dial Seven",0);
		INI_WriteInt(File,"Speed Dial Eight",0);
		INI_WriteInt(File,"Speed Dial Nine",0);
		INI_WriteBool(File,"On/Off Duty",false);
		INI_WriteInt(File,"Main Faction",0);
		INI_WriteInt(File,"Sub Faction",0);
		INI_WriteInt(File,"House ID",-1); //-1 means they do not own a house
		INI_WriteInt(File, "Vehicle 1",0);
		INI_WriteInt(File, "Vehicle 2",0);
		INI_WriteInt(File, "Vehicle 3",0);
		INI_WriteInt(File, "Vehicle 4",0);
		INI_WriteInt(File, "Bank 1",0);
		INI_WriteInt(File, "Bank 2",0);
		INI_WriteInt(File, "Bank 3",0);
		INI_WriteInt(File, "Bank Code 1",0);
		INI_WriteInt(File, "Bank Code 2",0);
		INI_WriteInt(File, "Bank Code 3",0);
		INI_WriteInt(File, "Pocket 1",0);
		INI_WriteInt(File, "Pocket 2",0);
		INI_WriteInt(File, "Pocket 3",0);
		INI_WriteInt(File, "Pocket 4",0);
		INI_WriteInt(File, "Pocket 5",0);
    	INI_Close(File);
 		SpawnPlayer(playerid);
 		TogglePlayerControllable(playerid, 1);
		SendClientMessage(playerid, COLOR_GREEN, "You have successfully registered! Thanks for joining us and enjoy your stay!");
	}
	return 1;
}
Thanks in advance.
Reply
#2

I suggest you use a new script, I think its the script you are using.
Reply
#3

Quote:
Originally Posted by HodgyOG
Посмотреть сообщение
I suggest you use a new script, I think its the script you are using.
Why/how would that be the case?
The beta release date has already been set and the script so far (even though not finished) has taken several months. I can't do that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)