OnPlayerText - Making text dont send to chat?
#1

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;
        }
    }
Reply
#2

add '!' before SendClientMessage

return !SendClientMessage

! - means false/0 - blocking chat
Reply
#3

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.
Reply
#4

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


Forum Jump:


Users browsing this thread: