Jump to content
  • 0

Ajutor scripting.


KiNGzOR

Question

Salut,as dorii si eu sa ma ajutati sa imi spuneti la comanda asta cum as putea sa pun sa nu conteze levelul,ci sa poata sa o foloseasca doar odata,si odata ce o folosesc sa nu mai poata sa le scrie asa "Ai luat deja cadoul de Mos Craciun",si odata ce foloseste comanda sa se dea pe comanda /o adica anunt pentru tot serverul "%s a luat cadoul de Mos Craciun" %s fiind inlocuit cu numele jucatorului.

Comanda:

CMD:moscraciun(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
     {
         if(BonusActiv > 0)
         {
             if(PlayerInfo[playerid][pScore] <= 4)
             {
                 GiveMoney(playerid, 30000000);
                 PlayerInfo[playerid][pScore] += 5;
                 PlayerInfo[playerid][pDiamonds] = 100;
                 SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                 SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
                 SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!");
                 SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!");
                 SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!");
                 SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
            }
            else return SendClientMessage(playerid, COLOR_LIGHTRED, "Ai luat deja cadoul de Mos Craciun !");
        }
    }
    return 1;
}

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Daca vrei sa nu conteze level-ul trebuie sa faci o noua variabila ce se salveaza in baza de date/folder-ul player-ului.

Poftim comanda care arata un mesaj global atunci cand cineva primeste cadoul.

	CMD:moscraciun(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(!BonusActiv) return 1;
    if(PlayerInfo[playerid][pScore] > 4) return SendClientMessage(playerid, COLOR_LIGHTRED, "Ai luat deja cadoul de Mos Craciun !");
    new name[24], string[100];
    GetPlayerName(playerid, name, 24);
    GiveMoney(playerid, 30000000);
    PlayerInfo[playerid][pScore] += 5;
    PlayerInfo[playerid][pDiamonds] = 100;
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    format(string, 100, "%s a primit cadoul de la Mos Craciun!", name);
    SendClientMessageToAll(COLOR_WHITE, string);
    return 1;
} 
	

Link to comment
Share on other sites

  • 0
Just now, iSkull said:

Daca vrei sa nu conteze level-ul trebuie sa faci o noua variabila ce se salveaza in baza de date/folder-ul player-ului.

Poftim comanda care arata un mesaj global atunci cand cineva primeste cadoul.

 

	CMD:moscraciun(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(!BonusActiv) return 1;
    if(PlayerInfo[playerid][pScore] > 4) return SendClientMessage(playerid, COLOR_LIGHTRED, "Ai luat deja cadoul de Mos Craciun !");
    new name[24], string[100];
    GetPlayerName(playerid, name, 24);
    GiveMoney(playerid, 30000000);
    PlayerInfo[playerid][pScore] += 5;
    PlayerInfo[playerid][pDiamonds] = 100;
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    format(string, 100, "%s a primit cadoul de la Mos Craciun!", name);
    SendClientMessageToAll(COLOR_WHITE, string);
    return 1;
} 
	

 

Am rezolvat,am facut o variabila numita pMosCraciun si am facut asa comanda:

CMD:moscraciun(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first."); if(IsPlayerConnected(playerid)) { if(BonusActiv > 0) { if(pInfo[playerid][pMosCraciun] == 1 ) return SendClientMessage(playerid, -1, "Ai folosit deja comanda. Nu o mai poti folosi"); GiveMoney(playerid, 30000000); PlayerInfo[playerid][pScore] += 5; PlayerInfo[playerid][pDiamonds] = 100; SetPlayerScore(playerid, PlayerInfo[playerid][pScore]); SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------"); SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!"); SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!"); SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!"); SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------"); pInfo[playerid][pMosCraciun] = 1; } } return 1; }

Link to comment
Share on other sites

  • 0

CMD:moscraciun(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(IsPlayerConnected(playerid))
     {
         if(BonusActiv > 0)
         {
                 if(pInfo[playerid][pMosCraciun] == 1 ) return SendClientMessage(playerid, -1, "Ai folosit deja comanda. Nu o mai poti folosi");
                 GiveMoney(playerid, 30000000);
                 PlayerInfo[playerid][pScore] += 5;
                 PlayerInfo[playerid][pDiamonds] = 100;
                 SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
                 SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
                 SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!");
                 SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!");
                 SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!");
                 SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
        pInfo[playerid][pMosCraciun] = 1;
        }
    }
    return 1;
}

Link to comment
Share on other sites

  • 0
	CMD:moscraciun(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(!BonusActiv) return 1;
    if(PlayerInfo[playerid][pMosCraciun] == 1) return SendClientMessage(playerid, -1, "Ai folosit deja comanda. Nu o mai poti folosi");
    new name[24], string[75];
    GetPlayerName(playerid, name, 24);
    GiveMoney(playerid, 30000000);
    PlayerInfo[playerid][pScore] += 5;
    PlayerInfo[playerid][pDiamonds] = 100;
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    PlayerInfo[playerid][pMosCraciun] = 1;
    format(string, 75, "%s a primit cadoul de la Mos Craciun!", name);
    SendClientMessageToAll(COLOR_WHITE, string);
    return 1;
} 
	

Fii mai atent, "pInfo" nu tine locul lui PlayerInfo, acela e enum-ul + mai citeste inainte sa postezi.

Edited by iSkull
Link to comment
Share on other sites

  • 0
48 minutes ago, iSkull said:
	CMD:moscraciun(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    if(!BonusActiv) return 1;
    if(PlayerInfo[playerid][pMosCraciun] == 1) return SendClientMessage(playerid, -1, "Ai folosit deja comanda. Nu o mai poti folosi");
    new name[24], string[75];
    GetPlayerName(playerid, name, 24);
    GiveMoney(playerid, 30000000);
    PlayerInfo[playerid][pScore] += 5;
    PlayerInfo[playerid][pDiamonds] = 100;
    SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    SendClientMessage(playerid, COLOR_RED, "Ai primit $30,000,000 cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_BLUE, "Ai primit 5 level up-uri de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_YELLOW, "Ai primit 100 diamonds cadou de la Mos Craciun!");
    SendClientMessage(playerid, COLOR_WHITE, "--------------------------[Mos Craciun]---------------------------------");
    PlayerInfo[playerid][pMosCraciun] = 1;
    format(string, 75, "%s a primit cadoul de la Mos Craciun!", name);
    SendClientMessageToAll(COLOR_WHITE, string);
    return 1;
} 
	

Fii mai atent, "pInfo" nu tine locul lui PlayerInfo, acela e enum-ul + mai citeste inainte sa postezi.

Mersi.

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
Answer this question...

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