SA-MP Forums Archive
I don't know why not working [FS] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I don't know why not working [FS] (/showthread.php?tid=64856)



I don't know why not working [FS] - DyFon - 07.02.2009

So i Are From LITHUANIA so look i make it

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;
}

Why its not working ?
P.S. Sorry for bad English and that is Lithuania language


Re: I don't know why not working [FS] - 1337pr0 - 08.02.2009

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;
    }



Re: I don't know why not working [FS] - DyFon - 08.02.2009

It's not working anyway


Re: I don't know why not working [FS] - Nimphious - 08.02.2009

Let me guess.. It gave you the same errors as before? maybe he used pawn tags so it was readable.


Re: I don't know why not working [FS] - SilentMouse - 08.02.2009

Could you post the errors please or say what doesn't work?


Re: I don't know why not working [FS] - DyFon - 08.02.2009

There is no Errors there is no Warnings but anyway it not working but if i write /db its not show any thing it's look like there are not that [FS]


Re: I don't know why not working [FS] - DyFon - 08.02.2009

If anyone can fix it ?


Re: I don't know why not working [FS] - Marcel - 08.02.2009

Quote:

/rcon loadfs name




Re: I don't know why not working [FS] - DyFon - 08.02.2009

No its loaded


Re: I don't know why not working [FS] - Danut - 08.02.2009

I think you're a bit STUPID !!! OMG , what you have there , is GodFather STUFF !!

You must put the code in the GM GodFather