SendClientMessage spamming the chat
#4

Код:
public OnPlayerUpdate(playerid)
{
    new playerTargetActor = GetPlayerTargetActor(playerid);

    if(playerTargetActor != INVALID_ACTOR_ID)
    {
		if(baseactorrobbed >= 1 && robbingstore[playerid] == 0)
		{
		SendClientMessage(playerid, -1, "{1E90FF}[ERROR] {FFFFFF}This store has been robbed recently. Please try again later.");
		return 1;
		}
		return 1;
	}
bad way to script make sure don't use OnPlayerUpdate alot.

Well i suggest you to make Array.
Like
PlaceIsRobbed[How many robbing places u have];

then
When he complete that rob
Set PlaceIsRobbed[PlaceID] = 1;
then
Start SetTimerEx("NotAvailableToRob",5*60*1000,0,'i',Pla ceID);

public NotAvailableToRob(PlaceID)
{
PlaceIsRobbed[PlaceID] = 0; // that will availabe that place to rob again.
}

Also Check if When he enter inside Checkpoint That doesn't =1 if it equal to one that mean it is not available to rob.
Reply


Messages In This Thread
SendClientMessage spamming the chat - by humayunaftabkhan02 - 06.05.2016, 11:40
Re: SendClientMessage spamming the chat - by cdoubleoper - 06.05.2016, 12:22
Re: SendClientMessage spamming the chat - by Dayrion - 06.05.2016, 12:31
Re: SendClientMessage spamming the chat - by MBilal - 06.05.2016, 12:33

Forum Jump:


Users browsing this thread: 1 Guest(s)