how to do this help :)
#1

hello all i want to make any GangZone for army i need to make like when someone who dont have an army skin get killed what mean the player get kill when he enter army zone with out have an army skin
Reply
#2

follow this tutorial
https://sampwiki.blast.hk/wiki/Areacheck
Reply
#3

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
      if(GetPlayerSkin(playerid) == ARMYSKIN) {
         //do whatever here
      }
}
Reply
#4

ok i folow this tut now here is my zone croods

armyzone = GangZoneCreate(914.946960, 2570.812500, 1106.947021, 2730.812500);

how i can put them in here need help

if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37)
Reply
#5

pawn Код:
if (X <= -914 && X >= 2570 && Y <= 1106 && Y >= 2730)
Should work
Reply
#6

i put in first

forward IsPlayerInArmyZone()

but dont put the SetTimer("IsPlayerInArmyZone",1000,1);

Код:
public isPlayerInArmyZone()
{

new Float:X, Float:Y, Float:Z; //We use this to store player position
for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
{
if(gTeam[i] != TEAM_ARMY)
{

	GetPlayerPos(i, X, Y, Z);
	if (X <= -914 && X >= 2570 && Y <= 1106 && Y >= 2730)
	SetPlayerPos(i, X+10,Y+10,Z);
return 1;
}
}
return 1;
}
Reply
#7

try this:
pawn Код:
public isPlayerInArmyZone()
{
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
        if(gTeam[i] != TEAM_ARMY)
        {
            GetPlayerPos(i, X, Y, Z);
            if (X <= -914 && X >= 2570 && Y <= 1106 && Y >= 2730)
            {
                SetPlayerPos(i, 2760,1106,Z);
            }
            return 1;
        }
    }
    return 1;
}
Reply
#8

i do like this and

forward isPlayerInArmyZone();

and

SetTimer("isPlayerInArmyZone",1000,1);



Код:
public isPlayerInArmyZone()
{
	new Float:X, Float:Y, Float:Z; //We use this to store player position
	for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
	{
		if(gTeam[i] != TEAM_ARMY)
		{
			GetPlayerPos(i, X, Y, Z);
			if (X <= -914 && X >= 2570 && Y <= 1106 && Y >= 2730)
			{
				SetPlayerPos(i, 2760,1106,Z);
			}
			return 1;        '
		}
	}
	return 1;
}


But Still Not Work Help Me
Reply
#9

Where do you set the timer?
Reply
#10

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
try this:
pawn Код:
public isPlayerInArmyZone()
{
    new Float:X, Float:Y, Float:Z; //We use this to store player position
    for(new i=0; i < MAX_PLAYERS; i++) //This line defines a name for all player, the name is "i"
    {
        if(gTeam[i] != TEAM_ARMY)
        {
            GetPlayerPos(i, X, Y, Z);
            if (X <= -914 && X >= 2570 && Y <= 1106 && Y >= 2730)
            {
                SetPlayerHealth(i,0);
                                SendClientMessage(i,0xFF0000AA,"Your are not allowed to be in this area");
            }
           
        }
    }
    return 1;
}
You see the change above in the script

Edit: did you forward the public ?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)