Jump to content

Adaugare deelay


FeVosFeR

Recommended Posts

Salut! Am comanda [/pa]:

Spoiler

CMD:pa(playerid,params[])
{
    if(PlayerChatActiv == 1)
    {
        if (PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pAdmin] <= 0 || PlayerInfo[playerid][pLeader] >= 1)
        {
            new string[250],result[250],sendername[25];
            if(sscanf(params, "s[250]",result)) return SendClientMessage(playerid, COLOR_WHITE, "{FF9900}Scrie: {33CCFF}/pa <Message>");
               GetPlayerName(playerid, sendername, sizeof(sendername));
            {
                   new estegrad[MAX_STRING];
                   if(PlayerInfo[playerid][pAdmin] <= 0) estegrad = "Civil";
                   if(PlayerInfo[playerid][pLeader] >= 1) estegrad = "Leader";
                if(PlayerInfo[playerid][pAdmin] == 1) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 2) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 3) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 4) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 5) estegrad = "Admin";
                 if(PlayerInfo[playerid][pAdmin] == 6) estegrad = "{FFFF00}Supervizor";
                 if(PlayerInfo[playerid][pAdmin] == 7) estegrad = "{FF0000}Fondator";
                 if(PlayerInfo[playerid][pAdmin] == ? estegrad = "{33FFFF}Fondator{FFFFFF} & {990033}Scripter{FF0000}";
                format(string, sizeof(string), "[/pa]: %s %s: %s",estegrad , sendername, result);
            }
            APlayerCast(COLOR_BLUE, string,1);
        }

    }
    else return SendClientMessage(playerid, COLOR_WHITE, "Aceasta comanda a fost dezactivata temporar de catre un administrator.");
    return 1;
}

Cum i-as putea adauga deelay? Gen un player sa poata scrie pe [/pa] o data la 5 secunde.

Link to comment
Share on other sites

  • 1 month later...
On 3/24/2019 at 1:40 PM, Quinder said:

Ce fel de comanda este [/pa] ?
 

Esti pamant de flori, a pus comanda intr-un citat! 

Ai nevoie de ajutor in scripting si nu ai bani? Te pot ajuta cu mare drag. Dar asta nu inseamna sa iti lucrez un Sistem de joc complet, daca ai nevoie de ajutor ma poti contacta pe Discord.ezgif-2-3a38433e2465.gif.9283810e304f5e405309769455e5e14b.gif

Link to comment
Share on other sites

CMD:pa(playerid,params[])
{
    if(PlayerChatActiv == 1)
    {
    	if(gettime() < GetPVarInt(playerid, "padeelay")) return va_SendClientMessage(playerid, -1, "Mai de asteptat %d secunde.", gettime() - GetPVarInt(playerid, "padeelay"));
        if (PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pAdmin] <= 0 || PlayerInfo[playerid][pLeader] >= 1)
        {
            new string[250],result[250],sendername[25];
            if(sscanf(params, "s[250]",result)) return SendClientMessage(playerid, COLOR_WHITE, "{FF9900}Scrie: {33CCFF}/pa <Message>");
               GetPlayerName(playerid, sendername, sizeof(sendername));
            {
                   new estegrad[MAX_STRING];
                   if(PlayerInfo[playerid][pAdmin] <= 0) estegrad = "Civil";
                   if(PlayerInfo[playerid][pLeader] >= 1) estegrad = "Leader";
                if(PlayerInfo[playerid][pAdmin] == 1) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 2) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 3) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 4) estegrad = "Admin";
                if(PlayerInfo[playerid][pAdmin] == 5) estegrad = "Admin";
                 if(PlayerInfo[playerid][pAdmin] == 6) estegrad = "{FFFF00}Supervizor";
                 if(PlayerInfo[playerid][pAdmin] == 7) estegrad = "{FF0000}Fondator";
                 if(PlayerInfo[playerid][pAdmin] == ? estegrad = "{33FFFF}Fondator{FFFFFF} & {990033}Scripter{FF0000}";
                format(string, sizeof(string), "[/pa]: %s %s: %s",estegrad , sendername, result);
            }
            APlayerCast(COLOR_BLUE, string,1);
            SetPVarInt(playerid, "padeelay", gettime() + 5);
        }

    }
    else return SendClientMessage(playerid, COLOR_WHITE, "Aceasta comanda a fost dezactivata temporar de catre un administrator.");
    return 1;
}

Sa ai si #include <YSI\y_va> altfel te poti folosi si de un format string.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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