Advertisement
Guest User

Untitled

a guest
Mar 28th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.05 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #include <sourcemod>
  4. #include <sdktools>
  5. #include <cstrike>
  6. #include <clientprefs>
  7. #include <colors>
  8. #include <loghelper>
  9.  
  10. public Plugin:myinfo =
  11. {
  12. name = "VIP Plugin",
  13. author = "hanys",
  14. description = "vip plugin",
  15. version = "1.0",
  16. url = "http://cs-wojak.com"
  17. };
  18.  
  19. public OnPluginStart()
  20. {
  21. //RegConsoleCmd("say", Command_SendToAll);
  22. //RegConsoleCmd("say_team", Command_SendToTeam);
  23.  
  24. HookEvent("player_spawn", Event_OnPlayerSpawn);
  25. HookEvent("bomb_planted", Event_BombPlanted);
  26. HookEvent("bomb_defused", Event_BombDefused);
  27. HookEvent("player_death", Event_PlayerDeath);
  28. HookEvent("player_team", Event_TagTable);
  29. HookEvent("player_spawn", Event_TagTable);
  30.  
  31. //CreateTimer(5.0, Timer_Copy, _, TIMER_REPEAT);
  32. }
  33.  
  34. public Action:Timer_Copy(Handle:timer)
  35. {
  36. PrintToChatAll("\x01[\x04DEMO\x01]\x04 PLUGIN DEMO PLUGIN DEMOPLUGIN DEMOPLUGIN DEMO");
  37. }
  38.  
  39. public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  40. {
  41. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  42. new money = GetEntProp(client, Prop_Send, "m_iAccount");
  43.  
  44. if (client > 0 && IsPlayerAlive(client))
  45. {
  46. if (IsPlayerGenericAdmin(client))
  47. {
  48. SetEntityHealth(client, 110); //hp
  49. SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 1); //armor
  50. GivePlayerItem(client, "weapon_smokegrenade"); //smoke
  51. GivePlayerItem(client, "weapon_flashbang"); //flash
  52. GivePlayerItem(client, "weapon_hegrenade"); //grenade
  53.  
  54. SetEntProp(client, Prop_Send, "m_iAccount", money + 200); //200$ plus
  55.  
  56.  
  57. }
  58. }
  59. }
  60.  
  61. public Event_BombPlanted(Handle:event, const String:name[], bool:dontBroadcast)
  62. {
  63. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  64. new money = GetEntProp(client, Prop_Send, "m_iAccount");
  65.  
  66. if (IsPlayerGenericAdmin(client))
  67. {
  68. SetEntProp(client, Prop_Send, "m_iAccount", money + 200); //200$ plus
  69. }
  70. }
  71.  
  72. public Event_BombDefused(Handle:event, const String:name[], bool:dontBroadcast)
  73. {
  74. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  75. new money = GetEntProp(client, Prop_Send, "m_iAccount");
  76.  
  77. if (IsPlayerGenericAdmin(client))
  78. {
  79. SetEntProp(client, Prop_Send, "m_iAccount", money + 200); //200$ plus
  80. }
  81. }
  82.  
  83. public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
  84. {
  85. new attacker = GetClientOfUserId(GetEventInt(event, "attacker"));
  86. new money = GetEntProp(attacker, Prop_Send, "m_iAccount");
  87.  
  88. new bool:headshot = GetEventBool(event, "headshot");
  89. if (IsPlayerGenericAdmin(attacker))
  90. {
  91. if(headshot){
  92. SetEntProp(attacker, Prop_Send, "m_iAccount", money + 150); //150$ plus for hs
  93. }else{
  94. SetEntProp(attacker, Prop_Send, "m_iAccount", money + 100); //100$ plus for kill
  95. }
  96. }
  97. }
  98.  
  99. public Action:Event_TagTable(Handle:event, String:name[], bool:dontBroadcast)
  100. {
  101. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  102. if (IsPlayerGenericAdmin(client))
  103. {
  104. CS_SetClientClanTag(client, "[VIP]");
  105. }
  106. }
  107.  
  108. public Action:Command_SendToAll(client, args)
  109. {
  110. if (IsPlayerGenericAdmin(client))
  111. {
  112. decl String:sTextToAll[1024];
  113. GetCmdArgString(sTextToAll, sizeof(sTextToAll));
  114. StripQuotes(sTextToAll);
  115. LogPlayerEvent(client, "say=", sTextToAll);
  116.  
  117. new team = GetClientTeam(client);
  118.  
  119. if(IsPlayerAlive(client) && team == 2 || team == 3)
  120. {
  121. PrintToChatAll("\x01[\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  122. }
  123. /* Player isn't alive and have team (no spec) */
  124. else if(!IsPlayerAlive(client) && team == 2 || team == 3)
  125. {
  126. PrintToChatAll("\x01*NIE ŻYJE* [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  127. }
  128. /* Player is in spectate */
  129. else if(!IsPlayerAlive(client) && team != 2 && team != 3)
  130. {
  131. PrintToChatAll("\x01*OBSERWATOR* [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  132. }
  133.  
  134. return Plugin_Handled;
  135. }
  136.  
  137. return Plugin_Continue;
  138. }
  139.  
  140. public Action:Command_SendToTeam(client, args)
  141. {
  142. if (IsPlayerGenericAdmin(client))
  143. {
  144. decl String:sTextToAll[1024];
  145. GetCmdArgString(sTextToAll, sizeof(sTextToAll));
  146. StripQuotes(sTextToAll);
  147. LogPlayerEvent(client, "say=", sTextToAll);
  148.  
  149. new team = GetClientTeam(client);
  150.  
  151. if(IsPlayerAlive(client) && team == 2 || team == 3)
  152. {
  153. for(new i = 1; i <= MaxClients; i++)
  154. {
  155. if(IsClientInGame(i))
  156. {
  157. new PlayersTeam = GetClientTeam(i);
  158. if(PlayersTeam & team)
  159. {
  160. if(team == 2)
  161. PrintToChat(i, "\x01(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  162. else
  163. PrintToChat(i, "\x01(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  164. }
  165. }
  166. }
  167. }
  168. /* Player isn't alive and have team (no spec) */
  169. else if(!IsPlayerAlive(client) && team == 2 || team == 3)
  170. {
  171. for(new i = 1; i <= MaxClients; i++)
  172. {
  173. if(IsClientInGame(i) && !IsPlayerAlive(i))
  174. {
  175. new PlayersTeam = GetClientTeam(i);
  176. if(PlayersTeam & team)
  177. {
  178. if(team == 2)
  179. PrintToChat(i, "\x01*NIE ŻYJE*(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  180. else
  181. PrintToChat(i, "\x01*NIE ŻYJE*(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  182. }
  183. }
  184. }
  185. }
  186. /* Player is in spectate */
  187. else if(!IsPlayerAlive(client) && team != 2 && team != 3)
  188. {
  189. for(new i = 1; i <= MaxClients; i++)
  190. {
  191. if(IsClientInGame(i) && !IsPlayerAlive(i))
  192. {
  193. new PlayersTeam = GetClientTeam(i);
  194. if(PlayersTeam & team)
  195. {
  196. if(team == 2)
  197. PrintToChat(i, "\x01*OBSERWATOR*(Terrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  198. else
  199. PrintToChat(i, "\x01*OBSERWATOR*(Antyterrorysta) [\x04VIP\x01]\x05 %N \x01%s", client, sTextToAll);
  200. }
  201. }
  202. }
  203. }
  204.  
  205. return Plugin_Handled;
  206. }
  207.  
  208. return Plugin_Continue;
  209. }
  210.  
  211. /*
  212. @param client id
  213.  
  214. return bool
  215. */
  216. bool:IsPlayerGenericAdmin(client)
  217. {
  218. if (CheckCommandAccess(client, "generic_admin", ADMFLAG_CUSTOM6, false))
  219. {
  220. return true;
  221. }
  222.  
  223. return false;
  224. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement