Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.53 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4.  
  5. new bool:UseMenu[32] = false;
  6. new bool:Respawn[32] = false;
  7. new bool:Respawn2[32] = false;
  8. public Plugin myinfo =
  9. {
  10. name = "Vip DeathRun",
  11. author = "LukMcCall",
  12. description = "Vip DeathRun",
  13. version = "1.0",
  14. url = "http://www.cswild.pl/"
  15. };
  16.  
  17. public void OnPluginStart()
  18. {
  19. RegConsoleCmd("vipmenu", Vip, "Otworz menu vipa");
  20.  
  21. HookEvent("player_death", Event_PlayerDeath);
  22. HookEvent("round_start", OnRoundStart, EventHookMode_PostNoCopy);
  23. }
  24.  
  25. public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
  26. {
  27. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  28. if((IsVip(client) && Respawn2[client] == true)){
  29. Respawn[client] = true;
  30. Respawn2[client] = false;
  31. CreateTimer(0.2, Resawn, client, 0);
  32. PrintToChat(client, "\x01 \x04[Vip] \x02Masz drugą szansę!");
  33. }
  34. }
  35.  
  36. public Action:Resawn(Handle:timer, any:client)
  37. {
  38. CS_RespawnPlayer(client);
  39. }
  40.  
  41. public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
  42. {
  43. PrintToServer("StartRundy");
  44. for(new i = 1; i<=31; i++){
  45. UseMenu[i] = false;
  46. Respawn[i] = false;
  47. Respawn2[i] = false;
  48.  
  49. if(IsValidClient(i) && (IsVip(i))){
  50. SetEntPropFloat( i, Prop_Data, "m_flGravity", 1.0);
  51. SetEntPropFloat( i, Prop_Data, "m_flLaggedMovementValue", 1.0);
  52.  
  53. if(GetClientTeam(i) == 3){
  54. Vip(i,0);
  55. }
  56. }
  57. }
  58. }
  59.  
  60. public Action Vip(int client, int args)
  61. {
  62. if(IsVip(client))
  63. {
  64. if(UseMenu[client] == false){
  65. new Handle:h_menu = CreateMenu(VipMenu);
  66. SetMenuTitle(h_menu, "Vip Menu");
  67. AddMenuItem(h_menu, "gravity", "-30% Grawitacja");
  68. AddMenuItem(h_menu, "speed", "+50% Speeda");
  69. AddMenuItem(h_menu, "hp", "+50 Hp");
  70. AddMenuItem(h_menu, "armor", "+100 Armora");
  71.  
  72.  
  73.  
  74. DisplayMenu(h_menu, client, 250);
  75. }
  76. else{
  77. PrintToChat(client, "\x01 \x04[Vip] \x02Użyłeś już menu!");
  78. }
  79. }
  80. else{
  81. PrintToChat(client, "\x01 \x04[Vip] \x02Nie masz dostępu do tej komendy!");
  82. }
  83. }
  84.  
  85. public VipMenu(Handle:h_menu, MenuAction:action, Client, Position){
  86. if(action == MenuAction_Select){
  87.  
  88. decl String:Item[20];
  89. GetMenuItem(h_menu, Position, Item, sizeof(Item));
  90.  
  91. if(StrEqual(Item, "gravity")){
  92. SetEntPropFloat( Client, Prop_Data, "m_flGravity", 0.7);
  93. PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś -30%% Grawitacja");
  94. UseMenu[Client] = true;
  95. }
  96. else if(StrEqual(Item, "speed")){
  97. SetEntPropFloat( Client, Prop_Data, "m_flLaggedMovementValue", 1.5);
  98. PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś +50%% Speeda");
  99. UseMenu[Client] = true;
  100. }
  101. else if(StrEqual(Item, "hp")){
  102. SetEntProp(Client, Prop_Send, "m_iHealth", 150);
  103. PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś +50 Hp");
  104. UseMenu[Client] = true;
  105. }
  106. else if(StrEqual(Item, "armor")){
  107. SetEntProp(Client, Prop_Send, "m_ArmorValue", 100);
  108. PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś +100 Armora");
  109. UseMenu[Client] = true;
  110. }
  111. else if(StrEqual(Item, "life")){
  112. PrintToChat(Client, "\x01 \x04[Vip] \x02Wybrałeś 2x życie");
  113. Respawn2[Client] = true;
  114. UseMenu[Client] = true;
  115. }
  116. }else if(action == MenuAction_End){
  117. CloseHandle(h_menu);
  118. }
  119. }
  120.  
  121. public bool:IsValidClient(client)
  122. {
  123. if (client <= 0 || client > MaxClients || !IsClientConnected(client) || IsFakeClient(client))
  124. {
  125. return false;
  126. }
  127. return IsClientInGame(client);
  128. }
  129.  
  130. public bool:IsVip(client)
  131. {
  132. if(GetUserFlagBits(client) & ADMFLAG_CUSTOM6 ) return true;
  133. return false;
  134. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement