Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.19 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdkhooks>
  3. #include <sdktools>
  4. #include <codmod>
  5. #include <emitsoundany>
  6.  
  7. new const String:nazwa[] = "[VIP] Sławek";
  8. new const String:opis[] = "Stawia wybuchowa gasnice-teleport, moc +int";
  9. new const String:bronie[] = "#weapon_aug#weapon_glock#weapon_hegrenade#weapon_flashbang#weapon_flashbang#weapon_smokegrenade";
  10. new const inteligencja = 0;
  11. new const zdrowie = 10;
  12. new const obrazenia = 10;
  13. new const wytrzymalosc = 20;
  14. new const kondycja = 0;
  15.  
  16. int g_iPlayerTime[MAXPLAYERS];
  17. new bool:ma_klase[65],
  18. ilosc_ladunkow_gracza[65],
  19. podlozony_ladunek_gracza[65];
  20. new Float: SAVELOC[MAXPLAYERS + 1][3];
  21. Float: ResetVector[3] = {0.0, 0.0, 0.0};
  22. new sprite_explosion;
  23. ConVar cododepchniecie;
  24. #define PREFIX "\x01\x0B \x02[cs-placzabaw.pl]\x01"
  25. #define KURWAMAC "surf_dzwieki/teleport1.mp3"
  26.  
  27. public Plugin:myinfo =
  28. {
  29. name = nazwa,
  30. author = "Linux`",
  31. description = "Cod Klasa",
  32. version = "1.0",
  33. url = "http://steamcommunity.com/id/linux2006"
  34. };
  35. public OnPluginStart()
  36. {
  37. cod_register_class(nazwa, opis, bronie, inteligencja, zdrowie, obrazenia, wytrzymalosc, kondycja);
  38. HookEvent("player_spawn", OdrodzenieGracza);
  39. HookEvent("player_death", SmiercGracza);
  40. cododepchniecie = CreateConVar("cododepchniecie", "50", "Szybkosc lotu odepchnietego");
  41. }
  42. public void OnClientPutInServer(int client)
  43. {
  44. g_iPlayerTime[client]=0;
  45. }
  46. public void OnMapStart()
  47. {
  48. PrecacheModel("models/props/cs_office/fire_extinguisher.mdl");
  49. sprite_explosion = PrecacheModel("materials/sprites/blueflare1.vmt");
  50. AddFileToDownloadsTable("sound/surf_dzwieki/teleport1.mp3");
  51. PrecacheSoundAny(KURWAMAC, true);
  52. }
  53. public cod_class_enabled(client)
  54. {
  55. ma_klase[client] = true;
  56. ilosc_ladunkow_gracza[client] = 3;
  57. if(GetUserFlagBits(client) & ADMFLAG_RESERVATION)
  58. {
  59. ma_klase[client] = true;
  60. return COD_CONTINUE;
  61. }
  62. PrintToChat(client, "%s Klasa dostępna tylko dla posiadaczy VIP", PREFIX);
  63. return COD_STOP;
  64. }
  65. public cod_class_disabled(client)
  66. {
  67. ma_klase[client] = false;
  68. ilosc_ladunkow_gracza[client] = 0;
  69. StopLadunek(client);
  70. }
  71. public cod_class_skill_used(client)
  72. {
  73. if(podlozony_ladunek_gracza[client] && IsValidEntity(podlozony_ladunek_gracza[client]) && g_iPlayerTime[client]<=GetTime())
  74. {
  75. podlozony_ladunek_gracza[client] = 1;
  76. EmitSoundToAllAny(KURWAMAC, client);
  77. CreateTimer(1.8, KURWAMACC, client);
  78. g_iPlayerTime[client]=GetTime()+5;
  79. }
  80. else if(!ilosc_ladunkow_gracza[client])
  81. PrintToChat(client, "%s Wykorzystales juz moc swojej klasy w tym zyciu!", PREFIX);
  82. else
  83. {
  84. podlozony_ladunek_gracza[client] = CreateEntityByName("hegrenade_projectile");
  85. if(podlozony_ladunek_gracza[client] != -1)
  86. {
  87. GetClientAbsOrigin(client, SAVELOC[client]);
  88. new Float:forigin[3];
  89. GetClientEyePosition(client, forigin);
  90.  
  91. new Float:fangles[3];
  92. GetClientEyeAngles(client, fangles);
  93.  
  94. new Float:iangles[3] = {0.0, 0.0, 0.0};
  95. iangles[1] = fangles[1];
  96.  
  97. DispatchSpawn(podlozony_ladunek_gracza[client]);
  98. ActivateEntity(podlozony_ladunek_gracza[client]);
  99. SetEntityModel(podlozony_ladunek_gracza[client], "models/props/cs_office/fire_extinguisher.mdl");
  100. SetEntityMoveType(podlozony_ladunek_gracza[client], MOVETYPE_STEP);
  101. TeleportEntity(podlozony_ladunek_gracza[client], forigin, iangles, NULL_VECTOR);
  102. SetEntProp(podlozony_ladunek_gracza[client], Prop_Send, "m_usSolidFlags", 12);
  103. SetEntProp(podlozony_ladunek_gracza[client], Prop_Data, "m_nSolidType", 6);
  104. SetEntProp(podlozony_ladunek_gracza[client], Prop_Send, "m_CollisionGroup", 1);
  105.  
  106. ReplyToCommand(client, "Podłożyłeś gaśnicę! Użyj ponownie, aby się do niej przenieść!", PREFIX);
  107. ilosc_ladunkow_gracza[client] = 0;
  108. }
  109. }
  110. }
  111. public Action:StopLadunek(client)
  112. {
  113. if(podlozony_ladunek_gracza[client])
  114. {
  115. if(IsValidEntity(podlozony_ladunek_gracza[client]))
  116. AcceptEntityInput(podlozony_ladunek_gracza[client], "Kill");
  117.  
  118. podlozony_ladunek_gracza[client] = 0;
  119. }
  120.  
  121. return Plugin_Continue;
  122. }
  123. public Action:OdrodzenieGracza(Handle:event, String:name[], bool:dontBroadcast)
  124. {
  125. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  126. if(!IsValidClient(client) || !ma_klase[client])
  127. return Plugin_Continue;
  128.  
  129. StopLadunek(client);
  130. ilosc_ladunkow_gracza[client] = 3;
  131.  
  132. return Plugin_Continue;
  133. }
  134. public Action:SmiercGracza(Handle:event, String:name[], bool:dontbroadcast)
  135. {
  136. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  137. if(!IsValidClient(client) || !ma_klase[client])
  138. return Plugin_Continue;
  139.  
  140. StopLadunek(client);
  141. return Plugin_Continue;
  142. }
  143. public Action:KURWAMACC(Handle:timer, client)
  144. {
  145. if(!IsValidClient(client) || !ma_klase[client])
  146. {
  147. new Float: pos[3];
  148. new Float:forigin[3], Float:iorigin[3];
  149. GetEntPropVector(podlozony_ladunek_gracza[client], Prop_Send, "m_vecOrigin", forigin);
  150. pos = SAVELOC[client];
  151. TeleportEntity(client, pos, NULL_VECTOR, ResetVector);
  152. new damage = 20+(cod_get_user_maks_intelligence(client));
  153. for(new i = 1; i <= MaxClients; i++)
  154. {
  155. if(!IsClientInGame(i) || !IsPlayerAlive(i))
  156. continue;
  157.  
  158. if(GetClientTeam(client) == GetClientTeam(i))
  159. continue;
  160.  
  161. GetClientEyePosition(i, iorigin);
  162. if(GetVectorDistance(forigin, iorigin) <= 450.0)
  163. {
  164. cod_inflict_damage(i, client, damage);
  165. }
  166. }
  167. TE_SetupExplosion(forigin, sprite_explosion, 20.0, 1, 0, 100, 1000);
  168. TE_SendToAll();
  169. ForcePush(client);
  170. StopLadunek(client);
  171. }
  172. return Plugin_Continue;
  173. }
  174. public void ForcePush(int client)
  175. {
  176. float clientPos[3], enemyPos[3], pushVel[3];
  177. GetClientAbsOrigin(client, clientPos);
  178. for (int i = 1; i <= MaxClients; i++)
  179. {
  180. if(!IsValidClient(i) || !IsPlayerAlive(i))
  181. continue;
  182.  
  183. if(GetClientTeam(i) == GetClientTeam(client))
  184. continue;
  185.  
  186. GetClientAbsOrigin(i, enemyPos);
  187. float distance = GetVectorDistance(enemyPos, clientPos);
  188. //Avoid dividing by 0
  189. distance = (distance > 0.0) ? distance : 1.0;
  190.  
  191. if(distance > 450)
  192. continue;
  193.  
  194. SubtractVectors(clientPos, enemyPos, pushVel);
  195.  
  196. pushVel[0] = -pushVel[0];
  197. pushVel[1] = -pushVel[1];
  198. pushVel[2] = cododepchniecie.FloatValue;
  199. ScaleVector(pushVel, cod_get_user_maks_intelligence(client)*0.8);
  200. TeleportEntity(i, NULL_VECTOR, NULL_VECTOR, pushVel);
  201. }
  202. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement