Jump to content
  • 0

pomoc IsPlayerInArea HELP


RBoy

Dotaz

Zdravím.

Potreboval by som pomoc pri tomto skripte:

- Nevypísalo mi to žiadne chyby, ale keď v hre vojdem do tej zóny, tak sa nič nestane...

 

forward

forward isPlayerInArea();

 

settimer

SetTimer("isPlayerInArea", 1000, 1);

 

ongamemodeinit

public OnGameModeInit()
{
zona = GangZoneCreate(-3433.295, 1996.917, -2125.373, 3503.363);
return 1;
}

 

onplayerspawn

public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, zone, 0x80FF0096);
return 0;
}

 

isplayerinarea

public isPlayerInArea()
{
 new Float:X, Float:Y, Float:Z;
 for(new i=0; i < MAX_PLAYERS; i++)
 {
	 GetPlayerPos(i, X, Y, Z);
	 if (X <= -3433.295 && X >= 1996.917 && Y <= -2125.373 && Y >= 3503.363)
	 {
		 SetPlayerHealth(i, 100);
            SendClientMessage(i, TEXT);
	 }
 }
}

 

Ďakujem

Link to comment
Share on other sites

3 odpovědí na tuto otázku

Recommended Posts

  • 0

Myslim ze mas zrejme chybu v souradncich, over si:

public isPlayerInArea()
{
        new Float:X, Float:Y, Float:Z;
        for(new i=0; i < MAX_PLAYERS; i++)
        {
                GetPlayerPos(i, X, Y, Z);
                new s[128];
                format(s,128,"%.f <= -3433.295 && %.f >= 1996.917 && %.f <= -2125.373 && %.f >= 3503.363",X,X,Y,Y);
                SendClientMessage(i,-1,s);
                if (X <= -3433.295 && X >= 1996.917 && Y <= -2125.373 && Y >= 3503.363)
                {
                        SetPlayerHealth(i, 100);
                        SendClientMessage(i, TEXT);
                }
        }
}

Link to comment
Share on other sites

  • 0

Tuto funkci musíš používat se správnými souřadnicemi, které vyhovují podmínkám ve stocku. Například nejdříve musíš ukládat pozici severovýchod a následně jihozápad, podle toho, jaké podmínky souřadnic máš v té funkci.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...