Changing from "i" to "playerid"
#1

So i have those lines and there are putted on player login.
Код HTML:
				    for(new i = 0; i < MAX_PLAYERS; i++)
				    {
				    TextDrawHideForPlayer(i, Textdraw2);
				    TextDrawHideForPlayer(i, Textdraw3);
					InterpolateCameraPos(i, 1698.550170, -1732.532470, 17.280830, 1051.786376, -1731.606079, 21.769128, 10000, 1);
					InterpolateCameraLookAt(i, 1694.554809, -1732.645507, 17.124620, 1047.789062, -1731.675415, 21.897232, 10000, 1);
					}
And my problem is like this:
We have 2 accounts , one logged and spawned and one that is staying at login box.
When he enters the password , the player who is spawned it goes to InterpolateCameraPos , because is using the "i" with Foreach(player, i);
So i want to change from "i" to playerid to avoid the problem.
Thanks.
Reply
#2

don't use Loop, you are using the code under OnPlayerLogin right ?
Just use the playerid for it.
Using loop will force all the players(Connected + Connecting) to InterpolateCameraPos

Quote:

TextDrawHideForPlayer(playerid, Textdraw2);
TextDrawHideForPlayer(playerid, Textdraw3);
InterpolateCameraPos(playerid, 1698.550170, -1732.532470, 17.280830, 1051.786376, -1731.606079, 21.769128, 10000, 1);
InterpolateCameraLookAt(playerid, 1694.554809, -1732.645507, 17.124620, 1047.789062, -1731.675415, 21.897232, 10000, 1);

Reply
#3

I don't have OnPlayerLogin the codes that are added are
Код HTML:
				if(charCounts[0] == 0 || charCounts[0] >= 3)
				{
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_WHITE, "");
					SendClientMessage(extraid, COLOR_GENANNOUNCE, "SERVER: {FFFFFF}Welcome to "SERVER_NAME".");
				    SendClientMessage(extraid, COLOR_GENANNOUNCE, "SERVER: {FFFFFF}You aren't registered yet. Please enter your desired password in the dialog box to register.");
        			for(new i = 0; i < MAX_PLAYERS; i++)
				    {
				    TextDrawHideForPlayer(i, Textdraw2);
				    TextDrawHideForPlayer(i, Textdraw3);
					InterpolateCameraPos(i, 1698.550170, -1732.532470, 17.280830, 1051.786376, -1731.606079, 21.769128, 10000, 1);
					InterpolateCameraLookAt(i, 1694.554809, -1732.645507, 17.124620, 1047.789062, -1731.675415, 21.897232, 10000, 1);
					}
and this is added on public OnQueryFinish(query[], resultid, extraid, connectionHandle) {.
So how can i fix it ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)