Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <cstrike>
  4. #include <colors>
  5.  
  6. public Plugin:myinfo =
  7. {
  8. name = "VIP",
  9. author = "SzYma",
  10. description = "",
  11. version = "1.0.2",
  12. url = "http://3Mod.pl/"
  13. };
  14.  
  15. public OnPluginStart()
  16. {
  17. HookEvent("player_spawn", Event_OnPlayerSpawn);
  18. HookEvent("player_team", Event_TagTable);
  19. HookEvent("player_spawn", Event_TagTable);
  20. }
  21.  
  22. public Event_OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
  23. {
  24. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  25. new team = GetClientTeam(client);
  26. new money = GetEntProp(client, Prop_Send, "m_iAccount");
  27.  
  28. if (client > 0 && IsPlayerAlive(client))
  29. {
  30. if (IsPlayerGenericAdmin(client))
  31. {
  32. PrintToChat(client, "Ai primit Itemele!");
  33. SetEntityHealth(client, 105); //hp
  34. SetEntProp(client, Prop_Send, "m_ArmorValue", 100, 4); //armor
  35. SetEntProp(client, Prop_Send, "m_bHasHelmet", 1); //helm
  36. SetEntProp(client, Prop_Send, "m_iAccount", money + 200); //200$ plus
  37.  
  38. GivePlayerItem(client, "weapon_smokegrenade"); //smoke
  39. GivePlayerItem(client, "weapon_flashbang"); //flash
  40. GivePlayerItem(client, "weapon_hegrenade"); //grenade
  41. GivePlayerItem(client, "weapon_flashbang"); //flash
  42.  
  43. if(team == CS_TEAM_CT)
  44. {
  45. GivePlayerItem(client, "item_defuser"); //kombinerki
  46. }
  47. }
  48. }
  49. }
  50.  
  51. public Action:Event_TagTable(Handle:event, String:name[], bool:dontBroadcast)
  52. {
  53. new client = GetClientOfUserId(GetEventInt(event, "userid"));
  54. if (IsPlayerGenericAdmin(client))
  55. {
  56. CS_SetClientClanTag(client, "[VIP]");
  57. }
  58. }
  59.  
  60. /*
  61. @param client id
  62.  
  63. return bool
  64. */
  65. bool:IsPlayerGenericAdmin(client)
  66. {
  67. return CheckCommandAccess(client, "generic_admin", ADMFLAG_RESERVATION, false);
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement