SA-MP Forums Archive
Why it isn't working? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Why it isn't working? (/showthread.php?tid=116730)



Why it isn't working? - TheChaoz - 30.12.2009

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?


Re: Why it isn't working? - [HiC]TheKiller - 30.12.2009

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.



Re: Why it isn't working? - Deat_Itself - 30.12.2009

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




Re: Why it isn't working? - TheChaoz - 30.12.2009

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.


Re: Why it isn't working? - TheChaoz - 30.12.2009

please can someone help me ?