Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // tal332255 - Tal Peretz סקריפט זה הוכן על ידי המתכנת
- #include <a_samp>
- #include <OnPlayerShootPlayer>
- #pragma tabsize 0
- #define orange 0xFF9900AA
- new PlayerShoot[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("Survey By tal332255 - Tal Peretz");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- PlayerShoot[playerid] = 0;
- SetPVarInt(playerid, "Headshotted", 0);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(GetPVarInt(playerid, "Headshotted") == 1)
- {
- new string[128];
- format(string, sizeof(string), "* וקיבלת $2000 {9B2E5E}%s{FF9900} עשית הד-שוט לשחקן *",GetName(playerid));
- SendClientMessage(killerid,orange, string);
- GivePlayerMoney(killerid, 2000);
- SetPVarInt(playerid, "Headshotted", 0);
- PlayerShoot[playerid] = 0;
- GameTextForPlayer(playerid, "~r~Headshotted", 3000, 3);
- GameTextForPlayer(killerid, "~r~Headshot", 3000, 3);
- }
- return 1;
- }
- public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
- {
- PlayerShoot[Target] = Shooter;
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- new id = GetPlayerAnimationIndex(playerid);
- if(id == 1173 || id == 1175 || id == 1177 || id == 1178)
- {
- new weapon2 = GetPlayerWeapon(PlayerShoot[playerid]);
- if(weapon2 == 24 || weapon2 == 25 || weapon2 == 33 || weapon2 == 34)
- {
- SetPVarInt(playerid, "Headshotted", 1);
- SetPlayerHealth(playerid, 0);
- }
- }
- return 1;
- }
- ///////
- stock GetName(playerid){
- new Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,Name,sizeof(Name));
- return Name;}
- stock GetDistanceFromPointToLine(&Float:distance, Float:line_vector_x, Float:line_vector_y, Float:line_vector_z, Float:line_x, Float:line_y, Float:line_z, Float:point_x, Float:point_y, Float:point_z)
- {
- static Float:output;
- crossp(line_vector_x, line_vector_y, line_vector_z, point_x - line_x, point_y - line_y, point_z - line_z, output);
- distance = output / floatsqroot ((line_vector_x * line_vector_x) + (line_vector_y * line_vector_y) + (line_vector_z * line_vector_z));
- return 0;
- }
- stock crossp(Float:v1x, Float:v1y, Float:v1z, Float:v2x, Float:v2y, Float:v2z, &Float:output)
- {
- new
- Float:c1 = (v1y * v2z) - (v1z * v2y),
- Float:c2 = (v1z * v2x) - (v1x * v2z),
- Float:c3 = (v1x * v2y) - (v1y * v2x);
- output = floatsqroot ((c1 * c1) + (c2 * c2) + (c3 * c3));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment