a problem with tazer -
Rabea - 26.09.2014
Hello,
i have tazer system, its with different way, not slinced pistol its with object 18642.
i have a problem with it, if i have the tazer ( = 1 )and another player shoted me with any weapon i will get tazed, and if i don't have tazer ( = 0 ) they can't taze me, btw i can't taze anyone if i have tazer and if i don't, i hope you can help me, Here is the code :
Код:
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.");
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);
ApplyAnimation(Target,"CRACK","crckdeth2",4.1,0,1,1,1,1,1);
TogglePlayerControllable(Target, 0);
TogglePlayerTazed(Target, 2);
TazeTimeout[Target] = 11;
TazeCountDown[Target] = SetTimerEx("TazeTimer", 1000, true, "d", Target);
}
}
}
Re: a problem with tazer -
ranme15 - 26.09.2014
Can you show me where have you defined the Tazer[playerid] as '1'?
Re: a problem with tazer -
Rabea - 27.09.2014
i don't understand you.. maybe this?
Код:
Tazer[playerid] = 0;
Re: a problem with tazer -
Rabea - 27.09.2014
I have also new Tazer[MAX_PLAYERS] and thats it
Re: a problem with tazer -
EPIC2LA - 27.09.2014
Код:
TogglePlayerControllable(Target, 1);
Re: a problem with tazer -
Rabea - 28.09.2014
no, its not working.
Re: a problem with tazer -
Rabea - 29.09.2014
bump
Re: a problem with tazer -
Josh_Main - 29.09.2014
Try getting rid of
pawn Код:
if(!IsPlayerTazed(Target) && !IsPlayerCuffed(Target) && !IsPlayerTied(Target))
Re: a problem with tazer -
Blast3r - 29.09.2014
Where is this part of code placed at? Is it under OnPlayerTakeDamage? If so I'd suggest you change the Tazer[playerid] to Tazer[issuerid]; at that part of code.
Also would you mind explaining your issue a bit better to me? I don't really understand what happens exactly. If you have the tazer, you'll get tazed if someone else shoots you or?
Re: a problem with tazer -
Rabea - 30.09.2014
Yeah, if i have the tazer, i can't taze anyone, just another player can taze me if i have the tazer