SA-MP Forums Archive
simple problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: simple problem (/showthread.php?tid=659311)



simple problem - Danielknow - 29.09.2018

how to merge this code?

Код:
public OnPlayerConnect(playerid)
{
    tazerout[playerid] = 0; tazerin[playerid] = 0;
	return 1;
}
with
Код:
public OnPlayerConnect(playerid)
{
	{
	    LoadPlayerAnimLibs(playerid);
		RemoveBuildingForPlayer(playerid, 4239, 1407.9063, -1407.3984, 33.9844, 0.25);
		new playerip[32];
		GetPlayerIp(playerid,playerip,32);
		format(PlayerTemp[playerid][IP], 32, "%s", playerip);

		dini_IntSet(globalstats, "connects", dini_Int(globalstats,"connects")+1);

	    new nome[ MAX_STRING ], nome2[ MAX_STRING ];
		format( nome, sizeof(nome), "14[JOIN] %s[%d] has joined Tokyo Mafia Roleplay. (IP: %s) - Connects: %d | Online: %d",PlayerName(playerid), playerid, playerip, dini_Int(globalstats,"connects"), ConnectedPlayers());
		iEcho( nome );

		format(nome,sizeof(nome),"[JOIN] %s(%d) has joined Tokyo Mafia Roleplay",RPName(playerid),playerid);
		format(nome2,sizeof(nome2),"[JOIN] %s(%d) has joined Tokyo Mafia Roleplay (IP: %s)",RPName(playerid),playerid, playerip);
		PlayerLoop(i)
		{
			if(PlayerTemp[i][jqmessage])
			{
			    if(PlayerInfo[i][power]) SendClientMessage(i,COLOR_LIGHTGREY, nome2);
			    else SendClientMessage(i,COLOR_LIGHTGREY, nome);
			}
		}

		SetTimerEx("ConnectIRC", 200, false, "d", playerid);
		SetTimerEx("WelcomeMessage", 2000, 0, "ii", playerid, 0);

		TextDrawHideForPlayer(playerid, PlayerTemp[playerid][Status]);
		TextDrawHideForPlayer(playerid, PlayerTemp[playerid][LocationTD]);
	    TextDrawHideForPlayer(playerid, TextDraw__News);
	    TextDrawHideForPlayer(playerid, IMtxt);

		return 1;
	}


}



Re: simple problem - Undef1ned - 29.09.2018

I don't understand, exactly what do you want to do?


Re: simple problem - Danielknow - 29.09.2018

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
I don't understand, exactly what do you want to do?
i want put tazer filterscript in my main gamemode

you can see i have 2x times
Код:
public OnPlayerConnect(playerid)



Re: simple problem - Undef1ned - 29.09.2018

Simply copy the code that is in "OnPlayerConnect" of the filterscript, and paste it in "OnPlayerConnect" of your Game Mode.


Re: simple problem - Danielknow - 29.09.2018

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
Simply copy the code that is in "OnPlayerConnect" of the filterscript, and paste it in "OnPlayerConnect" of your Game Mode.
it give me Pawn error (225) Unreachable Code


Re: simple problem - Undef1ned - 29.09.2018

Let's see, it shows all the "OnPlayerConnect" callback of the Filterscript, and the game mode.


Re: simple problem - Danielknow - 29.09.2018

Quote:
Originally Posted by Undef1ned
Посмотреть сообщение
Let's see, it shows all the "OnPlayerConnect" callback of the Filterscript, and the game mode.
Fixed, ty anyway.