IsPlayerInDynamicCP
#1

Yo guys, i have problem when adding IsPlayerInDynamicCP to a command or KEY_WALK on OnPlayerKeyStateChange

Nothing happens as it's supposed that it work as a robbery cp..

Note: when adding it as a normal cp it works (getcheckpointtype) but i want to change to streamer because of futures ..
Thx
Reply
#2

Post code and double check your syntax.
Reply
#3

I think that's what you want.
___

I'm sorry for my bad English.

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_WALK)
{

if(IsPlayerInDynamicCP(playerid, CP_ID)) // CheckPoint
{
// Code
return 1;
}

return 1;
}
return 1;
}
Reply
#4

Try this

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
	if(newkeys & KEY_WALK)
	{
		if(IsPlayerInDynamicCP(playerid, CP_ID)) // CheckPoint
		{
			// Code
		}
	}
	return 1;
}
If this won't work try to debug it, you probably made something wrong on creating the CP
Reply
#5

Still doesn't work, that's my code..

Quote:

if(newkeys & KEY_WALK)
{
if(IsPlayerInDynamicCP(playerid, CP_Calg))
{
if(CalgRobbedRecently >= 1)
{
SendClientMessage(playerid,COLOR_ERROR,"{CACA00}[ERROR]{FFFFFF}The Caligulas casino has been robbed recently!.");
return 1;
}
CalgRobbedRecently =320;
RobbingCalg[playerid] =25;
IncreaseWantedLevel(playerid,4);
IncreasePlayerScore(playerid,1);
format(string,sizeof(string),"~y~ROBBERY IN PROGRESS~n~~b~STAY IN THE CHECKPOINT~n~~w~ROBBERY COMPLETE IN~r~ %d~w~ SECONDS",RobbingCalg[playerid]);
GameTextForPlayer(playerid, string, 3000, 3);

format(string,sizeof(string),"{4169FF}[POLICE RADIO]{FFFFFF} Suspect %s(%d) has begun to rob the Caligulas Casino! Go and arrest the suspect.",PlayerName(playerid),playerid);
SendClientMessageToAllCops(string);

format(string,sizeof(string),"[ROBBERY]{FFFFFF} %s(%d) has begun a robbery at Caligulas casino ..",PlayerName(playerid),playerid);
SendClientMessageToAll(COLOR_ORANGE,string);

format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Caligulas casino ..",PlayerName(playerid),playerid);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
return 1;
}
return 1;
}

Anything wrong?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)