Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- _______ _ _ _____ _ _
- |__ __| (_|_) / ____| (_) | |
- | |_ ___ ___ __ | (___ ___ _ __ _ _ __ | |_ ___
- | \ \ /\ / / | \ \/ / \___ \ / __| '__| | '_ \| __/ __|
- | |\ V V /| | |> < ____) | (__| | | | |_) | |_\__ \
- |_| \_/\_/ |_|_/_/\_\ |_____/ \___|_| |_| .__/ \__|___/
- | |
- |_|
- _________________________________________________________________________________________________________________
- ____ _____ _ _______ _ _____
- / __ \ | __ \| | |__ __| | | | __ \
- | | | |_ __ | |__) | | __ _ _ _ ___ _ __| | __ _| | _____| | | | __ _ _ __ ___ __ _ __ _ ___
- | | | | '_ \| ___/| |/ _` | | | |/ _ \ '__| |/ _` | |/ / _ \ | | |/ _` | '_ ` _ \ / _` |/ _` |/ _ \
- | |__| | | | | | | | (_| | |_| | __/ | | | (_| | < __/ |__| | (_| | | | | | | (_| | (_| | __/
- \____/|_| |_|_| |_|\__,_|\__, |\___|_| |_|\__,_|_|\_\___|_____/ \__,_|_| |_| |_|\__,_|\__, |\___|
- __/ | __/ |
- |___/ |___/
- _________________________________________________________________________________________________________________
- _____ _
- / ____| | |
- | | ___ _ __ ___ _ __ ___ __ _ _ __ __| |___
- | | / _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` / __|
- | |___| (_) | | | | | | | | | | | (_| | | | | (_| \__ \
- \_____\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|___/
- _________________________________________________________________________________________________________________
- | /hitsound | Enable/Disable Hitsound |
- | /shottext | Enable/Disable The Shottext |
- | /headshot | Enable/Disable HeadShot (RCON) |
- _________________________________________________________________________________________________________________
- */
- #include <a_samp>
- #include <zcmd>
- #define RED 0xAA3333AA
- new Hitsound[MAX_PLAYERS];
- new ShotText[MAX_PLAYERS];
- new HeadShot;
- public OnFilterScriptInit()
- {
- print("\n-------------------------------------------");
- print("Twiix Scripts - OnPlayerTakeDamage - Loaded");
- print("-------------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n---------------------------------------------");
- print("Twiix Scripts - OnPlayerTakeDamage - Unloaded");
- print("---------------------------------------------\n");
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- Hitsound[playerid] = 1;
- ShotText[playerid] = 1;
- GivePlayerWeapon(playerid, 26, 999999); //For Test
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(ShotText[issuerid] == 1)
- {
- new
- string[1024],
- WeaponName[24],
- ShootedName[MAX_PLAYER_NAME],
- ShooterName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, ShootedName, sizeof (ShootedName)); //To get the shooted player name from his id
- GetPlayerName(issuerid, ShooterName, sizeof (ShooterName)); //To get the shooter player name from his id
- GetWeaponName(weaponid, WeaponName, sizeof (WeaponName)); //To get the weapon name from the weaponid
- format(string, sizeof(string), "~r~%s~w~(%d)~n~- %.0f ~r~Health/Armor~n~~r~Weapon: ~w~%s", ShootedName, playerid, amount, WeaponName);
- GameTextForPlayer(issuerid, string, 5000, 4); //Show the shottext to the player
- }
- if(Hitsound[issuerid] == 1)
- {
- PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 0.0); //Hitsound
- }
- }
- if(HeadShot == 1)
- {
- if(issuerid != INVALID_PLAYER_ID && bodypart == 9) //HeadShot
- {
- SetPlayerHealth(playerid, 0);
- }
- }
- return 1;
- }
- CMD:hitsound(playerid, params[])
- {
- if(Hitsound[playerid] == 0)
- {
- Hitsound[playerid] = 1;
- GameTextForPlayer(playerid, "~r~Hitsound ~w~on", 5000, 3);
- }
- else if(Hitsound[playerid] == 1)
- {
- Hitsound[playerid] = 0;
- GameTextForPlayer(playerid, "~r~Hitsound ~w~off", 5000, 3);
- }
- return 1;
- }
- CMD:shottext(playerid, params[])
- {
- if(ShotText[playerid] == 0)
- {
- ShotText[playerid] = 1;
- GameTextForPlayer(playerid, "~r~ShotText ~w~on", 5000, 3);
- }
- else if(ShotText[playerid] == 1)
- {
- ShotText[playerid] = 0;
- GameTextForPlayer(playerid, "~r~ShotText ~w~off", 5000, 3);
- }
- return 1;
- }
- CMD:headshot(playerid, params[])
- {
- if (! IsPlayerAdmin(playerid))
- {
- return SendClientMessage(playerid, RED, "You are not RCON Administrator");
- }
- if(HeadShot == 0)
- {
- HeadShot = 1;
- GameTextForPlayer(playerid, "~r~HeadShot ~w~on", 5000, 3);
- }
- else if(HeadShot == 1)
- {
- HeadShot = 0;
- GameTextForPlayer(playerid, "~r~HeadShot ~w~off", 5000, 3);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment