Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //anybox 2013
- #include <a_samp>
- #include <zcmd>
- #define FILTERSCRIPT
- #undef MAX_PLAYERS
- #define MAX_PLAYERS 30
- #define EXPLOSION_COUNT 12
- #define ACTION_SPEED 4
- #define HALF_ACTION_SPEED 2
- #define CAMERA_TIME 3000
- new smActive[MAX_PLAYERS];
- CMD:sman(playerid, params[])
- {
- if (!IsPlayerAdmin(playerid)) return 1;
- TogglePlayerControllable(playerid, 0);
- new Float: x, Float: y, Float: z, Float: a;
- GetPlayerPos(playerid,x,y,z);
- GetPlayerFacingAngle(playerid,a);
- a = a+90.0;
- InterpolateCameraPos(playerid,x,y,z,x-floatcos(a, degrees)*10,
- y-floatsin(a, degrees) * 10, z+2.0, CAMERA_TIME, CAMERA_MOVE);
- InterpolateCameraLookAt(playerid,x,y,z,x,y,z,1000,CAMERA_CUT);
- smActive[playerid] = ACTION_SPEED;
- return 1;
- }
- forward checkSuperMan();
- public checkSuperMan()
- {
- static Float: x, Float: y, Float: z, Float: a;
- for (new i = 0; i < MAX_PLAYERS; i++) {
- if (!IsPlayerConnected(i) || !smActive[i]) continue;
- if (smActive[i] == HALF_ACTION_SPEED || smActive[i] == 1) {
- GetPlayerPos(i,x,y,z);
- GetPlayerFacingAngle(i,a);
- }
- if (smActive[i] == HALF_ACTION_SPEED) {
- a = a+90.0;
- InterpolateCameraPos(i,x-floatcos(a, degrees)*10,
- y-floatsin(a, degrees) * 10, z+2.0, x, y, z+1, 1400, CAMERA_MOVE);
- InterpolateCameraLookAt(i,x,y,z,x,y,z,1000,CAMERA_CUT);
- } else if (smActive[i] == 1) {
- new Float: angle;
- for (new j = 0; j < EXPLOSION_COUNT; j++) {
- angle = a+j*360/EXPLOSION_COUNT;
- CreateExplosion(x+floatcos(angle, degrees)*20, y+floatsin(angle, degrees)*20, z+0.3, 10, 20);
- }
- TogglePlayerControllable(i, 1);
- SetCameraBehindPlayer(i);
- }
- smActive[i]--;
- }
- }
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("\n--------------------------------------");
- print("Power Man 1.0 by anybox");
- print("--------------------------------------\n");
- print("--------------------------------------\n");
- SetTimer("checkSuperMan", 1000, true);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- smActive[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement