Jump to content
  • 0

Comanda /order probleme


cobalt_thekiller

Question

Salut cand dau /order imi zice ca ai primit 0 si arme si ai dat 0 materiale si $0.

 

YCMD:order(playerid, params[], help) {
    if(PlayerInfo[playerid][pMember] == 11 || PlayerInfo[playerid][pLeader] == 11) {
        new result[30];
        if(!PlayerToPoint(100, playerid, -2158.6482,642.3111,1052.3750)) return SCM(playerid, COLOR_GREY, "Nu esti in HQ!");
        if(sscanf(params, "s[30]", result)) {
            SCM(playerid, COLOR_GREY, "Syntax: {FFFFFF}/order <id>");
            SCM(playerid, COLOR_WHITE, "1. Knife (10 $) | 2. SD-Pistol (100 $) | 3. Sniper (200 $)");
            return true;
        }
        if(PlayerInfo[playerid][pGunLic] == 0) return SCM(playerid,-1,"Nu ai licenta de arme!");
        if(strcmp(result,"1",true) == 0) {
            if(PlayerMoney(playerid, 10)) return true;
            ServerWeapon(playerid, 4, 200);
            SCM(playerid, COLOR_MONEY, "Ti-ai cumparat un cutit la pretul de 10$.");
            GivePlayerCash(playerid, 0, 10);
            return true;
        }
        else if(strcmp(result,"2",true) == 0) {
            if(PlayerMoney(playerid, 100)) return true;
            ServerWeapon(playerid, 23, 200);
            SCM(playerid, COLOR_MONEY, "Ti-ai cumparat un SD-Pistol la pretul de 100$.");
            GivePlayerCash(playerid, 0, 100);
            return true;
        }
        else if(strcmp(result,"3",true) == 0) {
            if(PlayerMoney(playerid, 200)) return true;
            ServerWeapon(playerid, 34, 200);
            SCM(playerid, COLOR_MONEY, "Ti-ai cumparat un Sniper la pretul de 200$.");
            GivePlayerCash(playerid, 0, 200);
            return true;
        }
        else return SCM(playerid, COLOR_GREY, "Invalid id!");
    }    
    if(!IsMafie(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti membrul unei mafii.");
    if(PlayerInfo[playerid][pGunLic] == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu ai licenta de arme.");
    if(GetPlayerInterior(playerid) == 0) return SCM(playerid, COLOR_WHITE,"Nu esti in HQ.");
    if(!IsAtOrderPlace(playerid)) return true;
    new x = PlayerInfo[playerid][pMember]-1, var[3];

    if(SafeInfo[x][sMaterials] < ValueMafie[0][1] && SafeInfo[x][sMoney] < ValueMafie[0][0])
        return SCM(playerid, COLOR_GREY, "Nu ai materiale sau bani de ajuns.");

    for(new i = 0; i < 5; i++) {
        if(SafeInfo[x][sMaterials] < ValueMafie[i][1] && SafeInfo[x][sMoney] < ValueMafie[i][0] || !PlayerInfo[playerid][pGuns][i])
            continue;

        SafeInfo[x][sMaterials] -= ValueMafie[i][1];
        SafeInfo[x][sMoney] -= ValueMafie[i][0];
        ServerWeapon(playerid, GunMafieID[0][i], 60);
        var[0] ++;
        var[1] += ValueMafie[i][1];
        var[2] += ValueMafie[i][0];
    }
    SaveSeif(x);
    format(gString, 100, "(/order) {FFFFFF}Ai primit %d arme si ai dat %s materiale si $%s.", var[0], FormatNumber(var[1]), FormatNumber(var[2]));
    SCM(playerid, COLOR_LGREEN, gString);        
    return true;
}

function IsMafie(playerid) return PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4 || PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6 || PlayerInfo[playerid][pMember] == 10 || PlayerInfo[playerid][pLeader] == 10 ? (true) : (false);
 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

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.

  • Similar Content

    • By xLinix96
      Salut, asta este prima mea postare pe aceasta comunitate, astazi vreau sa va arat cum sa creati o comanda /flymode, stiu ca este o comanda foarte simpla, dar sunt unii incepatori care nu stiu sa o faca.
       
      Pentru inceput aveti nevoie de un include.
      #include <fly>
      Il gasiti aici: http://www.solidfiles.com/d/289d6c8fdf/
       
       
      Acum vom face comanda:
      CMD:fly(playerid, params[])
      {
          if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te comenctezi."); // aici verificam daca esti conectat
          if(IsPlayerConnected(playerid)) 
          {
              if(PlayerInfo[playerid][pAdmin] >= 1) // aici punem nivelul de admin necesar pentru a folosii comanda.
              {
                  new sendername[30],string[256];
                  if(flymode[playerid] == 0)
                  {
                      GetPlayerName(playerid, sendername, sizeof(sendername)); // aici obtinem numele adminuui.
                      togfind[playerid] = 0;
                      flymode[playerid] = 1;
                      format(string,sizeof(string),"{DFF230}%s este acum in modul fly-mode.", sendername); 
                      ABroadCast(COLOR_ORANGE,string,1);
                      InitFly(playerid);
                      StartFly(playerid);
                      SetPlayerHealthEx(playerid, 10000000); // aici setam hp-ul.
                  }
                  else
                  {
                      GetPlayerName(playerid, sendername, sizeof(sendername)); // iar de aici oprim fly-ul.
                      togfind[playerid] = 1;
                      flymode[playerid] = 0;
                      format(string,sizeof(string),"{F89AD6}Ai oprit fly-mode-ul", sendername);
                      SCM(playerid, COLOR_GREEN, string);
                      StopFly(playerid);
                      SetPlayerHealthEx(playerid, 100); // 
                  }
              }
              else return SendClientMessage(playerid, COLOR_ERROR, AdminOnly);
          }
          return 1;
      }
       
      Sper ca v-am ajutat, nu este cine site ce sistem.
       
       
    • By FlobertRO
      Cum pot schimba o comanda de tipul "strcmp" in "cmd" ? un exemplu daca se poate, multumesc <3
    • By TheGodfather
      Salut, aveti idee cum pot face o comanda prin care playerii sa se poata reconecta pe server fara sa inchida sampul? Gen sa dea /relog si sa le incarce din nou toate datele, sa puna din nou parola etc.
    • By TheGodfather
      Salut, vreau sa fac o comanda /lastchat cu care sa pot sa vad ultimele x mesaje ale unui jucator. Am incercat asa dar nu imi afiseaza nimic.
      YCMD:lastchat(playerid, params[], help) {
          if(aspam[playerid] > 0) return SCMEx(playerid, COLOR_LIGHTRED, "[Command Anti-Spam] {FFFFFF}Wait %d seconds.", aspam[playerid]);
          if(PlayerInfo[playerid][pAdmin] < 😎 return SCM(playerid,COLOR_WHITE,AdminOnly);
          new giveplayerid[25],id,cont,name[30];
          if(sscanf(params, "s[25]d", giveplayerid, id)) return SCM(playerid,COLOR_GREY, "Syntax: {FFFFFF}/lastchat <name> <number of messages>");
          cont = MySQLCheckAccount(giveplayerid);
          if(cont == 0) return SCM(playerid,COLOR_ERROR,"Error:{FFFFFF} This account was not found in the database!");
          GetPlayerName(playerid, name, sizeof name);
          //
          new szQuery[256], string[180], MemberString[1024], szResult[180], text[180],TitleString[180];
          format(szQuery, sizeof(szQuery), "SELECT * FROM `logs` WHERE `Name`='%s' ORDER BY `ID` DESC LIMIT %d", GetName(playerid), id);
          new Cache: result = mysql_query(SQL, szQuery);
          for(new i, j = cache_num_rows(); i != j; ++i)
          {
              cache_get_field_content(i, "player", szResult); format(name, 256, szResult);
              cache_get_field_content(i, "Text", szResult);  format(text, 256, szResult);
              format(string, sizeof(string), "%s", text);strcat(MemberString, string, sizeof(MemberString));
          }
          cache_delete(result);
          format(TitleString, sizeof(TitleString), "Last %d messages from player %s.", id, name);
          ShowPlayerDialog(playerid, DIALOG_LASTCHAT, DIALOG_STYLE_TABLIST_HEADERS, TitleString, MemberString, "Ok", "Exit");
          //
          return 1;
      }
      case DIALOG_LASTCHAT: {
                  if(!response) return true;
              }
    • By GabyRo.off
      cum pot face o comanda /snow si sa apara fulgi de zapada pe sv gen /snow pentru o activa si dezactiva
  • Recently Browsing   0 members

    No registered users viewing this page.

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