Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define Set(%1,%2) \
- format(%1,sizeof(%1),%2)
- public OnFilterScriptInit() return Init();
- public OnGameModeInit() return Init();
- public OnFilterScriptExit() return Exit();
- public OnGameModeExit() return Exit();
- // -- Deaths box -- //
- new Text:Death_bg;
- new Text:Death_line1;
- new Text:Death_line2;
- new Text:Death_line3;
- new Death_text[3][100];
- new bool:Death_show;
- forward CreateDeathTextdraws();
- forward DestroyDeathTextdraws();
- forward Init();
- forward Exit();
- public Init()
- {
- Death_text[0] = "";
- Death_text[1] = "";
- Death_text[2] = "";
- Death_show = false;
- return 1;
- }
- public Exit()
- {
- TextDrawHideForAll(Death_bg);
- TextDrawHideForAll(Death_line1);
- TextDrawHideForAll(Death_line2);
- TextDrawHideForAll(Death_line3);
- TextDrawDestroy(Death_bg);
- TextDrawDestroy(Death_line1);
- TextDrawDestroy(Death_line2);
- TextDrawDestroy(Death_line3);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(!Death_show)
- {
- CreateDeathTextdraws();
- TextDrawShowForAll(Death_bg);
- TextDrawShowForAll(Death_line1);
- TextDrawShowForAll(Death_line2);
- TextDrawShowForAll(Death_line3);
- Death_show = true;
- }
- new test[15];
- format(test,15,"reason: %i",reason);
- GameTextForPlayer(killerid,test,2000,5);
- format(Death_text[2],100,Death_text[1]);
- format(Death_text[1],100,Death_text[0]);
- if(killerid != INVALID_PLAYER_ID)
- {
- format(Death_text[0],100,"~b~%s ~w~killed ~b~%s ~w~(%s)",ReturnPname(killerid),ReturnPname(playerid),GetDeathReason(reason));
- }
- else format(Death_text[0],100,"~b~%s ~w~is death ~w~(%s)",ReturnPname(playerid),GetDeathReason(reason));
- TextDrawSetString(Death_line3,Death_text[2]);
- TextDrawSetString(Death_line2,Death_text[1]);
- TextDrawSetString(Death_line1,Death_text[0]);
- return 1;
- }
- stock ReturnPname(id)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(id,name,MAX_PLAYER_NAME);
- return name;
- }
- stock GetDeathReason(reason)
- {
- new string[25];
- switch(reason)
- {
- case 0: Set(string,"Fists");
- case 1: Set(string,"Knuckles");
- case 2: Set(string,"Golf Club");
- case 3: Set(string,"Nite Stick");
- case 4: Set(string,"Knife");
- case 5: Set(string,"Baseball Bat");
- case 6: Set(string,"Shovel");
- case 7: Set(string,"Pool Cue");
- case 8: Set(string,"Katana");
- case 9: Set(string,"Chainsaw");
- case 10: Set(string,"Dildo");
- case 11: Set(string,"Vibrator");
- case 12: Set(string,"Vibrator");
- case 13: Set(string,"Vibrator");
- case 14: Set(string,"Flowers");
- case 15: Set(string,"Cane");
- case 16: Set(string,"Grenade");
- case 17: Set(string,"Tear Gas");
- case 18: Set(string,"Molotov Cocktail");
- case 22: Set(string,"9mm");
- case 23: Set(string,"9mm Silenced");
- case 24: Set(string,"Desert Eagle");
- case 25: Set(string,"Shotgun");
- case 26: Set(string,"Sawn-off");
- case 27: Set(string,"Spas-12");
- case 28: Set(string,"UZI");
- case 29: Set(string,"MP5");
- case 30: Set(string,"Ak-47");
- case 31: Set(string,"M4 Carabine");
- case 32: Set(string,"Tec-9");
- case 33: Set(string,"Rifle");
- case 34: Set(string,"Sniper");
- case 35: Set(string,"Bazooka");
- case 36: Set(string,"Stinger");
- case 37: Set(string,"Flamethrower");
- case 38: Set(string,"Minigun");
- case 39: Set(string,"C4");
- case 40: Set(string,"C4");
- case 41: Set(string,"Sptaycan");
- case 42: Set(string,"Fire Extinguisher");
- case 43: Set(string,"Camera");
- case 44: Set(string,"Nightvision");
- case 45: Set(string,"Thermal");
- case 46: Set(string,"Parachute");
- case 47: Set(string,"Explosion");
- case 49: Set(string,"Vehicle");
- case 50: Set(string,"Helicopter");
- case 51: Set(string,"Explosion");
- case 53: Set(string,"Drowned");
- case 54: Set(string,"Fall");
- case 200: Set(string,"Connect");
- case 201: Set(string,"Disconnect");
- default: Set(string,"Unknown");
- }
- return string;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid,Death_bg);
- TextDrawShowForPlayer(playerid,Death_line1);
- TextDrawShowForPlayer(playerid,Death_line2);
- TextDrawShowForPlayer(playerid,Death_line3);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid,Death_bg);
- TextDrawHideForPlayer(playerid,Death_line1);
- TextDrawHideForPlayer(playerid,Death_line2);
- TextDrawHideForPlayer(playerid,Death_line3);
- return 1;
- }
- public CreateDeathTextdraws()
- {
- // -- Deaths box -- //
- Death_bg = TextDrawCreate(446.000000,411.000000," ~n~ ~n~");
- Death_line1 = TextDrawCreate(449.000000,412.000000," ");
- Death_line2 = TextDrawCreate(449.000000,421.000000," ");
- Death_line3 = TextDrawCreate(449.000000,430.000000," ");
- // -- Background @ Deaths box -- //
- TextDrawUseBox(Death_bg,1);
- TextDrawBoxColor(Death_bg,0x00000066);
- TextDrawTextSize(Death_bg,628.000000,143.000000);
- TextDrawAlignment(Death_bg,0);
- TextDrawBackgroundColor(Death_bg,0x000000ff);
- TextDrawFont(Death_bg,3);
- TextDrawLetterSize(Death_bg,1.200000,1.699998);
- TextDrawColor(Death_bg,0xffffffff);
- TextDrawSetOutline(Death_bg,1);
- TextDrawSetProportional(Death_bg,1);
- TextDrawSetShadow(Death_bg,1);
- // -- Line 1 @ Deaths box -- //
- TextDrawAlignment(Death_line1,0);
- TextDrawBackgroundColor(Death_line1,0x000000ff);
- TextDrawFont(Death_line1,1);
- TextDrawLetterSize(Death_line1,0.299999,1.000000);
- TextDrawColor(Death_line1,0xffffffff);
- TextDrawSetOutline(Death_line1,1);
- TextDrawSetProportional(Death_line1,1);
- TextDrawSetShadow(Death_line1,1);
- // -- Line 2 @ Deaths box -- //
- TextDrawAlignment(Death_line2,0);
- TextDrawBackgroundColor(Death_line2,0x000000ff);
- TextDrawFont(Death_line2,1);
- TextDrawLetterSize(Death_line2,0.299999,1.000000);
- TextDrawColor(Death_line2,0xffffffff);
- TextDrawSetOutline(Death_line2,1);
- TextDrawSetProportional(Death_line2,1);
- TextDrawSetShadow(Death_line2,1);
- // -- Line 3 @ Deaths box -- //
- TextDrawAlignment(Death_line3,0);
- TextDrawBackgroundColor(Death_line3,0x000000ff);
- TextDrawFont(Death_line3,1);
- TextDrawLetterSize(Death_line3,0.299999,1.000000);
- TextDrawColor(Death_line3,0xffffffff);
- TextDrawSetOutline(Death_line3,1);
- TextDrawSetProportional(Death_line3,1);
- TextDrawSetShadow(Death_line3,1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement