SA-MP Forums Archive
SDPistol Tazer - 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 Tazer (/showthread.php?tid=160522)



SDPistol Tazer - Master™ - 17.07.2010

Dont tell me to search for it, Cant find it! I have seen multiple questions asked about this, but not one answered fully!
How do you go about making an SDPistol Tazer?


Re: SDPistol Tazer - Carlton - 17.07.2010

You haven't searched hard enough, I did a quick search and was able to find it.


Re: SDPistol Tazer - Johndaonee - 17.07.2010

Download a role play script, lots of them have one.


Re: SDPistol Tazer - Master™ - 17.07.2010

Quote:
Originally Posted by Johndaonee
Посмотреть сообщение
Download a role play script, lots of them have one.
No, they dont! They have /tazer but not SDTazer


Re: SDPistol Tazer - Johndaonee - 17.07.2010

Trust me I've seen around 3 that has it, I'll post back when I see one


Re: SDPistol Tazer - Venturas - 17.07.2010

Learn how to script. It isn't hard to do.


Re: SDPistol Tazer - Scenario - 17.07.2010

Yes, I have seen something like this as well. Scripting one isn't hard, but depending on your skills it may vary. Have you tried an "Advanced Search"? You can also use ******, it brings up links to the SA:MP forum!


Re: SDPistol Tazer - Joe_ - 17.07.2010

I have one in my mod, I'm not going to release it because it's not public.

It's very simple though, just check if the player clicks LMB, check if he is holding a SDPistol, and check who's in range / who he is aiming at.


Re: SDPistol Tazer - Venturas - 17.07.2010

Quote:
Originally Posted by Joe_
Посмотреть сообщение
I have one in my mod, I'm not going to release it because it's not public.

It's very simple though, just check if the player clicks LMB, check if he is holding a SDPistol, and check who's in range / who he is aiming at.
I have one too and yes it is public. Eric_ released it in his script. LS-RP has it aswell.


Re: SDPistol Tazer - CuervO - 18.07.2010

this is the tazer i am developing for my GM, its untested yet, thats why its not released... Have fun, you do the rest...

pawn Код:
else if ((newkeys & KEY_FIRE))
    {
        if(IsACop(playerid) && GetPlayerWeapon(playerid) == 23)
        {
            new Float:X,Float:Y,Float:Z,Float:pX,Float:pY,Float:pZ;
            GetPlayerPos(playerid, pX,pY,pZ);
            for(new i=0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(IsPlayerInRangeOfPoint(i,10, pX,pY,pZ))
                    {
                        GetPlayerPos(i, X,Y,Z);
                        if(IsPlayerAimingAt(playerid, X,Y,Z,1))
                        {
                            TogglePlayerControllable(i, 0);
                            ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                            SetTimerEx("Unfreezeply",7000,0,"i",i);
                        }
                    }
                }
            }
        }
    }
pawn Код:
forward Unfreezeply(playerid);

public Unfreezeply(playerid)
{
    ClearAnimations(playerid);
    TogglePlayerControllable(playerid, 1);
}

pawn Код:
Float:DistanceCameraTargetToLocation(Float:CamX, Float:CamY, Float:CamZ,  Float:ObjX, Float:ObjY, Float:ObjZ,  Float:FrX, Float:FrY, Float:FrZ)
{

    new Float:TGTDistance;

    // get distance from camera to target
    TGTDistance = floatsqroot((CamX - ObjX) * (CamX - ObjX) + (CamY - ObjY) * (CamY - ObjY) + (CamZ - ObjZ) * (CamZ - ObjZ));

    new Float:tmpX, Float:tmpY, Float:tmpZ;

    tmpX = FrX * TGTDistance + CamX;
    tmpY = FrY * TGTDistance + CamY;
    tmpZ = FrZ * TGTDistance + CamZ;

    return floatsqroot((tmpX - ObjX) * (tmpX - ObjX) + (tmpY - ObjY) * (tmpY - ObjY) + (tmpZ - ObjZ) * (tmpZ - ObjZ));
}

stock IsPlayerAimingAt(playerid, Float:x, Float:y, Float:z, Float:radius)
{
    new Float:cx,Float:cy,Float:cz,Float:fx,Float:fy,Float:fz;
    GetPlayerCameraPos(playerid, cx, cy, cz);
    GetPlayerCameraFrontVector(playerid, fx, fy, fz);
    return (radius >= DistanceCameraTargetToLocation(cx, cy, cz, x, y, z, fx, fy, fz));
}