Advertisement
Guest User

ASLPlayer.cs

a guest
May 25th, 2015
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. using SampSharp.GameMode.World;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7.  
  8. namespace ASimpleLife
  9. {
  10.     class AslPlayer : GtaPlayer
  11.     {
  12.         public string hash;
  13.         public int argent;
  14.         public int level;
  15.         public int respect;
  16.         public AdminLevel admin;
  17.  
  18.         public enum AdminLevel {
  19.             Normal,
  20.             Moderator,
  21.             Admin,
  22.             Owner
  23.         };
  24.  
  25.         public AslPlayer(int id)
  26.             : base(id)
  27.         {
  28.  
  29.         }
  30.  
  31.         public void DefineASL(string hash, int argent, int level, int respect, AdminLevel admin)
  32.         {
  33.             this.hash = hash;
  34.             this.argent = argent;
  35.             this.level = level;
  36.             this.respect = respect;
  37.             this.admin = admin;
  38.         }
  39.  
  40.         #region Money management
  41.  
  42.         public void SetMoney(int amount)
  43.         {
  44.             this.argent = amount;
  45.             this.ActualizeClientMoney();
  46.         }
  47.  
  48.         public void GiveMoney(int amount)
  49.         {
  50.             this.argent += amount;
  51.             ActualizeClientMoney();
  52.         }
  53.  
  54.         public void TakeMoney(int amount)
  55.         {
  56.             this.GiveMoney(amount * -1);
  57.         }
  58.  
  59.         private void ActualizeClientMoney()
  60.         {
  61.             this.Money = this.argent;
  62.         }
  63.  
  64.         #endregion
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement