public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) { if(GetPlayerWeapon(playerid) == 33 && kickgun[playerid] == 1) { SendClientMessage(damagedid,COLOR_RED, "You have been kicked by The Quake Industries Shotgun for AFK."); Kick(damagedid); } return 1; }
if(strcmp(cmd, "/kickgun", true) ==0) { if(PlayerInfo[playerid][pAdmin] >= 1337) { if(kickgun[playerid] == 0) { if(PlayerInfo[playerid][pKGBullets] != 0) { SafeGivePlayerWeapon(playerid, 33, 10000); SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1000); kickgun[playerid] = 1; format(string, sizeof(string), "* %s Takes out his kickgun.", sendername); ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); } else { SendClientMessage(playerid, COLOR_GREY,"* No charges in the kickgun!"); return 1; } } else { ResetPlayerWeapons(playerid); SafeGivePlayerWeapon(playerid, 24, 10); AttachWeaponCorrectly(playerid, 23); kickgun[playerid] = 0; ClearAnimations(playerid); SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, PlayerInfo[playerid][pSilenSkill]); format(string, sizeof(string), "* %s Puts his kickgun away.", sendername); ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); } } return 1; }
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) |
if(GetPlayerWeapon(playerid) == 33 && kickgun[playerid] == 1) { |
SendClientMessage(damagedid,COLOR_RED, "You have been kicked by The Quake Industries Shotgun for AFK."); |
if(PlayerInfo[playerid][pAdmin] >= 1337) |
if(PlayerInfo[playerid][pKGBullets] != 0) { SafeGivePlayerWeapon(playerid, 33, 10000); |
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5); |
AttachWeaponCorrectly(playerid, 23); |
#include <a_samp>
#include <zcmd>
#define KICK_GUN 38
new bool:HasKickGun[MAX_PLAYERS];
stock TogglePlayerKickGun(playerid, toggle)
{
switch(toggle)
{
case 0:
{
new gun, ammo;
new GunArray[13][2];
for(new i=0; i<13; i++)
{
GetPlayerWeaponData(playerid, i, gun, ammo);
GunArray[i][0] = gun;
GunArray[i][1] = ammo;
}
ResetPlayerWeapons(playerid);
for(new i=0; i<13; i++)
{
if(GunArray[i][0] != KICK_GUN)
{
GivePlayerWeapon(playerid, GunArray[i][0], GunArray[i][0]);
}
}
SendClientMessage(damagedid, 0xFFFFFFFF, ">> KickGun DISABLED");
HasKickGun[playerid] = false;
}
case 1:
{
GivePlayerWeapon(playerid, KICK_GUN, 35525);
SendClientMessage(damagedid, 0xFFFFFFFF, ">> KickGun ENABLED");
HasKickGun[playerid] = true;
}
}
}
public OnPlayerConnect(playerid)
{
HasKickGun[playerid] = false;
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
if(HasKickGun[playerid] && weaponid == KICK_GUN)
{
SendClientMessage(damagedid, 0xFFFFFFFF, ">> You were kicked by the kickgun");
Kick(damagedid);
}
return 1;
}
CMD:KickGun(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
if(HasKickGun[playerid])
{
TogglePlayerKickGun(playerid, 0);
}
else
{
TogglePlayerKickGun(playerid, 1);
}
}
else
{
SendClientMessage(damagedid, 0xFFFFFFFF, ">> No KickGun for you!");
}
return 1;
}
Hello,
I've been asked to post this on here, Other people that can't get the Kickgun working. This is the main script, that kicks "damageid" when you shoot them with the kickgun. Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid) { if(GetPlayerWeapon(playerid) == 33 && kickgun[playerid] == 1) { SendClientMessage(damagedid,COLOR_RED, "You have been kicked by The Quake Industries Shotgun for AFK."); Kick(damagedid); } return 1; } Код:
if(strcmp(cmd, "/kickgun", true) ==0) { if(PlayerInfo[playerid][pAdmin] >= 1337) { if(kickgun[playerid] == 0) { if(PlayerInfo[playerid][pKGBullets] != 0) { SafeGivePlayerWeapon(playerid, 33, 10000); SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 1000); kickgun[playerid] = 1; format(string, sizeof(string), "* %s Takes out his kickgun.", sendername); ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); } else { SendClientMessage(playerid, COLOR_GREY,"* No charges in the kickgun!"); return 1; } } else { ResetPlayerWeapons(playerid); SafeGivePlayerWeapon(playerid, 24, 10); AttachWeaponCorrectly(playerid, 23); kickgun[playerid] = 0; ClearAnimations(playerid); SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL_SILENCED, PlayerInfo[playerid][pSilenSkill]); format(string, sizeof(string), "* %s Puts his kickgun away.", sendername); ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); } } return 1; } |