08.01.2012, 20:31
pawn Код:
//No Topo do GM:
new ArmasDetector[MAX_PLAYERS][14];
new ArmasBallasDetector[MAX_PLAYERS][14];
new bool:Checado[MAX_PLAYERS];
new PlayersOnline;
//No OnGameModeInit:
SetTimer("DetectorMetais", 1000, true);
//OnPlayerConnect:
PlayersOnline++;
//No OnPlayerDisconnect:
PlayersOnline--;
//No Final do GM:
forward DetectorMetais();
public DetectorMetais()
{
for(new x = 0; x <= PlayersOnline; x++)
{
if(IsPlayerInRangeOfPoint(x, 2.0, 100.00, 200.00, 350.00))//Troque essas coordenadas pelas da porta !
{
if(Checado[x])
{
GivePlayerWeapon(x, weaponid, ammo);
Checado[x] = false;
}
if(GetPlayerWeapon(x) > 0)
{
for(new i = 0; i < 13; i++)
{
GetPlayerWeaponData(x, i, ArmasDetector[x][i], ArmasBallasDetector[x][i]);
if(Checado[x])
{
GivePlayerWeapon(x, ArmasDetector[x][i], ArmasBallasDetector[x][i]);
SendClientMessage(x, 0xFFFF00AA, "[INFO] Suas armas foram devolvidas !");
}
else
{
SendClientMessage(x, 0xFFFF00AA, "[INFO] Suas armas foram retiradas pelo detector de metais !");
ResetPlayerWeapons(x);
Checado[x] = true;
}
}
}
}
}
return 1;
}