SA-MP Forums Archive
OnPlayerText - Making text dont send to chat? - 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)
+--- Thread: OnPlayerText - Making text dont send to chat? (/showthread.php?tid=521135)



OnPlayerText - Making text dont send to chat? - [Cali]ChrOnic_T - 21.06.2014

I made a script so wen they type 1 they get a deagle etc but

When they dont have money, "You dont have enough money for this item", it sends the number they TYPED for the weapon to the chat. How to resolve this?

pawn Код:
public OnPlayerText( playerid, text[] )  // , 4.1, 0, 1, 1, 1, 1);
{
     if(BuyingGuns[playerid] == 1)
           {
         if(strcmp(text, "7", true) == 0 || strcmp(text, "Sawn", true) == 0)
          {
            if(IfUsedGun[playerid] == 1)
            return SendClientMessage(playerid, error, "Please wait before buying another weapon.");
/// -----------------------------------------------
            if(GetPlayerMoney(playerid) <3500)
            return SendClientMessage(playerid, error, "You don't have enough money to purchase this item!");  // This Right here. how to make there text not send to chat like
 //   This Right here. how to make there text not send to chat ^^ so when
            GivePlayerWeapon(playerid, 26,100);
            SendClientMessage(playerid, 0xFFFFFFFF, "{00FF40}You've purchased a Sawn Off - Shotgun! ( $3500 )");
            return 0;
        }
    }



Re: OnPlayerText - Making text dont send to chat? - Jefff - 21.06.2014

add '!' before SendClientMessage

return !SendClientMessage

! - means false/0 - blocking chat


Re: OnPlayerText - Making text dont send to chat? - Cypress - 21.06.2014

The what Jefff said above is correct but you can also do this:

pawn Код:
return SendClientMessage(playerid, error, "Please wait before buying another weapon."), 0;
EDIT: Apologizing for the late reply.


Re: OnPlayerText - Making text dont send to chat? - VenomMancer - 21.06.2014

Maybe this will help you

pawn Код:
public OnPlayerText( playerid, text[] )  // , 4.1, 0, 1, 1, 1, 1);
{
     if(BuyingGuns[playerid] == 1)
           {
         if(strcmp(text, "7", true) == 0 || strcmp(text, "Sawn", true) == 0)
          {
            if(IfUsedGun[playerid] == 1)
            return SendClientMessage(playerid, error, "Please wait before buying another weapon.");
/// -----------------------------------------------
            if(GetPlayerMoney(playerid) <3500)
            {
                SendClientMessage(playerid, error, "You don't have enough money to purchase this item!");
                return 0;
            }
            else
            {
                GivePlayerWeapon(playerid, 26,100);
                SendClientMessage(playerid, 0xFFFFFFFF, "{00FF40}You've purchased a Sawn Off - Shotgun! ( $3500 )");
                return 0;
            }
        }
    }