Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>//hurr, obviously the original samp functions
- #include <YSI\y_commands> //cmd: etc
- #define FILTERSCRIPT//defines it as a filterscript
- #define DIALOG_MARKER 99//dialog ID 99 - trying to prevent conflicts.
- #define DIALOG_ADJUSTMENTS 100//dialog ID 100 - trying to prevent conflicts.
- #define COLOR_GREEN 0x00FF00FF//defining green color
- #define COLOR_RED 0xFF0000FF//defining red color
- new Text:HitMarker;//hitmarker textdraw
- new actmarker[MAX_PLAYERS];//variable to check if player wants or not the hitmarker to appear
- new timarker;//variable that we use later as the hitmarker timer
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" HitMarker Filterscript - [VGS]GuaxXxiniN"); // Do whatever you want with this filterscript, just don't remove the credits. Appreciate it.
- print("--------------------------------------\n");
- HitMarker = TextDrawCreate(334.000000, 174.000000, "x");
- TextDrawBackgroundColor(HitMarker, 255);
- TextDrawFont(HitMarker, 1);
- TextDrawLetterSize(HitMarker, 0.500000, 1.000000);
- TextDrawColor(HitMarker, -16776961);
- TextDrawSetOutline(HitMarker, 0);
- TextDrawSetProportional(HitMarker, 1);
- TextDrawSetShadow(HitMarker, 1);
- return 1;
- }
- forward HTD(issuerid);
- public HTD(issuerid)
- {
- TextDrawHideForPlayer(issuerid, HitMarker);
- KillTimer(timarker);
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(actmarker[issuerid] >= 1)
- {
- TextDrawShowForPlayer(issuerid, HitMarker);
- timarker = SetTimerEx("HTD", 250, true, "%d", issuerid);
- PlayerPlaySound(issuerid,1057,0,0,0);
- }
- return 1;
- }
- CMD:marker(playerid, params[])
- {
- ShowPlayerDialog(playerid, DIALOG_ADJUSTMENTS, DIALOG_STYLE_MSGBOX,"HitMarker","{FFFFFF}Do you want to turn the hitmarker {00FF26}ON {FFFFFF}or {FF0000}OFF?","Turn ON","Turn OFF");
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- switch(dialogid)
- {
- case DIALOG_ADJUSTMENTS:
- {
- if ((!response) && (actmarker[playerid] >= 1)) return SendClientMessage(playerid, COLOR_RED, "HitMarker turned OFF."), actmarker[playerid]--;
- else if ((!response) && (actmarker[playerid] <= 0)) return SendClientMessage(playerid, COLOR_RED, "It is already turned OFF!");
- if((response) && (actmarker[playerid] <= 0)) return SendClientMessage(playerid, COLOR_GREEN, "HitMarker turned ON."), actmarker[playerid]++;
- else if ((response) && (actmarker[playerid] >= 1)) return SendClientMessage(playerid, COLOR_GREEN, "It is already turned ON!");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment