I don't know why not working [FS]
#2

For starters:

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new string[256];
    new playermoney;
    new sendername[MAX_PLAYER_NAME];
    new giveplayer[MAX_PLAYER_NAME];
    new playername[MAX_PLAYER_NAME];
    new cmd[256];
    new tmp[256];
    new giveplayerid, moneys, idx;
    cmd = strtok(cmdtext, idx);

    if(strcmp(cmd, "/wb", true) == 0) && PlayerToPoint(1.5 ,playerid,2305.6890,-16.0881,26.7496))
    {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid])
        {
          if(PlayerInfo[playerid][pLeader] == 7)
          {
                    tmp = strtok(cmdtext, idx);
                    if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "NAUDOJIMAS: /wb [pinigu suma]");
            new
              takeamount = strval(tmp),
              name[MAX_PLAYER_NAME];
                    if(takeamount > biudzetas)
                    {
                        SendClientMessage(playerid, COLOR_GREY, " Biudzete tiek pinigu nera.");
                        format(string, sizeof(string), "Dabartinis biudzetas: [$%d]", biudzetas);
                        SendClientMessage(playerid, COLOR_WHITE, string);
                        return 1;
                    }
                    if(takeamount < 0) return 1;
                    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
                    biudzetas -= takeamount;
                    format(string, sizeof(string), "Meras %s nueme [$%d] is biudzeto (Biudzete liko: $%d).", name, takeamount, biudzetas);
                    SendClientMessageToAll(COLOR_WHITE, string);
                    GivePlayerMoney(playerid, takeamount);
                    SaveStuff();
          }
          else SendClientMessage(playerid, COLOR_GREY, " Tu neesi meras !");
        }
      }
      return 1;
    }

    if(strcmp(cmd, "/db", true) == 0) && PlayerToPoint(1.5 ,playerid,2305.6890,-16.0881,26.7496))
    {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid])
        {
          tmp = strtok(cmdtext, idx);
          if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "NAUDOJIMAS: /db [pinigu suma]");
          new
            giveamount = strval(tmp),
            name[MAX_PLAYER_NAME];
                GetPlayerName(playerid, name, MAX_PLAYER_NAME);
                if(giveamount < 1 || giveamount > 999999) return SendClientMessage(playerid, COLOR_GREY, " Bloga pinigu suma !");
                if(giveamount > GetPlayerMoney(playerid)) return SendClientMessage(playerid, COLOR_GREY, " Jus neturite tiek pinigu !");
                biudzetas += giveamount;
                format(string, sizeof(string), "%s idejo $%d i biudzeta (Dabartinis biudzetas: %d$)", name, giveamount, biudzetas);
                SendClientMessageToAll(COLOR_WHITE, string);
                GivePlayerMoney(playerid, -giveamount);
                SaveStuff();
        }
        SendClientMessage(playerid, COLOR_ORANGE, " Jus neasate banke! ");
      }
        return 1;
    }
Reply


Messages In This Thread
I don't know why not working [FS] - by DyFon - 07.02.2009, 20:33
Re: I don't know why not working [FS] - by 1337pr0 - 08.02.2009, 03:56
Re: I don't know why not working [FS] - by DyFon - 08.02.2009, 08:25
Re: I don't know why not working [FS] - by Nimphious - 08.02.2009, 09:17
Re: I don't know why not working [FS] - by SilentMouse - 08.02.2009, 09:20
Re: I don't know why not working [FS] - by DyFon - 08.02.2009, 09:26
Re: I don't know why not working [FS] - by DyFon - 08.02.2009, 15:59
Re: I don't know why not working [FS] - by Marcel - 08.02.2009, 16:01
Re: I don't know why not working [FS] - by DyFon - 08.02.2009, 16:46
Re: I don't know why not working [FS] - by Danut - 08.02.2009, 16:50

Forum Jump:


Users browsing this thread: 2 Guest(s)