Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Include by Exod_Martinez
- #include <a_samp>
- forward exd_ResetToggle(playerid);
- enum exd_SpecEnum{
- Float:exd_SpecPos[4],
- exd_SpecInt,
- exd_SpecVW
- }
- new exd_Spec[MAX_PLAYERS][exd_SpecEnum];
- stock exd_TogglePlayerSpectating(playerid, bool:toggle){
- if(toggle){
- exd_Spec[playerid][exd_SpecVW] = GetPlayerVirtualWorld(playerid);
- exd_Spec[playerid][exd_SpecInt] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, exd_Spec[playerid][exd_SpecPos][0], exd_Spec[playerid][exd_SpecPos][1], exd_Spec[playerid][exd_SpecPos][2]);
- GetPlayerFacingAngle(playerid, exd_Spec[playerid][exd_SpecPos][3]);
- // printf("Pos: %f %f %f %f INT: %i VW: %i", exd_Spec[playerid][exd_SpecPos][0], exd_Spec[playerid][exd_SpecPos][1], exd_Spec[playerid][exd_SpecPos][2], exd_Spec[playerid][exd_SpecPos][3], exd_Spec[playerid][exd_SpecInt], exd_Spec[playerid][exd_SpecVW]);
- }
- else if(!toggle){
- if(exd_Spec[playerid][exd_SpecPos][0] != 0.0 && exd_Spec[playerid][exd_SpecPos][1] != 0.0){
- SetTimerEx("exd_ResetToggle", 25, false, "i", playerid);
- }
- }
- return TogglePlayerSpectating(playerid, toggle);
- }
- public exd_ResetToggle(playerid){
- SetPlayerVirtualWorld(playerid, exd_Spec[playerid][exd_SpecVW]);
- SetPlayerInterior(playerid, exd_Spec[playerid][exd_SpecInt]);
- SetPlayerPos(playerid, exd_Spec[playerid][exd_SpecPos][0], exd_Spec[playerid][exd_SpecPos][1], exd_Spec[playerid][exd_SpecPos][2]);
- SetPlayerFacingAngle(playerid, exd_Spec[playerid][exd_SpecPos][3]);
- SetCameraBehindPlayer(playerid);
- return 1;
- }
- #if defined _ALS_TogglePlayerSpectating
- #undef TogglePlayerSpectating
- #else
- #define _ALS_TogglePlayerSpectating
- #endif
- #define TogglePlayerSpectating exd_TogglePlayerSpectating
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement