Jump to content

Question

Posted

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.

4 answers to this question

Recommended Posts

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

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

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.