Jump to content
  • 0

Intrebare tutorial TD reports


Cata12X

Question

Problema intalnita (descriere):Am urmat tutorialul al lui mister si nu stiu la deleteallreports ce trebuie sa pun sa seteze td 0

am incercat mai multe variante dar nici una nu a mers NumarReport--; dar nu merge am incercat sa pun NumarReport 0; dar nu merge si nu stiu ce ar trebui sa pun 
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):
Ati incercat sa rezolvati singur?:

Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

In loc de NumarReport-- pui NumarReport = 0; si reapelezi functia in care ai creeat textdraw-ul . Iti recomand sa faci un public cu acel textdraw (daca nu ai) si la fiecare update la NumarReport apelezi callback-ul respectiv .

  • Upvote 1
Link to comment
Share on other sites

  • 0
Acum 14 ore, NoNamed a spus:

In loc de NumarReport-- pui NumarReport = 0; si reapelezi functia in care ai creeat textdraw-ul . Iti recomand sa faci un public cu acel textdraw (daca nu ai) si la fiecare update la NumarReport apelezi callback-ul respectiv .

Dar daca eu ii dau admin la un player nu apare td pana nu ii dau respawn si daca ii scot adminu nu dispare td pana acel palyer nu iese din joc , in cazu acesta daca stii ce pot face

Link to comment
Share on other sites

  • 0
  • 0
Acum 2 ore, NoNamed a spus:

La makeadmin apelezi din nou acel callback cu textdraw-ul . Faci si tu in callback o verificare , daca player-ul are admin >= 1 sa il afiseze, daca nu, nu .

AM ADAUGAT LA COMANDA /SETADMIN SI NU DISPARE CAND SCOT ADMINUL AUTOMAT

  if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
                 TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);
 

Link to comment
Share on other sites

  • 0
44 minutes ago, NoNamed said:

Poi nu mai pui verificarea, la /setadmin . Pui doar TextDrawShowForPlayer .

pune la comanda TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

2 hours ago, Cata12X said:

AM ADAUGAT LA COMANDA /SETADMIN SI NU DISPARE CAND SCOT ADMINUL AUTOMAT

  if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
                 TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);
 

Pune la comanda TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

Edited by Edduard

text.gif

SKIPE : EDUARD.SENNOW

Link to comment
Share on other sites

  • 0
Acum 47 minute, NoNamed a spus:

Poi nu mai pui verificarea, la /setadmin . Pui doar TextDrawShowForPlayer .

Tot nu merge asta este comanda poate nu am pus eu bine

 

CMD:setadmin(playerid, params[])
{
    if(playerVariables[playerid][pAdminLevel] >= 8 || EsteManager(playerid))
    {
        new
            playeradmid,
            playername[60],
            level,
            string[256];

        if(sscanf(params, "s[60]i", playername,level)) return SendClientMessage(playerid, COLOR_GREY, SYNTAX_MESSAGE"/setadmin [exact player name] [level]");
        {
            playeradmid = GetPlayerID(playername);
            if(IsPlayerConnected(playeradmid))
            {
                if(level >= 0 && level <= 8)
                {
                    GetPlayerName(playeradmid, szPlayerName, MAX_PLAYER_NAME);
                    format(string, sizeof(string), "You have made %s a level %d admin.", szPlayerName, level);
                    SendClientMessage(playerid, COLOR_WHITE, string);

                    GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

                    if(level == 0) format(string, sizeof(string), "Administrator %s has removed you from the admins team.", szPlayerName);
                    else if(level >= playerVariables[playeradmid][pAdminLevel]) format(string, sizeof(string), "Administrator %s has promoted you to a level %d admin.", szPlayerName, level);
                    else if (level <= playerVariables[playeradmid][pAdminLevel]) format(string, sizeof(string), "Administrator %s has demoted you to a level %d admin.", szPlayerName, level);

                    SendClientMessage(playeradmid, COLOR_NICESKY, string);

                    playerVariables[playeradmid][pAdminLevel] = level;
                }
                else SendClientMessage(playerid, COLOR_GREY, "Valid admins levels are 0 to 8.");
            }
            else
            {
                new query[500];

                new aString[500];

                format(query, 500,"UPDATE playeraccounts SET playerAdminLevel = '%d' WHERE playerName = '%s'", level, playername);
                mysql_tquery(handle,query);

                format(aString, sizeof(aString), "Offline: You have made %s admin level %d.", playername, level);
                SCM(playerid,COLOR_BLUE, aString);
                 TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);

            }
        }
    }
    return 1;
}
 

Link to comment
Share on other sites

  • 0

Salut,pune cum spui tu in comanda chestia asta.

if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
          {
		  TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);
		  }
		  else
		  {
		   TextDrawHideForPlayer(playerid,TextdrawReport[playerid]);
		  }

Daca nu va merge,fa un

forward TextDrawReports(playerid);

public TextDrawReports(playerid)

{

if(playerVariables[playerid][pAdminLevel] >= 1 || playerVariables[playerid][pHelper] >= 1)
          {
          TextDrawShowForPlayer(playerid,TextdrawReport[playerid]);
          }
          else
          {
           TextDrawHideForPlayer(playerid,TextdrawReport[playerid]);
          }

        return 1;

}

Iar la OnPlayerSpawn pune

SetTimer("TextDrawReports", 1000, true);

 

PS: Daca il pui la OnPlayerSpawn aceasta functie va vedea in fiecare secunda daca X este admin sau nu,daca este admin ii va arata textdraw-ul cu reports,daca nu nu il va arata.

Atentie!S-ar putea sa nu ii dispara textdraw-ul cu reports dupa ce ii scoti adminul,daca nuu ii dispare pune acel timer la OnGameModeInit.

 

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.