Jump to content

Mecanicul

Membru
  • Posts

    6
  • Joined

  • Last visited

Posts posted by Mecanicul

  1. 1 hour ago, Banditul said:

    Eventual poti face asa desi depinde cum ti-ai facut if-urile in comanda nu pot garanta ca nu iti va mai aparea si mesajul de sintaxa

    CheckAdmin(playerid, level)
    {
    	if(PlayerInfo[playerid][pAdmin] < level) 
        {
    		return SendClientMessage(playerid, COLOR_LIGHTGREEN3, "You are not allowed to use this command.");
        }
    }

    Eventual poti citi mai multe despre ce face foreach aici: https://github.com/pawn-lang/YSI-Includes/blob/5.x/YSI_Data/y_iterate.md pentru ca nu ai nevoie de el in ce  voiai sa faci absolut deloc

    Ti-as sugera eventual o alta posibila abordare ca sa iti scoata eventual in evidenta exact ce cod va fi executat si unde se va opri

    IsPlayerAdminOfLevel(playerid, level)
    {
    	return PlayerInfo[playerid][pAdmin] < level;
    }

    Si o poti folosi

    CMD:comanda(playerid, params[])
    {
    	if (IsPlayerAdminOfLevel(playerid, level) == false)
    		return SendClientMessage(playerid, COLOR_LIGHTGREEN3, "You are not allowed to use this command.");
    
    	// Restul de cod
    }

     

    Multumesc! Am inteles ce mi-ai explicat tu acolo! 

  2. stock checkadmin(level)
    {
        foreach(new x : Player)
        {
            if(PlayerInfo[playerid][pAdmin] < level) 
            {
                SCM(x, COLOR_LIGHTGREEN3, "You are not allowed to use this command.");
            }
        }
        return true;
    }
    Vreau sa fac un stock pentru verificarea admin sa nu scriu de fiecare data la comanda if(playerInfo[playerid][pAdmin] < 6) return SCM etc etc

     

    vreau sa imi fie mai usor, stock-ul merge, tu ca player nu merge sa folosesti comanda, dar imi arata mesajul, dar si sintaxa.

    Daca vreau sa folosesc /a salut, imi apare doar mesajul, si daca scriu doar /a imi arata si mesajul si sintaxa (syntax: /a [ message ])

     

×
×
  • 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.