Tazer = SD Pistol Problem
#1

hi guyz i made a command sd pistol as a tazer but my problem is everybody can use it if they have SD Pistol - ID 23
the tazer works even they are civillian

can anyone help me that it will only work for this teams
pawn Код:
if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA)
pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)

{

                        if(GetPlayerWeapon(Shooter) == 23)

                        {

                new string[17+48], playerid;

                TogglePlayerControllable(Target, true);

                ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,1,1);

                pTazed[Target] = 1;

                tazetimer[Target] = SetTimerEx("Tazed", 10000, 0, "d", Target);

                format(string, sizeof(string), "%s has been tazed by %s.", RemoveUnderScore(Target), RemoveUnderScore(Shooter));

                ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);

                                return 1;

                                }

                return 1;

                }
thanks to those who tried to help me + rep
Reply
#2

Try this:

pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(GetPlayerWeapon(Shooter) == 23 && (gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_ARMY && gTeam[playerid] != TEAM_CIA))
    {
        new string[17+48], playerid;
        TogglePlayerControllable(Target, true);
        ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,1,1);
        pTazed[Target] = 1;
        tazetimer[Target] = SetTimerEx("Tazed", 10000, 0, "d", Target);
        format(string, sizeof(string), "%s has been tazed by %s.", RemoveUnderScore(Target), RemoveUnderScore(Shooter));
        ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
        return 1;
    }
    return 1;
}
Reply
#3

nope not working.

still civilian can use it if they have silenced 9mm pistol

-sleeping ill try to contact with you tommorow with my problem
Reply
#4

Quote:
Originally Posted by pds2012
Посмотреть сообщение
nope not working.

still civilian can use it if they have silenced 9mm pistol

-sleeping ill try to contact with you tommorow with my problem
Oops I screwed up. == not != in the if statement when checking job


Like this

pawn Код:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(GetPlayerWeapon(Shooter) == 23 && (gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA))
    {
        new string[17+48], playerid;
        TogglePlayerControllable(Target, true);
        ApplyAnimation(Target,"CRACK","crckdeth2",4.1,1,1,1,1,1);
        pTazed[Target] = 1;
        tazetimer[Target] = SetTimerEx("Tazed", 10000, 0, "d", Target);
        format(string, sizeof(string), "%s has been tazed by %s.", RemoveUnderScore(Target), RemoveUnderScore(Shooter));
        ProxDetector(30.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
        return 1;
    }
    return 1;
}
Like this
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)