SA-MP Forums Archive
SDPistol Taser - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SDPistol Taser (/showthread.php?tid=269171)



SDPistol Taser - spaty2 - 15.07.2011

I looked for Pistol Taser, but i didn't find it, do you know, where it is or could you post me this FS?


Re: SDPistol Taser - Jochemd - 15.07.2011

Actually it's very easy to make with wups OnPlayerShootPlayer include.


Re: SDPistol Taser - spaty2 - 15.07.2011

It can be easy, but im beginner in this


Re: SDPistol Taser - WoodPecker - 15.07.2011

pawn Code:
OnPlayerCommandText:

if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                new x_job[20];
                x_job = strtok(cmdtext, idx);
                if(!strlen(x_job))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /tazer [get/putup]");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(strcmp(x_job,"get",true) == 0)
                {
                    PlayerHasTazer[playerid] = 1;
                    SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
                    format(string, sizeof(string), "* %s unholsters his tazer.", PlayerName(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(strcmp(x_job,"putup",true) == 0)
                {
                    PlayerHasTazer[playerid] = 0;
                    RemovePlayerAttachedObject(playerid, 0);
                    format(string, sizeof(string), "* %s holsters his tazer back.", PlayerName(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop / FBI / RCSD.");
            }
        }
        return 1;
    }

new PlayerHasTazer[MAX_PLAYERS];    Put it somewhere with the other new functions.
PlayerHasTazer[playerid] = 0;    = OnPlayerConnect.

OnPlayerKeyStateChange:

if ((newkeys & KEY_FIRE))
    {
        if(PlayerHasTazer[playerid] == 1)
        {
            ApplyAnimation(playerid,"KNIFE","knife_3",4.1,0,1,1,0,0,1);
            new victimid = GetClosestPlayer(playerid);
            if(IsPlayerConnected(victimid))
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(GetDistanceBetweenPlayers(playerid,victimid) < 2)
                    {
                        new Float:health;
                        GetPlayerHealth(victimid, health);
                        SetPlayerHealth(victimid, health - 5.0);
                        new string[128];
                        TogglePlayerControllable(i, 0);
                        format(string, sizeof(string), "* You were tazed by %s for 8 seconds.", PlayerName(playerid));
                        SendClientMessage(i, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* You tazed %s for 8 seconds.", PlayerName(i));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* %s shoots with his tazer at %s, and tazed him.", PlayerName(playerid) ,PlayerName(i));
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        PlayerTazed[i] = 1;
                        SetTimerEx("Tazed",8000, false, "i", i);
                        ApplyAnimation(i, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
                        return 1;
                    }
                }
            }
        }
    }
Give me some reputation if this work, Thanks Yo


Re: SDPistol Taser - Jochemd - 15.07.2011

Let me help you then

You got the public function.
Check if the shooter shot with a silenced pistol -> If yes, continue here
Make the victim frozen and send some messages

This is actually all.

Quote:
Originally Posted by WoodPecker
View Post
Give me some reputation if this work, Thanks Yo
For copying out a Godfather script?... LMAO


Re: SDPistol Taser - WoodPecker - 15.07.2011

Quote:
Originally Posted by Jochemd
View Post
For copying out a Godfather script?... LMAO
Well its true that i have a GF script, but i scripted the SDpistol system.


Re: SDPistol Taser - spaty2 - 15.07.2011

Quote:
Originally Posted by WoodPecker
View Post
pawn Code:
OnPlayerCommandText:

if(strcmp(cmd, "/tazer", true) ==0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(IsACop(playerid))
            {
                new x_job[20];
                x_job = strtok(cmdtext, idx);
                if(!strlen(x_job))
                {
                    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /tazer [get/putup]");
                    return 1;
                }
                tmp = strtok(cmdtext, idx);
                if(strcmp(x_job,"get",true) == 0)
                {
                    PlayerHasTazer[playerid] = 1;
                    SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
                    format(string, sizeof(string), "* %s unholsters his tazer.", PlayerName(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
                else if(strcmp(x_job,"putup",true) == 0)
                {
                    PlayerHasTazer[playerid] = 0;
                    RemovePlayerAttachedObject(playerid, 0);
                    format(string, sizeof(string), "* %s holsters his tazer back.", PlayerName(playerid));
                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "   You are not a Cop / FBI / RCSD.");
            }
        }
        return 1;
    }

new PlayerHasTazer[MAX_PLAYERS];    Put it somewhere with the other new functions.
PlayerHasTazer[playerid] = 0;    = OnPlayerConnect.

OnPlayerKeyStateChange:

if ((newkeys & KEY_FIRE))
    {
        if(PlayerHasTazer[playerid] == 1)
        {
            ApplyAnimation(playerid,"KNIFE","knife_3",4.1,0,1,1,0,0,1);
            new victimid = GetClosestPlayer(playerid);
            if(IsPlayerConnected(victimid))
            {
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(GetDistanceBetweenPlayers(playerid,victimid) < 2)
                    {
                        new Float:health;
                        GetPlayerHealth(victimid, health);
                        SetPlayerHealth(victimid, health - 5.0);
                        new string[128];
                        TogglePlayerControllable(i, 0);
                        format(string, sizeof(string), "* You were tazed by %s for 8 seconds.", PlayerName(playerid));
                        SendClientMessage(i, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* You tazed %s for 8 seconds.", PlayerName(i));
                        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                        format(string, sizeof(string), "* %s shoots with his tazer at %s, and tazed him.", PlayerName(playerid) ,PlayerName(i));
                        ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                        PlayerTazed[i] = 1;
                        SetTimerEx("Tazed",8000, false, "i", i);
                        ApplyAnimation(i, "PED","FLOOR_hit_f", 4.0, 1, 0, 0, 0, 0);
                        return 1;
                    }
                }
            }
        }
    }
Give me some reputation if this work, Thanks Yo
Program Pawn complier stoped work


Re: SDPistol Taser - Jochemd - 15.07.2011

You haven't scripted that.


Re: SDPistol Taser - WoodPecker - 15.07.2011

First tell me what script you are using so i can help you, and add this:

RemovePlayerAttachedObject(playerid, 0); at OnPlayerConnect


EDIT: Jochemd i dont care if you dont belive me, just stop trolling here.


Re: SDPistol Taser - spaty2 - 15.07.2011

What?