OnPlayerEnterDynamicCp
#1

Hi, I wanted to test the callback OnPlayerEnterDynamicCp, but when I enter in the checkpoint, nothing happen..

Here's my code :



Top of the script :

Код:
new ordi1;
new ordi2;
new ordi3;
new ordi4;
OnGameModeInit() :

Код:
ordi1 = CreateDynamicCP(337.4386,197.7973,1014.7152, -1, -1, -1, -1, 100);
Then the callback OnPlayerEnterDynamicCheckpoint(playerid, streamid) :

Код:
public OnPlayerEnterDynamicCheckpoint(playerid, streamid)
{

	if(IsPlayerInDynamicCP(playerid, ordi1) && gTeam[playerid] == NINJA)
	{
		DestroyDynamicCP(ordi1);
		
		ordi2 = CreateDynamicCP(356.4801,162.1948,1019.9844,10,-1,-1,-1,100.0);
	}

	else if(IsPlayerInDynamicCP(playerid, ordi2) && gTeam[playerid] == NINJA)
	{
		DestroyDynamicCP(ordi2);
		ordi2 = CreateDynamicCP(364.1272,152.5401,1025.7964,10,-1,-1,-1,100.0);

	}

	else if(IsPlayerInDynamicCP(playerid, ordi3) && gTeam[playerid] == NINJA)
	{
		DestroyDynamicCP(ordi3);
		ordi4 = CreateDynamicCP(353.6466,171.4531,1025.7964,10,-1,-1,-1,100.0);

	}

	else if(IsPlayerInDynamicCP(playerid, ordi4) && gTeam[playerid] == NINJA)
	{
		GameTextForAll("~r~WOW !",1000,5);

	}

}
Reply
#2

Help plz
Reply
#3

Are you using old version of streamer? Because it should be like this:

Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
	if(checkpointid == ordi1)
	{
		//
	}
	if(checkpointid == ordi2)
	{
		//
	}
	return 1;
}
etc
Reply
#4

I think I have the latest version of streamer.inc. I mean the one included in 0.3x folder.

I also tried :

Код:
public OnPlayerEnterDynamicCheckpoint(playerid, streamid)
{
if(streamid == ordi1 && gTeam[playerid] == NINJA)
	{

		DestroyDynamicCP(ordi1);
		printf("blublublu");
		ordi2 = CreateDynamicCP(356.4801,162.1948,1019.9844,10,-1,-1,-1,100.0);
	}

	else if(streamid == ordi2 && gTeam[playerid] == NINJA)
	{
		DestroyDynamicCP(ordi2);
		ordi2 = CreateDynamicCP(364.1272,152.5401,1025.7964,10,-1,-1,-1,100.0);

	}

	else if(streamid == ordi3 && gTeam[playerid] == NINJA)
	{
		DestroyDynamicCP(ordi3);
		ordi4 = CreateDynamicCP(353.6466,171.4531,1025.7964,10,-1,-1,-1,100.0);

	}

	else if(streamid == ordi4 && gTeam[playerid] == NINJA)
	{
		GameTextForAll("~r~WOOHOO !",1000,5);

	}
}
But that doesn't work... And I tried to put checkpointid in the 2nd parameter of "OnPlayerEnterDynamicCheckPoint", but I got a warning.
Btw, thx for helping !
Reply
#5

I'm stupid, the callback was : OnPlayerEnterDynamicCP..

That's because I copied it thx to ******.. Btw thx you were right
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)