Why it isn't working?
#1

pawn Код:
forward WeaponsOnStuntMap();
pawn Код:
public WeaponsOnStuntMap()
{
  for(new i=0; i<MAX_PLAYERS; i++)
  {
    if(IsPlayerConnected(i))
    {
      if(IsPlayerInArea((i), 1874.8333,1599.4434,2254.5999,2629.1636) == 1)
      {
         SetPlayerArmedWeapon((i), 0);
      }
    }
  }
}
pawn Код:
public OnGameModeInit()
{
  SetTimer("WeaponsOnStuntMap", 100, 1);

  return 1;
}
I compile it and al Ok.
But in the game when i enter to the area it just don't work. I can "took my weapons out" even shoot with them
Can someone help me?
Reply
#2

Quote:

public WeaponsOnStuntMap()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInArea((i), 1874.8333,1599.4434,2254.5999,2629.1636) == 1)
{
SetPlayerArmedWeapon((i), 0);
}
}
}
}
Delete the things in bold.
Reply
#3

add
Код:
else 
ResetPlayerWeapons(i);
I suggest to use IsPlayerInRangeOfPoint

Reply
#4

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:

public WeaponsOnStuntMap()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInArea((i), 1874.8333,1599.4434,2254.5999,2629.1636) == 1)
{
SetPlayerArmedWeapon((i), 0);
}
}
}
}
Delete the things in bold.
(1355) : warning 206: redundant test: constant expression is non-zero
line 1355:
pawn Код:
if(IsPlayerInArea(i, 1874.8333,1599.4434,2254.5999,2629.1636))
Quote:
Originally Posted by _Saif_
add
Код:
else 
ResetPlayerWeapons(i);
I suggest to use IsPlayerInRangeOfPoint

didn't undestand

PD: sorry for my bad english.
Reply
#5

please can someone help me ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)