byted

[TUTORIAL] Criar sistema de cash/gold/dinheiro

Apr 5th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.60 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4. new _@Gold[MAX_PLAYERS];
  5.  
  6. stock s_Gold(playerid,const unidades) return _@Gold[playerid] = unidades;//Seta
  7. stock d_Gold(playerid,const unidades) return _@Gold[playerid] + unidades;//Adciona
  8. stock r_Gold(playerid,const unidades) return _@Gold[playerid] - unidades;//Diminui
  9. stock c_Gold(playerid) return _@Gold[playerid] = 0;//Reseta
  10.  
  11. public OnPlayerConnect(playerid)
  12. {
  13.     s_Gold(playerid,50);
  14.     return 1;
  15. }
  16.  
  17. CMD:vida(playerid)
  18. {
  19.     if(!(_@Gold[playerid] >= 20)) return SendClientMessage(playerid,-1,"Golds insuficientes");
  20.     SetPlayerHealth(playerid,100);
  21.     return 1;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment