Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- new takingselfie[MAX_PLAYERS];
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_RED 0xFF0000AA
- #if defined FILTERSCRIPT
- new Text:Textdraw2;
- new Float:x[MAX_PLAYERS],Float:y[MAX_PLAYERS],Float:z[MAX_PLAYERS],Float:a[MAX_PLAYERS];
- new Float:nx[MAX_PLAYERS],Float:ny[MAX_PLAYERS],Float:nz[MAX_PLAYERS];
- new right[MAX_PLAYERS];
- new left[MAX_PLAYERS];
- 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~~g~/selfie to stop taking selfies.");
- 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 OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(takingselfie[playerid] == 1)
- {
- if(newkeys & KEY_ANALOG_RIGHT)
- {
- if(right[playerid] < 4)
- {
- InterpolateCameraPos(playerid,nx[playerid],ny[playerid],nz[playerid],nx[playerid],ny[playerid] + 0.1,nz[playerid], 1000,CAMERA_MOVE);
- ny[playerid] = ny[playerid] + 0.1;
- right[playerid] ++;
- left[playerid] --;
- }
- }
- if(newkeys & KEY_ANALOG_LEFT)
- {
- if(left[playerid] < 7)
- {
- InterpolateCameraPos(playerid,nx[playerid],ny[playerid],nz[playerid],nx[playerid],ny[playerid] - 0.1,nz[playerid], 1000,CAMERA_MOVE);
- ny[playerid] = ny[playerid] - 0.1;
- right[playerid] --;
- left[playerid] ++;
- }
- }
- }
- return 1;
- }
- CMD:selfie(playerid,params[])
- {
- if(takingselfie[playerid] == 0)
- {
- TogglePlayerControllable(playerid,0);
- GetPlayerPos(playerid, x[playerid], y[playerid], z[playerid]);
- SetPlayerFacingAngle(playerid,269.9766);
- GetPlayerFacingAngle(playerid, a[playerid]);
- nx[playerid] = x[playerid]+1.4;
- ny[playerid] = y[playerid];
- nz[playerid] = z[playerid]+1;
- SetPlayerCameraPos(playerid,nx[playerid],ny[playerid],nz[playerid]);
- SetPlayerCameraLookAt(playerid,x[playerid],y[playerid],z[playerid]+1);
- ApplyAnimation(playerid, "PED", "gang_gunstand", 4.1, 1, 1, 1, 1, 1, 1);
- TextDrawShowForPlayer(playerid,Textdraw2);
- takingselfie[playerid] = 1;
- right[playerid] = 0;
- left[playerid] = 0;
- return 1;
- }
- if(takingselfie[playerid] == 1)
- {
- TogglePlayerControllable(playerid,1);
- SetCameraBehindPlayer(playerid);
- TextDrawHideForPlayer(playerid,Textdraw2);
- takingselfie[playerid] = 0;
- ClearAnimations(playerid);
- return 1;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement