Dynamic Area
#1

Hi all , it's my first time when i want to use IsPlayerInDynamicArea or how / what is .

When 1 player is in GangZone to can't use 1-2-3 commands . What i can use for this ?
Reply
#2

Hi Ph0eniX,

You can do
Код:
new isInZone[MAX_PLAYERS];
On the top of your script. Then add isInZone[playerid] = 0;[/code] to OnPlayerConnect and OnPlayerDisconnect. 0 means He is not in the zone.

Then when you want to do
Код:
CMD: enterzone(playerid, params[]);
{
    isInZone[playerid] = 1; 
    return 1;
}
And
Код:
CMD:leavezone(playerid, params[]);
{
   isInZone[playerid] = 0;
   return 1;
}
Describing this whole thing would be REALLY long, so try mess around with that.

Hope I could help.
Reply
#3

Don't worry mate, I get you.

pawn Код:
//Globals
    new GangWarYo, bool:isInGangWarYoYo[MAX_PLAYERS];
   
    //gamemode_init
    GangWarYo = CreateDynamicSphere(1607.3588,1818.5978,10.8203,15,-1,-1,-1);
    //CreateDynamicSphere returns the assigned ID, so we store it in a var as an int.
   
    public OnPlayerEnterDynamicArea(playerid, areaid)
    {
        if(areaid == GangWarYo)
        {
            isInGangWarYoYo[playerid] = true;
        }
    }
    public OnPlayerLeaveDynamicArea(playerid, areaid)
    {
        if(areaid == GangWarYo)
        {
            isInGangWarYoYo[playerid] = false;
        }
    }
   
    command(example,playerid,params[])
    {
        if(isInGangWarYoYo[playerid]) return SendClientMessage(playerid,0xffffff,"Yo nigga you cant do dis in da turf war yippy yo.");
        //rest of command goes here
        return 1;
    }
Reply
#4

ty , but what include i need ?

error 017: undefined symbol "CreateDynamicSphere"
Reply
#5

Quote:
Originally Posted by Ph0eniX
Посмотреть сообщение
ty , but what include i need ?

error 017: undefined symbol "CreateDynamicSphere"
Use Incognitos Streamer https://sampforum.blast.hk/showthread.php?tid=102865
Reply
#6

Quote:
Originally Posted by Ace155
Посмотреть сообщение
Ty.

I have more 1 problem...when 1 player kill another player ... it don't show textdraw
i have at OnPlayerDeath this...

Код:
if(IsPlayerConnected(killerid) && killerid != INVALID_PLAYER_ID)
	{
	    AccInfo[killerid][Kills]++;
    	//----------------------------------------------------------------------
		//Killing Spree, Best Killing Spree and Others
		//----------------------------------------------------------------------
		if(AccInfo[killerid][KSpree] != AccInfo[killerid][BKSpree])
		{
			AccInfo[killerid][KSpree]++;
			//------------------------------------------------------------------
			PlayerTextDrawHide(killerid, KSpree1[killerid]);
			format(string, 128, "~r~Killing Spree: ~y~%d", AccInfo[killerid][KSpree]);
			PlayerTextDrawSetString(killerid, KSpree1[killerid], string);
			PlayerTextDrawShow(killerid, KSpree1[killerid]);
			PlayerTextDrawHide(killerid, KSpree2[killerid]);
			format(string, 128, "~y~+1 Score, +500 Cash");
			PlayerTextDrawSetString(killerid, KSpree2[killerid], string);
			PlayerTextDrawShow(killerid, KSpree2[killerid]);
            SetTimerEx("HKTXD", 3000, false, "i", killerid);
            //------------------------------------------------------------------
			GivePlayerMoney(killerid, 500);
		}
		else
		{
		   	AccInfo[killerid][KSpree]++; AccInfo[killerid][BKSpree]++;
		   	PlayerTextDrawHide(playerid, KSpree1[killerid]);
			format(string, 128, "~r~Killing Spree: ~y~%d", AccInfo[killerid][KSpree]);
			PlayerTextDrawSetString(killerid, KSpree1[killerid], string);
			PlayerTextDrawShow(killerid, KSpree1[killerid]);
			PlayerTextDrawHide(killerid, KSpree2[killerid]);
			format(string, 128, "~r~Best Killing Spree: ~y~%d", AccInfo[killerid][BKSpree]);
			PlayerTextDrawSetString(killerid, KSpree2[killerid], string);
			PlayerTextDrawShow(killerid, KSpree2[killerid]);
			PlayerTextDrawHide(killerid, KSpree3[killerid]);
			format(string, 128, "~y~+1 Score, +500 Cash");
			PlayerTextDrawSetString(killerid, KSpree3[killerid], string);
			PlayerTextDrawShow(killerid, KSpree3[killerid]);
            SetTimerEx("HKTXD", 3000, false, "i", killerid);
			//------------------------------------------------------------------
			GivePlayerMoney(killerid, 1000);
		}
	}
but , in server show me this

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)