Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new TextDrawDinheiro[100][3];
- public OnPlayerConnect(playerid)
- {
- CriarTextDrawDinheiro(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid,reason)
- {
- PlayerTextDrawHide(playerid,TextDrawDinheiro[playerid][0]);
- PlayerTextDrawHide(playerid,TextDrawDinheiro[playerid][1]);
- PlayerTextDrawDestroy(playerid,TextDrawDinheiro[playerid][0]);
- PlayerTextDrawDestroy(playerid,TextDrawDinheiro[playerid][1]);
- return 1;
- }
- forward CriarTextDrawDinheiro(playerid);
- public CriarTextDrawDinheiro(playerid)
- {
- TextDrawDinheiro[playerid][0] = CreatePlayerTextDraw(playerid, 500.519805, 80.433288, "_"); // Dinheiro
- PlayerTextDrawLetterSize(playerid, TextDrawDinheiro[playerid][0], 0.476368, 1.705000);
- PlayerTextDrawTextSize(playerid, TextDrawDinheiro[playerid][0], 607.000000, -0.260000);
- PlayerTextDrawAlignment(playerid, TextDrawDinheiro[playerid][0], 1);
- PlayerTextDrawColor(playerid, TextDrawDinheiro[playerid][0], -1);
- PlayerTextDrawUseBox(playerid, TextDrawDinheiro[playerid][0], 1);
- PlayerTextDrawBoxColor(playerid, TextDrawDinheiro[playerid][0], 255);
- PlayerTextDrawSetShadow(playerid, TextDrawDinheiro[playerid][0], 0);
- PlayerTextDrawSetOutline(playerid, TextDrawDinheiro[playerid][0], 0);
- PlayerTextDrawBackgroundColor(playerid, TextDrawDinheiro[playerid][0], 255);
- PlayerTextDrawFont(playerid, TextDrawDinheiro[playerid][0], 1);
- PlayerTextDrawSetProportional(playerid, TextDrawDinheiro[playerid][0], 1);
- PlayerTextDrawSetShadow(playerid, TextDrawDinheiro[playerid][0], 0);
- TextDrawDinheiro[playerid][1] = CreatePlayerTextDraw(playerid, 499.897552, 76.833312, "~b~$00000000");
- PlayerTextDrawLetterSize(playerid, TextDrawDinheiro[playerid][1], 0.586940, 2.195000);
- PlayerTextDrawAlignment(playerid, TextDrawDinheiro[playerid][1], 1);
- PlayerTextDrawColor(playerid, TextDrawDinheiro[playerid][1], -5963521);
- PlayerTextDrawSetShadow(playerid, TextDrawDinheiro[playerid][1], 0);
- PlayerTextDrawSetOutline(playerid, TextDrawDinheiro[playerid][1], 2);
- PlayerTextDrawBackgroundColor(playerid, TextDrawDinheiro[playerid][1], 255);
- PlayerTextDrawFont(playerid, TextDrawDinheiro[playerid][1], 3);
- PlayerTextDrawSetProportional(playerid, TextDrawDinheiro[playerid][1], 1);
- PlayerTextDrawSetShadow(playerid, TextDrawDinheiro[playerid][1], 0);
- return 1;
- }
- forward //Local que carrega as informações do jogador
- {
- new TextDrawXP[100],FormatarMsg[100];
- TextDrawXP="";
- if(PlayerInfo[playerid][bGCoins] < 10000000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 1000000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 100000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 10000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 1000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 100){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 10){ strcat(TextDrawXP,"0");}
- format(FormatarMsg,100,"~b~$%s%d",TextDrawXP,PlayerInfo[playerid][bGCoins]);
- PlayerTextDrawShow(playerid,TextDrawDinheiro[playerid][0]);
- PlayerTextDrawHide(playerid,TextDrawDinheiro[playerid][1]);
- PlayerTextDrawSetString(playerid,TextDrawDinheiro[playerid][1],FormatarMsg);
- PlayerTextDrawShow(playerid,TextDrawDinheiro[playerid][1]);
- PlayerTextDrawShow(playerid,TextDrawDinheiro[playerid][1]);
- return 1;
- }
- public DarCoin(playerid,Quantidade)
- {
- new AtualizarDb[150],Valor,TextDrawXP[30],MsgValor[50],FormatarMsg[100];
- format(AtualizarDb,150,"SELECT * FROM `accounts` WHERE `Name` = '%s'",Nome(playerid));
- mysql_query(MysqlDb,AtualizarDb,true);
- if(cache_num_rows() >=1)
- {
- cache_get_value_int(0,"XP",Valor);
- }
- Valor += Quantidade;
- format(AtualizarDb,150,"UPDATE `accounts` SET `XP` = '%d' WHERE `Nome` = '%s'",Valor,Nome(playerid)); //mude para coin
- mysql_query(MysqlDb,AtualizarDb,false);
- if(IsPlayerConnected(playerid))
- {
- PlayerInfo[playerid][bGCoins] += Quantidade;
- TextDrawXP="";
- if(PlayerInfo[playerid][bGCoins] < 10000000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 1000000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 100000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 10000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 1000){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 100){ strcat(TextDrawXP,"0");}
- if(PlayerInfo[playerid][bGCoins] < 10){ strcat(TextDrawXP,"0");}
- format(FormatarMsg,100,"~b~$%s%d",TextDrawXP,PlayerInfo[playerid][bGCoins]);
- PlayerTextDrawHide(playerid,TextDrawDinheiro[playerid][1]);
- PlayerTextDrawSetString(playerid,TextDrawDinheiro[playerid][1],FormatarMsg);
- PlayerTextDrawShow(playerid,TextDrawDinheiro[playerid][1]);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement