SA-MP Forums Archive
Tazer pistol - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Tazer pistol (/showthread.php?tid=346262)



Tazer pistol - Edin Black - 27.05.2012

Can anyone make me a command, when a police member has a "Pistol" in his hand he can tazer players, when he have wanted level.


Here my tazer command:

pawn Code:
if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete koristiti ovu Komandu - jer je Osoba u Autu.");
                    return 1;
                }
                new suspect = GetClosestPlayer(playerid);
                if(IsPlayerConnected(suspect))
                {
                    if(PlayerCuffed[suspect] == 2)
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba vec ima lisice na sebi.");
                        return 1;
                    }
                    if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
                    {
                        if(PlayerInfo[suspect][pMember] == 1)
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete sokirati svog Kolegu - prijavi te ga Lideru na PM, ako Problema ima.");
                            return 1;
                        }
                        if(IsPlayerInAnyVehicle(suspect))
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba je u vozilu - izbacite ju iz vozila.");
                            return 1;
                        }
                        GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                        GetPlayerName(playerid, sendername, sizeof(sendername));
                        format(string, sizeof(string), "* %s vadi palicu te sokira %s.", sendername ,giveplayer);
                        ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        GameTextForPlayer(suspect, "~r~Taziran si.", 2500, 3);
                        TogglePlayerControllable(suspect, 0);
                        PlayerCuffed[suspect] = 1;
                        PlayerCuffedTime[suspect] = 10;
                    }
                    else
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrani igrac nije u vasoj blizini.");
                        return 1;
                    }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste autorizirani za koristenje ove komande - samo policija.");
            }
        }//not connected
        return 1;
    }



Re: Tazer pistol - Edin Black - 27.05.2012

helkp please


Re: Tazer pistol - Faisal_khan - 28.05.2012

Don't bump!
:
pawn Code:
public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
    if(gTeam[Shooter] == TEAM_COPS)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
            {
                if(IsPlayerInAnyVehicle(playerid))
                {
                    SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete koristiti ovu Komandu - jer je Osoba u Autu.");
                    return 1;
                }
                new suspect = GetClosestPlayer(playerid);
                if(IsPlayerConnected(suspect))
                {
                    if(PlayerCuffed[suspect] == 2)
                    {
                        SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba vec ima lisice na sebi.");
                        return 1;
                    }
                        if(GetPlayerWantedLevel(suspect) >= 1)
                        {
                            if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
                            {
                                if(PlayerInfo[suspect][pMember] == 1)
                                {
                                    SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete sokirati svog Kolegu - prijavi te ga Lideru na PM, ako Problema ima.");
                                    return 1;
                                }
                                if(IsPlayerInAnyVehicle(suspect))
                                {
                                    SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba je u vozilu - izbacite ju iz vozila.");
                                    return 1;
                                }
                                GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
                                GetPlayerName(playerid, sendername, sizeof(sendername));
                                format(string, sizeof(string), "* %s vadi palicu te sokira %s.", sendername ,giveplayer);
                                ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                                GameTextForPlayer(suspect, "~r~Taziran si.", 2500, 3);
                                TogglePlayerControllable(suspect, 0);
                                PlayerCuffed[suspect] = 1;
                                PlayerCuffedTime[suspect] = 10;
                            }
                            else
                            {
                                SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrani igrac nije u vasoj blizini.");
                                return 1;
                            }
                        }
                        else
                        {
                            SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR:You cant taze him coz he his not wanted");
                        }
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste autorizirani za koristenje ove komande - samo policija.");
            }
        }//not connected
    }
    return 1;
}
I have used without commands. Download this include and add it in your GM.
https://sampforum.blast.hk/showthread.php?tid=195439


Re: Tazer pistol - Edin Black - 28.05.2012

Who I give the pawn script ?

Under what ?


Re: Tazer pistol - Edin Black - 03.06.2012

Up..


Re: Tazer pistol - Cameltoe - 03.06.2012

Quote:
Originally Posted by Edin Black
View Post
Up..
You should rather ask for help in your language section, i can barely understand what you are trying to say or ask for help about.


Re: Tazer pistol - Edin Black - 03.06.2012

Who i put this command ?

Quote:

public OnPlayerShootPlayer(Shooter,Target,Float:HealthLos t,Float:ArmourLost)
{
if(gTeam[Shooter] == TEAM_COPS)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 1||PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete koristiti ovu Komandu - jer je Osoba u Autu.");
return 1;
}
new suspect = GetClosestPlayer(playerid);
if(IsPlayerConnected(suspect))
{
if(PlayerCuffed[suspect] == 2)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba vec ima lisice na sebi.");
return 1;
}
if(GetPlayerWantedLevel(suspect) >= 1)
{
if(GetDistanceBetweenPlayers(playerid,suspect) < 5)
{
if(PlayerInfo[suspect][pMember] == 1)
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Nemozete sokirati svog Kolegu - prijavi te ga Lideru na PM, ako Problema ima.");
return 1;
}
if(IsPlayerInAnyVehicle(suspect))
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrana osoba je u vozilu - izbacite ju iz vozila.");
return 1;
}
GetPlayerName(suspect, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "* %s vadi palicu te sokira %s.", sendername ,giveplayer);
ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
GameTextForPlayer(suspect, "~r~Taziran si.", 2500, 3);
TogglePlayerControllable(suspect, 0);
PlayerCuffed[suspect] = 1;
PlayerCuffedTime[suspect] = 10;
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Odabrani igrac nije u vasoj blizini.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR:You cant taze him coz he his not wanted");
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: Niste autorizirani za koristenje ove komande - samo policija.");
}
}//not connected
}
return 1;
}




Re: Tazer pistol - Faisal_khan - 04.06.2012

Quote:
Originally Posted by Edin Black
View Post
Who i put this command ?
That is not a command it is a callback. Paste it at the end of your script or anywhere else. (BUT NOT IN A CALLBACK).