04.04.2014, 10:50
@Gaurav_Rawat - not the best way to do that, that will lag for sure! OnPlayerUpdate gets called every 300 ms, All I could suggest is create a Dynamic Area using streamer, example code below.
pawn Код:
new AmmoBoxArea = CreateDynamicCircle(X,Y, 4.0); //grab the X & Y position of the box and paste it in here.
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(AmmoBoxArea == areaid)
{
if(team[playerid] == A)
{
GivePlayerWeapon(playerid,23,60);
GivePlayerWeapon(playerid,29,30);
GivePlayerWeapon(playerid,33,30);
GivePlayerWeapon(playerid,25,20);
DestroyObject(AmmoBox);
}
}
return true;
}
