Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined Hide__0
- *# # # # # # # # # # # # # # # # #*
- *# 0Hide - V1.0 #*
- *# By Zh3r0 #*
- *# Created on: 17 June #*
- *# # # # # # # # # # # # # # # # #*
- [Changelog]
- V1.0
- - Release
- V2.0
- - Added more hide objects, check "/hideo".
- - Fixed name tag
- - Fixed color transparency.
- Credits to Mauzen for the transparency code.
- [Information]
- - With this filterscript, when you are in-game type "/hide", now you have
- activated the script, now whenever you crouch, a flower pot will mask your
- presence!
- #endif
- #include < a_samp >
- #define PRESSED(%0) \
- (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
- #define Loop:<%0,%1> \
- for( new %0; %0 < %1; %0++)
- /*
- With this definition you cannot be bugged while hiding.
- Keeping it uncommented will remove the object each time
- you are not crouching using OnPlayerUpdate
- Comment this if you are experiencing any lag from the script.
- */
- #define PERFECTION
- /*
- */
- new
- bool:Activated[MAX_PLAYERS char],
- Hidden[MAX_PLAYERS char],
- CurrentObject[MAX_PLAYERS char]
- ;
- enum
- e_objects
- {
- o_id, o_n[15], o_b,
- Float:o_x, Float:o_y, Float:o_z,
- Float:o_rx, Float:o_ry, Float:o_rz,
- Float:o_sx, Float:o_sy, Float:o_sz
- }
- enum
- e_dialogs
- {
- Empty = 5555,
- List = 5556
- }
- new
- ObjectInfo[33][e_objects] =
- {
- {1221, "Box 1", 11, 0.331851, -0.387647, 0.108080, 62.871932, 3.603914, 279.105468, 1.500000, 1.500000, 1.500000},
- {1220, "Box 2",11, 0.331851, -0.387647, 0.108080, 62.871932, 3.603914, 279.105468, 1.500000, 1.500000, 1.500000},
- {2912, "Box 3", 10, -0.117735, -0.402220, -0.766344, 356.370971, 357.288360, 5.631556, 1.500000, 1.600000, 1.500000},
- {964, "Army Box", 11, 0.180357, 0.045067, -0.323517, 63.705467, 4.868588, 165.003601, 1.000000, 1.000000, 1.299999},
- {1271, "Gun Box", 11, 0.316308, -0.396371, 0.129949, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1367, "Post Box 1", 11, 0.230588, -0.647528, 0.151942, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1291, "Post Box 2", 11, 0.285487, -0.645864, 0.129949, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {800, "Bush 1", 11, 0.366527, -0.542696, -0.005478, 35.919593, 8.222164, 141.222518, 0.432692, 0.400000, 0.400000},
- {823, "Bush 2", 11, 0.366527, -0.542696, -0.005478, 60.612785, 10.375102, 165.003601, 0.312109, 0.300000, 0.300000},
- {824, "Bush 3", 11, 0.366527, -0.542696, -0.005478, 60.612785, 10.375102, 165.003601, 0.312109, 0.300000, 0.300000},
- {825, "Bush 4", 11, 0.366527, -0.542696, -0.005478, 60.612785, 10.375102, 165.003601, 0.312109, 0.300000, 0.300000},
- {754, "Cactus Bush", 11, 0.312796, 0.180289, -0.285668, 63.705467, 4.868588, 165.003601, 1.200027, 1.252762, 2.480148},
- {653, "Cactus Plant", 11, -0.121614, 0.075794, -0.285668, 63.705467, 4.868588, 165.003601, 0.800000, 0.800000, 0.800000},
- {831, "Dead Tree", 11, 0.366527, -0.542696, -0.005478, 60.612785, 10.375102, 165.003601, 0.600000, 0.600000, 0.600000},
- {1370, "Flame Drum", 11, 0.230588, -0.647528, 0.151942, 63.663352, 5.211647, 103.045799, 1.500000, 1.500000, 1.500000},
- {1371, "Hippo Bin", 11, 0.230588, -0.647528, 0.151942, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1225, "Barrel 1", 11, 0.331851, -0.387647, 0.108080, 62.871932, 3.603914, 279.105468, 1.500000, 1.500000, 1.500000},
- {1222, "Barrel 2", 11, 0.331851, -0.387647, 0.108080, 62.871932, 3.603914, 279.105468, 1.500000, 1.500000, 1.500000},
- {1218, "Barrel 3", 11, 0.331851, -0.387647, 0.108080, 62.871932, 3.603914, 279.105468, 1.500000, 1.500000, 1.5000},
- {1217, "Barrel 4", 11, 0.331851, -0.387647, 0.108080, 62.871932, 3.603914, 279.105468, 1.500000, 1.500000, 1.500000},
- {1362, "Fire Bin", 11, 0.230588, -0.647528, 0.151942, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1347, "Waste Bin", 11, 0.230588, -0.647528, 0.151942, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1339, "Bin 1", 11, 0.230588, -0.647528, 0.151942, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1337, "Bin 2", 11, 0.230588, -0.647528, 0.151942, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1330, "Trash Can 1", 11, 0.285487, -0.587944, 0.121327, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1329, "Trash Can 2", 11, 0.285487, -0.645864, 0.129949, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1328, "Trash Can 3", 11, 0.285487, -0.645864, 0.129949, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1264, "Trash Bag", 11, 0.331851, -0.534445, -0.022953, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1237, "Barrier", 11, 0.331851, 0.015704, -0.173188, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1208, "Wash Machine", 11, 0.292449, 0.018611, -0.236802, 64.272399, 6.367418, 97.481346, 1.500000, 1.500000, 1.500000},
- {1304, "Rock 1", 11, 0.285487, -0.645864, 0.129949, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1303, "Rock 2", 11, 0.285487, -0.645864, 0.129949, 65.029396, 4.721271, 279.105468, 1.500000, 1.500000, 1.500000},
- {1305, "Rock 3", 11, 0.285487, -0.645864, 0.129949, 65.029396, 4.721271, 279.105468, 0.800000, 0.800000, 0.800000}
- };
- stock ToggleTagName(playerid, toggle)
- {
- Loop:<I, MAX_PLAYERS>
- {
- if(I != INVALID_PLAYER_ID)
- {
- ShowPlayerNameTagForPlayer(I, playerid, toggle);
- }
- }
- }
- stock StealthMode(playerid)
- {
- Hidden{playerid} = true;
- ToggleTagName(playerid, 0);
- SetPlayerColor(playerid, GetPlayerColor(playerid) - (GetPlayerColor(playerid) & 0x000000FF) - 255);
- SetPlayerAttachedObject
- (
- playerid,
- 0,
- ObjectInfo[CurrentObject{playerid}][o_id],
- ObjectInfo[CurrentObject{playerid}][o_b],
- ObjectInfo[CurrentObject{playerid}][o_x],
- ObjectInfo[CurrentObject{playerid}][o_y],
- ObjectInfo[CurrentObject{playerid}][o_z],
- ObjectInfo[CurrentObject{playerid}][o_rx],
- ObjectInfo[CurrentObject{playerid}][o_ry],
- ObjectInfo[CurrentObject{playerid}][o_rz],
- ObjectInfo[CurrentObject{playerid}][o_sx],
- ObjectInfo[CurrentObject{playerid}][o_sy],
- ObjectInfo[CurrentObject{playerid}][o_sz]
- );
- }
- stock RevealPlayer(playerid, toggle = 1)
- {
- Hidden{playerid} = false;
- SetPlayerColor(playerid, GetPlayerColor(playerid) - (GetPlayerColor(playerid) & 0x000000FF) + 255);
- RemovePlayerAttachedObject(playerid, 0);
- ToggleTagName(playerid, toggle);
- }
- stock ShowContent()
- {
- new Content[512];
- strcat(Content, "{94ED40}0Hide - Stealthy Filterscript V2{FFFFFF}\n\n", 512);
- strcat(Content, "Created by {94ED40}Zh3r0{FFFFFF} on {94ED40}17 June{FFFFFF}\n", 512);
- strcat(Content, "Type {94ED40}/hide{FFFFFF} to activate/deactivate the stealth mode.!\n", 512);
- strcat(Content, "Type {94ED40}/hideo{FFFFFF} and choose your hiding object!\n\n", 512);
- strcat(Content, "(C)Zh3r0 - Keep the credits");
- return Content;
- }
- public OnFilterScriptInit()
- {
- print("-\t\t\t\t\t -\n\n\
- \t|\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\n\
- \t| 0Hide V2.0 |\n\
- \t| By Zh3r0 |\n\
- \t| Created on: 17 June |\n\
- \t| Updated on: 20 June |\n\
- \t|/////////////////////////\n\
- \n-\t\t\t\t\t -\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- CurrentObject{playerid} = 0xFFFF;
- Activated{playerid} = false;
- SendClientMessage(playerid, ~1, "This server uses {94ED40}0Hide{FFFFFF} by {94ED40}Zh3r0{FFFFFF}. Type {94ED40}/hidehelp{FFFFFF} for more info.");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- CurrentObject{playerid} = 0xFFFF;
- Activated{playerid} = false;
- }
- public OnPlayerSpawn(playerid)
- {
- if(!GetPlayerColor(playerid))
- {
- SetPlayerColor(playerid, 0x94ED40FF);
- SendClientMessage(playerid, ~1, #lol);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case Empty: return true;
- case List:
- {
- CurrentObject{playerid} = listitem;
- new
- String[129];
- format(String, sizeof(String), "You selected {94ED40}%s{FFFFFF} (Model: {94ED40}%d{FFFFFF}) as your cover. press {94ED40}C (Crouch)", ObjectInfo[listitem][o_n], ObjectInfo[listitem][o_id]);
- return SendClientMessage(playerid, ~1, String), true;
- }
- }
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/hideo"))
- {
- if(Activated{playerid})
- {
- new
- LongString[1_024];
- for(new o = 0; o < sizeof(ObjectInfo); o++)
- {
- format(LongString, sizeof(LongString), "%s{94ED40} %s\n", LongString, ObjectInfo[o][o_n]);
- }
- ShowPlayerDialog
- (
- playerid,
- List,
- DIALOG_STYLE_LIST,
- "{94ED40}0Hide - Objects",
- LongString,
- "Select",
- "Close"
- );
- LongString[0] = EOS;
- }
- else
- SendClientMessage(playerid, 0xFFFFFFFF, "ERROR: {FFFFFF}Enable the {94ED40}Stealth Mode{FFFFFF} from {94ED40}/hide{FFFFFF}");
- return 1;
- }
- if(!strcmp(cmdtext, "/hidehelp"))
- {
- ShowPlayerDialog
- (
- playerid,
- Empty,
- DIALOG_STYLE_MSGBOX,
- "{94ED40}0Hide - Stealthy",
- ShowContent(),
- "Close",
- ""
- );
- return 1;
- }
- if(!strcmp(cmdtext, "/hide"))
- {
- if(Activated{playerid})
- {
- SetPlayerColor(playerid, GetPlayerColor(playerid) + 0x000000FF);
- Activated{playerid} = false;
- SendClientMessage(playerid, ~1, "Hidding is now disabled");
- CurrentObject{playerid} = 0xFFFF;
- }
- else
- {
- Activated{playerid} = true;
- SendClientMessage(playerid, ~1, "Hidding is now enabled! Press {94ED40}C(Crouch){FFFFFF} to hide. Hold the key to stay stealthy.");
- SendClientMessage(playerid, ~1, "Use {94ED40}/hideo{FFFFFF} and choose your hiding object!");
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(Activated{playerid})
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- if(newkeys & KEY_CROUCH)
- {
- if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK && !Hidden{playerid})
- {
- StealthMode(playerid);
- }
- else
- {
- RevealPlayer(playerid);
- }
- }
- if(Hidden{playerid})
- {
- if(PRESSED(KEY_JUMP | KEY_SPRINT | KEY_ACTION) || (!GetPlayerWeapon(playerid) && PRESSED(KEY_FIRE)))
- {
- RevealPlayer(playerid);
- }
- }
- }
- }
- return 1;
- }
- #if defined PERFECTION
- public OnPlayerUpdate(playerid)
- {
- if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK && Hidden{playerid})
- {
- RevealPlayer(playerid);
- }
- return 0;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment