01.09.2013, 17:06
hello pooples i'm searching no minigun script to get a miniguns disarm a player (no ban)
public OnPlayerDeath(playerid, killerid, reason)
{
if(GetPlayerWeapon(killerid) == 38) ResetPlayerWeapons(killerid); // Disarm if they have a minigun
return 1;
}
public OnPlayerUpdate(playerid)
{
if(GetPlayerWeapon(playerid) == 38) ResetPlayerWeapons(playerid);
return 1;
}
stock RemovePlayerWeapon(playerid, weaponid)
{
new WeaponData[13][2];
for(new i = 0; i < 13; i++) GetPlayerWeaponData(playerid, i, WeaponData[i][0], WeaponData[i][1]);
ResetPlayerWeapons(playerid);
for(new i = 0; i < 13; i++)
{
if(WeaponData[i][0] != 0 && WeaponData[i][0] != weaponid)
{
GivePlayerWeapon(playerid, WeaponData[i][0], WeaponData[i][1]);
}
}
return 0;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(newkeys & KEY_FIRE)
{
static weapon;
weapon = GetPlayerWeapon(playerid);
if(weapon == 38) RemovePlayerWeapon(playerid, 38);
}
return 1;
}
public OnPlayerUpdate(playerid) { if(GetPlayerWeapon(playerid) == 38) ResetPlayerWeapons(playerid); return 1; }