CMD:cadouri(playerid, params[]) { new BigString[2048], LittleCounterg[10], cadou[512], namestr[MAX_PLAYER_NAME+20]; //-------------------------------------------------------------------------- format(LittleCounterg, 10, "%d", CosminInfo[playerid][Gifts]); TextDrawSetString(GiftsInfo[2], LittleCounterg); TextDrawSetString(GiftsInfo[1], LittleCounterg); //-------------------------------------------------------------------------- foreach(new l: Player) if(CosminInfo[l][Gifts] >= 1) { if(CosminInfo[l][Gifts] == 0) TextDrawShowForPlayer(l, GiftsInfo[2]), TextDrawShowForPlayer(l, GiftsInfo[1]); } //-------------------------------------------------------------------------- format(cadou, 512, "{FFFFFF}Total Gifts: {FF0000}%d", CosminInfo[playerid][Gifts]); //-------------------------------------------------------------------------- format(namestr, MAX_PLAYER_NAME+20, "{FFFFFF}Welcome %s !\n", PlayerName(playerid)); //-------------------------------------------------------------------------- switch(CosminInfo[playerid][Language]) { case 0: { strcat(BigString, namestr); strcat(BigString,"{FF0000}Below you will find some information about gifts.\n\ \n\ {FFFFFF}Hello,I created this system for you, as a sign of thanks for choosing to play here.\n\ {FFFFFF}This system works very easily.\n\ {FFFFFF}When you will receive a gift,use the order {FF0000}/cadouri {FFFFFF}for open ghifts.\n\ {FFFFFF}Continue to have fun\n\ \n\ {FFFFFF}The Best Server: {6699FF}Romania {FFFF1A}Stunt {FF0000}Zone. {FFFFFF}Only For You.\n"); //------------------------------------------------------------------ ShowPlayerDialog(playerid, GiftBoxRandom, DIALOG_STYLE_MSGBOX, cadou, BigString, "Next", "Close"); return 1; } case 1: { strcat(BigString, namestr); strcat(BigString,"{FF0000}Mai jos vei gasi cateva informatii despre cadouri.\n\ \n\ {FFFFFF}Salut,am creat acest system pentru voi,in semn de multumire ca a-ti ales sa jucati aici.\n\ {FFFFFF}Acest system functioneaza foarte usor.\n\ {FFFFFF}Cand primiti un cadou,folositi comanda {FF0000}/cadouri {FFFFFF}pentru a deschide cadourile.\n\ {FFFFFF}Distractie placuta in continuare.\n\ \n\ {FFFFFF}Cel mai tare server: {6699FF}Romania {FFFF1A}Stunt {FF0000}Zone. {FFFFFF}Numai pentru tine.\n"); } } return ShowPlayerDialog(playerid, GiftBoxRandom, DIALOG_STYLE_MSGBOX, cadou, BigString, "Next", "Close"); }
Which of the TXD is responsible for saying the gift number, as shown in this image (the number in red)
https://imgur.com/a/2x4RnhR |
CMD:giveallgift(playerid, params[]) { if(CosminInfo[playerid][King] < 1 && CosminInfo[playerid][ElPatron] < 1 && CosminInfo[playerid][Reaper] < 1 && CosminInfo[playerid][AccRcon] == 0 && CosminInfo[playerid][Management] < 1) return SendError2(playerid,"{FFFFFF}You must to be RCON Admin to use that command!", "{FFFFFF}Trebuie sa fi RCON Admin pentru a folosi comanda respectiva!"); //-------------------------------------------------------------------------- new LittleCounterg[10]; eString[0] = EOS; //-------------------------------------------------------------------------- foreach(new i: Player) CosminInfo[i][Gifts] += 1, PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); CMDMessageToAdmins(playerid, "GiveAllGift"); //-------------------------------------------------------------------------- foreach(new i: Player) Announce(i, "~r~~h~Congratulations!~n~~g~~h~you got +1 gift!~n~~y~Open it with ~n~~r~~h~/ogifts!", 5000, 6); //-------------------------------------------------------------------------- format(LittleCounterg, 10, "%d", CosminInfo[playerid][Gifts]); TextDrawSetString(GiftsInfo[2], LittleCounterg); foreach(new i: Player) TextDrawShowForPlayer(i, GiftsInfo[2]), TextDrawShowForPlayer(i, GiftsInfo[1]); //-------------------------------------------------------------------------- format(eString, sizeof(eString), "Administrator %s gave you +1 Gift!", PlayerName(playerid)); SendClientMessageToAll(COLOR_ABLUE, eString); //-------------------------------------------------------------------------- eLog[0] = EOS; format(eLog, sizeof(eLog), "RCON : %s gave all +1 gift!", PlayerName(playerid)), SendLog(eLog); //-------------------------------------------------------------------------- return 1; }
"GiftsInfo[1]" or "GiftsInfo[2]" is the number of gifts that show in the right down side
|
new PlayerText:TextName[MAX_PLAYERS][Your Array];
// "TextName" is the name of your Text Draw
// "Your Array" is your Array index, if there is.
// Exemple:
TextName[playerid][Array Index];
// In Your case:
GiftsInfo[playerid][2];
new GiftAmount[MAX_PLAYERS] = 0;
new countdown[MAX_PLAYERS];
GiftAmount[playerid] = GiftAmount[playerid]+1;
// Then the command give a gift every time it is typed
new strg[250];
format(strg, sizeof(strg), "%i", GiftAmount[i])
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerTextDrawSetString(i, GiftsInfo[i][2], strg);
PlayerTextDrawShow(i, GiftsInfo[i][2]);
}
countdown[playerid] = GiftAmount[playerid];
countdown[playerid] = countdown[playerid] - 1;
new strg[250];
format(strg, sizeof(strg), "%i", countdown[playerid])
for(new i = 0; i < MAX_PLAYERS; i++)
{
PlayerTextDrawSetString(i, GiftsInfo[i][2], strg);
PlayerTextDrawShow(i, GiftsInfo[i][2]);
}
if(GiftAmount[playerid] == 0)
return SendClientMessage(playerid, RED, "You Haven't gift!");