Jump to content

Recommended Posts

Posted (edited)

Salut bugged. M-am decis sa postez comanda /bonus care tin sa mentionez nu este facuta de mine. Eu doar o postez ca ceilalti sa se poata folosi de ea. 
 
Bun sa incepem:
 
la variabile pune-ti asa:

 

 BonusActiv = 0, 

 

 

Acuma comanda:

 

 CMD:bonus(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][pLevel] <= 2)
      {
          GivePlayerCash(playerid, 300000);
          PlayerInfo[playerid][pLevel] = 3;
          Update(playerid, pLevelx);
          Update(playerid, pCashx);
          SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
          SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai primit $300,000 si level 3 de bun venit!");
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "Nu poti folosi aceasta comanda daca ai level 3+ !");
}
}
return 1;

 

 
Acuma comanda adminilor sa activeze / dezactiveze comanda /bonus
 

 

 CMD:activatebonus(playerid, params[])

{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
if(IsPlayerConnected(playerid))
  {
     if (PlayerInfo[playerid][pAdmin] >= 4)
{
   if(BonusActiv == 0)
      {
         BonusActiv = 1;
         SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai activat comanda /bonus!");
}
else
{
   BonusActiv = 0;
   SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
}
}
else
{
SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
}
}
return 1;
}

 

 

Daca v-am ajutat astept +1. Succes.

Edited by .K3nT.
  • Upvote 2
Posted (edited)

Ai +1 ;)

Multumesc.

O sa revin si cu alte scripturi folositoare cat de curand.

Edited by .K3nT.
Posted (edited)

BonusActiv = 0, = BonusActiv = 0;

 

Iar la codurile gen 

else
{
    BonusActiv = 0;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
}

mai bine ai folosi

else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!"), BonusActiv = 0;

Economisesti linii, cu cat mai putine linii cu atat mai rapid se compileaza.

In rest, pare ok.

Edited by L0K3D.
Posted

BonusActiv = 0, = BonusActiv = 0;

 

Iar la codurile gen 

else
{
    BonusActiv = 0;
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!");
}

mai bine ai folosi

else SendClientMessage(playerid, COLOR_LIGHTBLUE, "Ai dezactivat comanda /bonus!"), BonusActiv = 0;

Economisesti linii, cu cat mai putine linii cu atat mai rapid se compileaza.

In rest, pare ok.

Dar nu are nici o treaba asta. la aia iti poate da putine erori. Infine nu mai conteaza.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. 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.

moduri samp