HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2.  
  3. #define VERSION "0.2"
  4.  
  5. new g_iAccount = -1;
  6. new Handle:Switch;
  7. new Handle:Cash;
  8.  
  9. public Plugin:myinfo =
  10. {
  11. name = "Kezdo Penz",
  12. author = "Peoples Army",
  13. description = "Minden Kornel ad Penzt",
  14. version = VERSION,
  15. url = "www.sourcemod.net"
  16. }
  17.  
  18. public OnPluginStart()
  19. {
  20. g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount");
  21. Switch = CreateConVar("extra_Cash_on","1","1 be 0 ki",FCVAR_NOTIFY);
  22. Cash = CreateConVar("extra_cash_amount","16000","Megadja az osszeget Spawnolaskor",FCVAR_NOTIFY);
  23. HookEvent("player_spawn" , Spawn);
  24. }
  25.  
  26. public Spawn(Handle: event , const String: name[] , bool: dontBroadcast)
  27. {
  28. new clientID = GetEventInt(event,"userid");
  29. new client = GetClientOfUserId(clientID);
  30. if(GetConVarInt(Switch))
  31. {
  32. SetMoney(client,GetConVarInt(Cash));
  33. }
  34. }
  35.  
  36. public SetMoney(client, amount)
  37. {
  38. if (g_iAccount != -1)
  39. {
  40. SetEntData(client, g_iAccount, amount);
  41. }
  42. }