Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Ajutor scripting.


Question

Posted

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;
}

6 answers to this question

Recommended Posts

  • 0
Posted

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;
} 
	

  • 0
Posted
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; }

  • 0
Posted

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;
}

  • 0
Posted (edited)
	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
  • 0
Posted
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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.