RemoveBuildingForPlayer -
Sinexy - Buck Redford - 25.07.2013
I am VERY new to scripting.
Well, this is pretty simple. When I put them into my script, I can run the server, log into game, but as soon as I am in-game, my character freezes and whole GTA SA freezes and I have to alt-tab and Task Manager close out of it.
My removebuildingforplayer lines are like this:
(Note, I only added 4 into this code below but in fact there is a total of like 783 lines. The ending and beginning are displayed below. Please help.)
Код:
public OnPlayerConnect(playerid)
{
new string[128];
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Welcome back to CHANGEME.\n\nThat name is registered. Please enter your password below.","Login","Quit"); //login
format(string, sizeof(string), ""COL_WHITE"Welcome back to "COL_YELLOW"CHANGEME, "COL_WHITE"%s!", GetPlayerFirstName(playerid));
SendClientMessage(playerid, -1, string);
}
else
{
ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Register","Welcome to CHANGEME.\n\nPlease register your account by typing the password below.","Register","Quit");
format(string, sizeof(string), ""COL_WHITE"Welcome to "COL_YELLOW"CHANGEME, "COL_WHITE"%s!", GetPlayerFirstName(playerid));
SendClientMessage(playerid, -1, string);
}
if(!IsValidName(playerid) && !IsPlayerNPC(playerid) && PlayerInfo[playerid][pAdmin] < 2)
{
format(string, sizeof(string), "AdmCmd: %s has been kicked by NameChecker, reason: Invalid name format.", GetName(playerid));
SendClientMessage(playerid, COLOR_LIGHTRED, "You've been kicked by NameChecker, reason: Invalid name format. (Firstname_Lastname)");
Kick(playerid);
}
SetPlayerInterior(playerid,0);
TogglePlayerSpectating(playerid, 1);
gPlayerLogged[playerid] = 1;
return 1;
RemoveBuildingForPlayer(playerid, 16273, 422.9141, 1513.4141, 10.7188, 0.25);
RemoveBuildingForPlayer(playerid, 16274, 435.0547, 1269.6875, 8.6953, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 672.9922, 1754.1484, 3.4531, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 684.0234, 1740.7969, 5.2500, 0.25);
return 1;
}
Please help?
Re: RemoveBuildingForPlayer -
Scenario - 25.07.2013
Remove the first return 1; line.
By the way, you should of left this in the other topic.
Re: RemoveBuildingForPlayer -
Pottus - 25.07.2013
Maybe you have too many RemoveBuildingForPlayer() it happens, but you can reduce the amount of lines by increasing the range of like objects these lines could probably be just one.
RemoveBuildingForPlayer(playerid, 1308, 672.9922, 1754.1484, 3.4531, 0.25);
RemoveBuildingForPlayer(playerid, 1308, 684.0234, 1740.7969, 5.2500, 0.25);
Re: RemoveBuildingForPlayer -
Sinexy - Buck Redford - 25.07.2013
You are God. Rep'd, Thumbs up, W.e else this forum allows me to do. /bj
YOU ARE GOD. THANK YOU REALCOP