Tazer -
Rabea - 21.08.2014
i have SD pistol tazer, i edited to object id 18642 and added
Код:
ApplyAnimation(playerid,"KNIFE","knife_3",4.1,0,1,1,0,0,1);
but i can't taze somone if i don't holding a gun with the tazer, i must /tazer and hold an gun.
can anyone help me?
Код:
new playerid, playerb;
if(Tazer[playerid] == 1)
{
if(!IsPlayerTazed(Target) && !IsPlayerCuffed(Target) && !IsPlayerTied(Target))
{
new Float:HP, Float:Armor;
GetPlayerHealth(Target, HP);
GetPlayerArmour(Target, Armor);
SetPlayerHealth(Target, HealthLost+HP);
SetPlayerArmour(Target, ArmourLost+Armor);
if(!IsPlayerNearPlayer(Shooter, Target, 12)) return SendClientMessage(Shooter, COLOR_GREY, "You are too far away from that player.");
//if(IsHoldingFirearm(Target)) return SendClientMessage(Shooter, COLOR_GREY, "You can't taze someone with a gun in hand.");
// Got Tazed
format(string, sizeof(string), "* %s aims their tazer on %s and tazes them.", RPN(Shooter), RPN(Target));
SendNearbyMessage(Shooter, 15, string, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE, COLOR_LIGHTBLUE);
GameTextForPlayer(Target, "~r~Tazed", 3500, 3);
// Custom Freeze
ApplyAnimation(Target,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
TogglePlayerControllable(Target, 0);
// Tazed Detecting
TogglePlayerTazed(Target, 2);
// Tazer Timeout
TazeTimeout[Target] = 11;
TazeCountDown[Target] = SetTimerEx("TazeTimer", 1000, true, "d", Target);
}
}
}
Re: Tazer -
Rabea - 21.08.2014
bump
Re: Tazer -
Rabea - 21.08.2014
Anyone?
Re: Tazer -
Rabea - 22.08.2014
Bump
Re: Tazer -
Ox1gEN - 22.08.2014
That's because you can't shoot with an object, you must use an actual weapon in order to check if a player has taken damage from the shot and then do whatever you're doing here.
I don't think it's possible to do what you've just done here but, Instead when a player types /tazer why don't you give them the gun and place an object on it, bassicly put whatever object you want.
But, you can just use a silenced pistol as a tazer..
Re: Tazer -
Rabea - 22.08.2014
i don't want sd pistol... can you tell me how to shoot with an object?
Re: Tazer -
Rabea - 22.08.2014
Anyone answer me - bump
Re: Tazer -
lulo356 - 22.08.2014
show us your /tazer command
Re: Tazer -
Rabea - 22.08.2014
Here :
Код:
CMD:tazer(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(!IsACop(playerid) && !IsAFBI(playerid) && !IsAGov(playerid) && !IsAHSF(playerid) && !IsAARMY(playerid) && !IsASATF(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an LSPD Oficer/FBI/Government/HSF.");
//if(!PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command while being in a vehicle.");
if(!Tazer[playerid])
{
Tazer[playerid] = 1;
format(string, sizeof(string), "* %s takes out their tazer from their holster and loads it.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
if(PlayerInfo[playerid][pWeapon][2] == 24)
{
ReplaceTazer[playerid] = 1;
GetPlayerWeaponData(playerid, 2, OldGun[playerid], OldAmmo[playerid]);
SendClientMessage(playerid, COLOR_WHITE, "Your desert eagle will be given back when you holster your tazer.");
}
GunsBeingRemoved[playerid] = 1;
RemoveZaiatWeapon(playerid, 24);
GunsBeingRemoved[playerid] = 1;
SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
GunsBeingRemoved[playerid] = 1;
}
else
{
Tazer[playerid] = 0;
RemovePlayerAttachedObject(playerid, 18642);
format(string, sizeof(string), "* %s unloads their tazer and puts it back to their holster.", RPN(playerid));
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
if(ReplaceTazer[playerid])
{
ReplaceTazer[playerid] = 0;
GunsBeingRemoved[playerid] = 1;
GiveZaiatWeapon(playerid, OldGun[playerid], OldAmmo[playerid]);
GunsBeingRemoved[playerid] = 1;
OldGun[playerid] = 0;
OldAmmo[playerid] = 0;
SendClientMessage(playerid, COLOR_WHITE, "You have recieved your desert eagle back as you've holstered your tazer.");
}
}
return 1;
}
Re: Tazer -
Rabea - 22.08.2014
Bump i really need it !!