toribio

toribio

Nov 26th, 2008
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. //no topo:
  2. forward AtualizarGrana();
  3. new playermoney[MAX_PLAYERS];
  4. new Text:gtmoney[MAX_PLAYERS];
  5.  
  6. //no OnGameModeInit:
  7. SetTimer("AtualizarGrana", 250, 1);
  8.  
  9. //no OnPlayerConnect:
  10. gtmoney[playerid] = TextDrawCreate(x, y, "~w~gp: $00000000");
  11. //resto das fun��es do textdraw com o parametro 1 como "gtmoney[playerid]"
  12.  
  13. //no OnPlayerDisconnect:
  14. TextdrawDestroy(gtmoney[playerid]);
  15.  
  16. //no fim do mode:
  17. public AtualizarGrana()
  18. {
  19.     for(new i;i<MAX_PLAYERS;i++)
  20.     {
  21.         new string[128];
  22.         format(string, sizeof(string), "~w~gp: $%08d", playermoney[playerid]);
  23.         TextDrawSetString(gtmoney[playerid], string);
  24.     }
  25. }
  26.  
  27. stock GivePlayerMoneyEx(playerid, ammount)return playermoney[playerid] += ammount;
  28. stock GetPlayerMoneyEx(playerid)return playermoney[playerid];
  29. stock ResetPlayerMoneyEx(playerid)return playermoney[playerid] = 0;
  30.  
  31. //agora voc� pode trocar todas as outras fun��es GivePlayerMoney para GivePlayerMoneyEx, GetPlayerMoney para GetPlayerMoneyEx, e ResetPlayerMoney para ResetPlayerMoneyEx... (caso queria GP...)
Add Comment
Please, Sign In to add comment