Jump to content
  • 0

comanda /bonus


Davidoff7776

Question

Salut!Mi-am facut comanda /bonus care arata cam asa:

CMD:bonus(playerid, params[]) {
    if(PlayerInfo[playerid][pLevel] < 3)
    {
        PlayerInfo[playerid][pLevel] = 3;
        SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
        GivePlayerMoney(playerid, 5000000);
        SendClientMessage(playerid, COLOR_ORANGE, "Ai primit level 3 si $5000000 ca bonus.");
    } else SendClientMessage(playerid, COLOR_ORANGE, "Poti folosi comanda /bonus doar o data.");
    return 1;
}

As dori sa stiu cum vi se pare si daca se mai poate optimiza.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
CMD:bonus(playerid, params[]) {    
    if(PlayerInfo[playerid][pLevel] > 3) return SendClientMessage(playerid, COLOR_ORANGE, "Ai deja level 3 sau ai folosit deja comanda");    
    PlayerInfo[playerid][pLevel] = 3;    
    SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);    
    GivePlayerMoney(playerid, 5000000);    
    SendClientMessage(playerid, COLOR_ORANGE, "Ai primit level 3 si $5000000 ca bonus.");    
    return 1;
}

	

 

Mai curat asa.

Edited by PauLL
  • Upvote 1
Link to comment
Share on other sites

  • 0
CMD:bonus(playerid, params[]) {
    if(PlayerInfo[playerid][pLevel] >= 3) return SendClientMessage(playerid, COLOR_ORANGE, "Poti folosi comanda /bonus doar o data.");
    //-------------------------------------------------------------------------
    else
    {
        PlayerInfo[playerid][pLevel] = 3,	SetPlayerScore(playerid, 3),	GivePlayerMoney(playerid, 5000000);
        //----------------------------------------------------------------------
        return SendClientMessage(playerid, COLOR_ORANGE, "Ai primit level 3 si $5000000 ca bonus.");
	}
}

Poftim si scapi si de return 1;

Link to comment
Share on other sites

  • 0
Acum 2 ore, cristiviteza a spus:

CMD:bonus(playerid, params[]) {
    if(PlayerInfo[playerid][pLevel] >= 3) return SendClientMessage(playerid, COLOR_ORANGE, "Poti folosi comanda /bonus doar o data.");
    //-------------------------------------------------------------------------
    else
    {
        PlayerInfo[playerid][pLevel] = 3,	SetPlayerScore(playerid, 3),	GivePlayerMoney(playerid, 5000000);
        //----------------------------------------------------------------------
        return SendClientMessage(playerid, COLOR_ORANGE, "Ai primit level 3 si $5000000 ca bonus.");
	}
}

Poftim si scapi si de return 1;

ce-i asta?

Edited by PauLL
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.