Jump to content

Question

Posted

Salut , am si eu o problema , deci cand dau /pay in joc imi pica sv :| Ce pot face?

uitati si comanda

if(strcmp(cmd, "/pay", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{B8DBFF}Synthax: /pay <PlayerID/Name> <Amount>");

return 1;

}

//giveplayerid = strval(tmp);

        giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{B8DBFF}Synthax: /pay <PlayerID/Name> <Amount>");

return 1;

}

Join = > RPG.TRUEGAMING.RO

10 answers to this question

Recommended Posts

Posted

/-------------------------------[Pay]--------------------------------------------------------------------------

  if(strcmp(cmd, "/pay", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{B8DBFF}Synthax: /pay <PlayerID/Name> <Amount>");

return 1;

}

//giveplayerid = strval(tmp);

        giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "{B8DBFF}Synthax: /pay <PlayerID/Name> <Amount>");

return 1;

}

moneys = strval(tmp);

if(moneys > 0 && PlayerInfo[playerid][pLevel] < 2)

{

SendClientMessage(playerid, COLOR_GRAD1, "You must be level 2 to /pay");

return 1;

}

if(moneys < 1 || moneys > 100000)

{

    SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 100,000 at once.");

    return 1;

}

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

        if(PlayerInfo[giveplayerid][pLocal] == 106)

{

SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");

return 1;

}

if (ProxDetectorS(5.0, playerid, giveplayerid))

{

    if(giveplayerid == playerid)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You can not pay for yourself !");

        return 1;

    }

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

playermoney = GetPlayerCash(playerid);

if (moneys > 0 && playermoney >= moneys)

{

/*format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);*/

ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Invalid transaction amount.");

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Your too far away.");

}

}//invalid id

}

else

{

format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}

P.S Acum am obs ca ,nu se mai inchide sv , dar cand dau /pay id si suma, nu transfera banii ... doar se misca omul ...

Join = > RPG.TRUEGAMING.RO

Posted

[pawn] if(strcmp(cmd, "/pay", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(PlayerInfo[playerid][pLevel] < 2)

        {

        SendClientMessage(playerid, 0x4FA7FFFF, "*** You need level 2 to use this !");

            return 1;

        }

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");

return 1;

}

//giveplayerid = strval(tmp);

        giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");

return 1;

}

moneys = strval(tmp);

if(moneys > 99999 && PlayerInfo[playerid][pLevel] < 3)

{

SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to pay over 99999");

return 1;

}

if(moneys < 1 || moneys > 500000)

{

    SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 500000 at once.");

    return 1;

}

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

        if(PlayerInfo[giveplayerid][pLocal] == 106)

{

SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");

return 1;

}

if (ProxDetectorS(5.0, playerid, giveplayerid))

{

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

playermoney = GetPlayerMoney(playerid);

if (moneys > 0 && playermoney >= moneys)

{

    ConsumingMoney[giveplayerid] = 1;

GivePlayerMoney(playerid, (0 - moneys));

GivePlayerMoney(giveplayerid, moneys);

format(string, sizeof(string), "  You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

SendClientMessage(playerid, COLOR_GRAD1, string);

format(string, sizeof(string), "  You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);

SendClientMessage(giveplayerid, COLOR_GRAD1, string);

format(string, sizeof(string), "%s has paid $%d to %s", sendername, moneys, giveplayer);

ABroadCast(COLOR_YELLOW,string,1);

PayLog(string);

if(moneys >= 1000000)

{

ABroadCast(COLOR_YELLOW,string,1);

}

PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);

format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

                            ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Invalid transaction amount.");

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Your too far away.");

}

}//invalid id

}

else

{

format(string, sizeof(string), " That player is not connected.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Incearca comanda care ti l-am dat

Posted

[pawn]    if(strcmp(cmd, "/pay", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");

return 1;

}

//giveplayerid = strval(tmp);

        giveplayerid = ReturnUser(tmp);

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /pay [playerid/PartOfName] [amount]");

return 1;

}

moneys = strval(tmp);

if(moneys > 1000 && PlayerInfo[playerid][pLevel] < 3)

{

SendClientMessage(playerid, COLOR_GRAD1, "You must be level 3 to pay over 1000");

return 1;

}

if(moneys < 1 || moneys > 99999)

{

    SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 99999 at once.");

    return 1;

}

if (IsPlayerConnected(giveplayerid))

{

    if(giveplayerid != INVALID_PLAYER_ID)

    {

        if(PlayerInfo[giveplayerid][pLocal] == 106)

{

SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");

return 1;

}

if (ProxDetectorS(5.0, playerid, giveplayerid))

{

    if(giveplayerid == playerid)

    {

        SendClientMessage(playerid, COLOR_GREY, "  You can not pay for yourself !");

        return 1;

    }

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

playermoney = GetPlayerMoney(playerid);

if (moneys > 0 && playermoney >= moneys)

{

    //ConsumingMoney[giveplayerid] = 1;

SafeGivePlayerMoney(playerid, (0 - moneys));

SafeGivePlayerMoney(giveplayerid, moneys);

format(string, sizeof(string), "  You have sent %s(player: %d), $%d.", giveplayer,giveplayerid, moneys);

PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);

SendClientMessage(playerid, COLOR_GRAD1, string);

format(string, sizeof(string), "  You have recieved $%d from %s(player: %d).", moneys, sendername, playerid);

SendClientMessage(giveplayerid, COLOR_GRAD1, string);

format(string, sizeof(string), "%s has paid $%d to %s", sendername, moneys, giveplayer);

PayLog(string);

if(moneys >= 1000000)

{

ABroadCast(COLOR_YELLOW,string,1);

}

PlayerPlaySound(giveplayerid, 1052, 0.0, 0.0, 0.0);

/*format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);

ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);*/

ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Invalid transaction amount.");

}

}

else

{

SendClientMessage(playerid, COLOR_GRAD1, "  Your too far away.");

}

}//invalid id

}

else

{

format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

SendClientMessage(playerid, COLOR_GRAD1, string);

}

}

return 1;

}[/pawn]

Posted

[pawn]/-------------------------------[Pay]--------------------------------------------------------------------------

  if(strcmp(cmd, "/pay", true) == 0)

  {

      if(IsPlayerConnected(playerid))

      {

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))

        {

            SendClientMessage(playerid, COLOR_GRAD1, "{B8DBFF}Synthax: /pay <PlayerID/Name> <Amount>");

            return 1;

        }

        //giveplayerid = strval(tmp);

          giveplayerid = ReturnUser(tmp);

        tmp = strtok(cmdtext, idx);

        if(!strlen(tmp))

        {

            SendClientMessage(playerid, COLOR_GRAD1, "{B8DBFF}Synthax: /pay <PlayerID/Name> <Amount>");

            return 1;

        }

        moneys = strval(tmp);

        if(moneys > 0 && PlayerInfo[playerid][pLevel] < 2)

        {

            SendClientMessage(playerid, COLOR_GRAD1, "You must be level 2 to /pay");

            return 1;

        }

        if(moneys < 1 || moneys > 100000)

        {

            SendClientMessage(playerid, COLOR_GRAD1, "Dont go below 1, or above 100,000 at once.");

            return 1;

        }

        if (IsPlayerConnected(giveplayerid))

        {

            if(giveplayerid != INVALID_PLAYER_ID)

            {

                if(PlayerInfo[giveplayerid][pLocal] == 106)

              {

                  SendClientMessage(playerid, COLOR_GRAD1, "Command not allowed in this location");

                  return 1;

              }

              if (ProxDetectorS(5.0, playerid, giveplayerid))

              {

                  if(giveplayerid == playerid)

                  {

                      SendClientMessage(playerid, COLOR_GREY, "  You can not pay for yourself !");

                      return 1;

                  }

                  GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

                  GetPlayerName(playerid, sendername, sizeof(sendername));

                  playermoney = GetPlayerCash(playerid);

                  {

                    /*format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", sendername ,giveplayer);

                    ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);*/

                    ApplyAnimation(playerid,"DEALER","shop_pay",4.1,0,0,0,0,0);

                  }

                  else

                  {

                    SendClientMessage(playerid, COLOR_GRAD1, "  Invalid transaction amount.");

                  }

              }

              else

              {

                  SendClientMessage(playerid, COLOR_GRAD1, "  Your too far away.");

              }

            }//invalid id

        }

        else

        {

            format(string, sizeof(string), "  %d is not an active player.", giveplayerid);

            SendClientMessage(playerid, COLOR_GRAD1, string);

        }

      }

      return 1;

  }[/pawn]

Vezi daca iti merge cu asta :D Este ceva pus gresit in comanda ta am avut si eu acest bug la /makeadmin si /o

Posted

Fucking RP scripting ... nici un server owner al unui server RP/GF nu stie sa foloseasca SScanf & ZCMD ?? e asa de greu? :))

Esti sigur ca este de la /pay?

Fara reclama in semnatura!

Posted

C:\Users\Diabolix\Desktop\ff\gamemodes\agaming.pwn(28891) : error 029: invalid expression, assumed zero

C:\Users\Diabolix\Desktop\ff\gamemodes\agaming.pwn(28892) : error 029: invalid expression, assumed zero

C:\Users\Diabolix\Desktop\ff\gamemodes\agaming.pwn(28892) : warning 215: expression has no effect

C:\Users\Diabolix\Desktop\ff\gamemodes\agaming.pwn(28892) : error 001: expected token: ";", but found ")"

C:\Users\Diabolix\Desktop\ff\gamemodes\agaming.pwn(28892) : error 029: invalid expression, assumed zero

C:\Users\Diabolix\Desktop\ff\gamemodes\agaming.pwn(28892) : fatal error 107: too many error messages on one line

playermoney2 = GetPlayerMoney(playerid); -> linia

Join = > RPG.TRUEGAMING.RO

Guest
This topic is now closed to further replies.
×
×
  • 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.