SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 20/05/2014, 03:58 PM   #1
JFF
Big Clucker
 
Join Date: May 2014
Posts: 110
Reputation: 17
Default Selfie Filterscript

Hello,

I was bored so i decided to create a selfie filterscript.

its a really simple filterscript that doesnt require any skills at all but its kinda fun.

Whats New:
~Now you can move in circle with the camera.
~Added /td to show/hide the textdraws.
~Fixed the clearanimations after you stop taking the selfie.

ScreenShots:

V0.1 ScreenShots:





V0.2 ScreenShots





Download:

V0.1

V0.2
pawn Code:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
   
new takingselfie[MAX_PLAYERS];
new Float:Degree[MAX_PLAYERS];
const Float: Radius = 1.4; //do not edit this
const Float: Speed  = 1.25; //do not edit this
const Float: Height = 1.0; // do not edit this
new Text:Textdraw2;
new Float:lX[MAX_PLAYERS];
new Float:lY[MAX_PLAYERS];
new Float:lZ[MAX_PLAYERS];
new hiden[MAX_PLAYERS];

#define COLOR_WHITE 0xFFFFFFAA
#define COLOR_RED 0xFF0000AA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Selfie FilterScript By: JFF");
    print("--------------------------------------\n");
    for(new i =0; i<MAX_PLAYERS;i++)
        takingselfie[i] = 0;
    Textdraw2 = TextDrawCreate(227.000000, 10.000000, "~r~Press F8 to take a selfie.~n~~n~~y~Num 6/Num 4 to move the camera.~n~~n~~p~/td to hide/show the textdraws.~n~~n~~g~/selfie to stop taking selfies.~n~~n~~w~/headmove to disable the head movement.");
    TextDrawBackgroundColor(Textdraw2, 255);
    TextDrawFont(Textdraw2, 1);
    TextDrawLetterSize(Textdraw2, 0.500000, 1.300000);
    TextDrawColor(Textdraw2, -16776961);
    TextDrawSetOutline(Textdraw2, 0);
    TextDrawSetProportional(Textdraw2, 1);
    TextDrawSetShadow(Textdraw2, 1);
    TextDrawSetSelectable(Textdraw2, 0);
    return 1;
}

public OnFilterScriptExit()
{
    for(new i =0; i<MAX_PLAYERS;i++)
        takingselfie[i] = 0;
    return 1;
}

#else

main()
{
    print("\n--------------------------------------");
    print(" Selfie FilterScript By: JFF");
    print("--------------------------------------\n");
}

#endif

public OnPlayerConnect(playerid)
{
    takingselfie[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    takingselfie[playerid] = 0;
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(takingselfie[playerid] == 1)
    {
        if(PRESSED(KEY_ANALOG_RIGHT))
        {
            GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
            static Float: n1X, Float: n1Y;
            if(Degree[playerid] >= 360) Degree[playerid] = 0;
            Degree[playerid] += Speed;
            n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
            n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
            SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
            SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
            SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
        }
        if(PRESSED(KEY_ANALOG_LEFT))
        {
            GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
            static Float: n1X, Float: n1Y;
            if(Degree[playerid] >= 360) Degree[playerid] = 0;
            Degree[playerid] -= Speed;
            n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
            n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
            SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
            SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
            SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
        }
    }
    return 1;
}

CMD:selfie(playerid,params[])
{
    if(takingselfie[playerid] == 0)
    {
        GetPlayerPos(playerid,lX[playerid],lY[playerid],lZ[playerid]);
        static Float: n1X, Float: n1Y;
        if(Degree[playerid] >= 360) Degree[playerid] = 0;
        Degree[playerid] += Speed;
        n1X = lX[playerid] + Radius * floatcos(Degree[playerid], degrees);
        n1Y = lY[playerid] + Radius * floatsin(Degree[playerid], degrees);
        SetPlayerCameraPos(playerid, n1X, n1Y, lZ[playerid] + Height);
        SetPlayerCameraLookAt(playerid, lX[playerid], lY[playerid], lZ[playerid]+1);
        SetPlayerFacingAngle(playerid, Degree[playerid] - 90.0);
        takingselfie[playerid] = 1;
        ApplyAnimation(playerid, "PED", "gang_gunstand", 4.1, 1, 1, 1, 1, 1, 1);
        TextDrawShowForPlayer(playerid,Textdraw2);
        return 1;
    }
    if(takingselfie[playerid] == 1)
    {
        TogglePlayerControllable(playerid,1);
        SetCameraBehindPlayer(playerid);
        TextDrawHideForPlayer(playerid,Textdraw2);
        takingselfie[playerid] = 0;
        ApplyAnimation(playerid, "PED", "ATM", 4.1, 0, 1, 1, 0, 1, 1);
        return 1;
    }
    return 1;
}

CMD:td(playerid,params[])
{
    if(takingselfie[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: This command works only while taking a selfie");
    if(hiden[playerid] == 0)
    {
        TextDrawHideForPlayer(playerid,Textdraw2);
        hiden[playerid] = 1;
        return 1;
    }
    if(hiden[playerid] == 1)
    {
        TextDrawShowForPlayer(playerid,Textdraw2);
        hiden[playerid] = 0;
        return 1;
    }
    return 1;
}

Enjoy and please don`t remove credits

Last edited by JFF; 21/03/2015 at 06:41 PM.
JFF is offline   Reply With Quote
Old 20/05/2014, 04:00 PM   #2
superrobot48
Big Clucker
 
Join Date: Apr 2013
Location: Las Venturas
Posts: 182
Reputation: 21
Default Re: Selfie Flirtscript

Cool!
will surely use it +repped
superrobot48 is offline   Reply With Quote
Old 20/05/2014, 04:04 PM   #3
Hwang
Huge Clucker
 
Hwang's Avatar
 
Join Date: Jul 2013
Location: Turkey
Posts: 215
Reputation: 33
Default Re: Selfie Flirtscript

Cool and easy system.
__________________


185.136.204.49:7777
Hwang is offline   Reply With Quote
Old 20/05/2014, 04:05 PM   #4
JFF
Big Clucker
 
Join Date: May 2014
Posts: 110
Reputation: 17
Default Re: Selfie Flirtscript

Thanks guys

Yeah as i said its easy but kinda fun
JFF is offline   Reply With Quote
Old 20/05/2014, 04:11 PM   #5
Devil123
Big Clucker
 
Devil123's Avatar
 
Join Date: Sep 2013
Location: Jordan
Posts: 75
Reputation: 2
Default Re: Selfie Flirtscript

Cool i it
Devil123 is offline   Reply With Quote
Old 20/05/2014, 04:13 PM   #6
JFF
Big Clucker
 
Join Date: May 2014
Posts: 110
Reputation: 17
Default Re: Selfie Flirtscript

Quote:
Originally Posted by Devil123 View Post
Cool i it
thanks!
JFF is offline   Reply With Quote
Old 20/05/2014, 05:31 PM   #7
FahadKing07
Gangsta
 
FahadKing07's Avatar
 
Join Date: Oct 2013
Location: Miami
Posts: 665
Reputation: 64
Default Re: Selfie Flirtscript

Looks Nice. Great Work buddy
__________________
Want money to host? Want to sell your gamemode? I will pay, message me.

|| Entrepreneur | Marketing Expert ||
FahadKing07 is offline   Reply With Quote
Old 20/05/2014, 05:36 PM   #8
JFF
Big Clucker
 
Join Date: May 2014
Posts: 110
Reputation: 17
Default Re: Selfie Flirtscript

Quote:
Originally Posted by FahadKing07 View Post
Looks Nice. Great Work buddy
Thanks dude!
JFF is offline   Reply With Quote
Old 20/05/2014, 05:42 PM   #9
Matz
Huge Clucker
 
Matz's Avatar
 
Join Date: Apr 2011
Location: Istanbul
Posts: 249
Reputation: 142
Default Re: Selfie Flirtscript

You could use /headmove for better scene
Matz is offline   Reply With Quote
Old 20/05/2014, 05:46 PM   #10
JFF
Big Clucker
 
Join Date: May 2014
Posts: 110
Reputation: 17
Default Re: Selfie Flirtscript

Quote:
Originally Posted by Matz View Post
You could use /headmove for better scene
You can use Num6 and Num4 to move the camera for a better pic
JFF is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.