Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Спешал фор про павн. Кто сольёт,говно сожрёт
- //====================================================
- #define FILTERSCRIPT
- #include <a_samp>
- #include <ZCMD>
- //====================================================
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_FADE 0xC8C8C8C8
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_PURPLE 0xC2A2DAAA
- #define COLOR_YELLOW 0xDABB3E00
- #define COLOR_BLACK 0x000000AA
- #define COLOR_BLUE 0x1E90FFAA
- #define COLOR_PINK 0xFF1493AA
- #define COLOR_GREEN 0x006400AA
- #define COLOR_ORANGE 0xFF4500AA
- #define COLOR_RED 0xFF0000AA
- //====================================================
- new HasTazer[MAX_PLAYERS], BeenTazered[MAX_PLAYERS], WEAPON;
- forward BeenTazeredTimer(playerid, issuerid, damagedid);
- forward OnPlayerChangeWeapon(playerid, oldweapon, newweapon);
- public BeenTazeredTimer(playerid, issuerid, damagedid)
- {
- BeenTazered[playerid] = 1;
- }
- public OnPlayerChangeWeapon(playerid, oldweapon, newweapon)
- {
- if(HasTazer[playerid] == 1)
- {
- GivePlayerWeapon(playerid, 23, 5000000); // If player tries changing weapon with a tazer, gives him back the tazer weapon.
- }
- return 1;
- }
- stock GetName(playerid)
- {
- new Name[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, Name, sizeof(Name));
- }
- return Name;
- }
- stock GiveTazer(playerid)
- {
- GivePlayerWeapon(playerid, 23, 5000000); // UNLIMITED AMMUNITION
- HasTazer[playerid] = 1;
- SendClientMessage(playerid, COLOR_WHITE, "INFO: Tazer switched: [ON]");
- }
- stock TakeTazer(playerid)
- {
- HasTazer[playerid] = 0;
- SendClientMessage(playerid, COLOR_WHITE, "INFO: Tazer switched: [OFF]");
- }
- //====================================================
- public OnFilterScriptInit()
- {
- print("");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
- {
- new string[128];
- new Float:health = GetPlayerHealth(playerid, health);
- if(HasTazer[issuerid] == 1) // Checks if the player has been shot by a player with a tazer in-hand.
- {
- SetPlayerHealth(playerid, health);
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
- format(string,sizeof(string),"INFO: You have just been tazered by %s", GetName(issuerid));
- SendClientMessage(playerid, COLOR_WHITE, string);
- SetTimer("BeenTazeredTimer", 6000, 0);
- }
- return 1;
- }
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
- {
- new string[128];
- if(HasTazer[playerid] == 1) // Checks if the player who gives the damage has a tazer in-hand.
- {
- format(string,sizeof(string),"INFO: You have just fired a tazer-shot and hit %s.", GetName(damagedid));
- SendClientMessage(playerid, COLOR_WHITE, string);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- //====================================================
- COMMAND:getup(playerid, params[])
- {
- switch ( BeenTazered[playerid] )
- {
- case 0: // If the players tazer timer is expired.
- {
- ApplyAnimation(playerid,"PED","getup",4.0,0,0,0,0,0);
- }
- case 1: { SendClientMessage(playerid, COLOR_GREY, "INFO: You must wait a 60 second time period before using this command."); }
- }
- return 1;
- }
- COMMAND:tazer(playerid, params[])
- {
- new weapons[13][2];
- for (new i = 0; i < 13; i++)
- {
- GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
- }
- if(weapons[2][0] == 23) { WEAPON = 23; }
- if(HasTazer[playerid] == 0)
- {
- GiveTazer(playerid);
- }
- else
- {
- TakeTazer(playerid);
- GivePlayerWeapon(playerid, WEAPON, 100);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement