Help me
#1

pawn Код:
if (strcmp(text,"1",true) == 0)
        {
        new Playermoney = GetPlayerMoney(playerid);
        if (Playermoney >= 900)
            {
            SendClientMessage(playerid,0x38FF06FF,"$900 Whore");
            GivePlayerMoney(playerid, -900);
            GivePlayerWeapon(playerid,24,120);
            IsInCheckPoint[playerid] = 1;
            return 0;

        }
        SendClientMessage(playerid,0x38FF06FF,"You Do not have enough Cash");
    }
When I have Above $900 I get gun id 24
When I dont have $900 I get the Message: You Do not have enough Cash
Which is great but It also makes me say: 1. Is there a way to fix this?
Reply
#2

If you don't want to pay for weapon then just remove player-money-check.
Reply
#3

Quote:
Originally Posted by Don Correlli
If you don't want to pay for weapon then just remove player-money-check.
-.- The money Check is fine. I just want the message saying: You Do not have enough Cash
And not me saying 1 in the chat
Reply
#4

pawn Код:
if (strcmp(text,"1",true) == 0)
{
new Playermoney = GetPlayerMoney(playerid);
if (Playermoney >= 900)
{
SendClientMessage(playerid,0x38FF06FF,"$900 Whore");
GivePlayerMoney(playerid, -900);
GivePlayerWeapon(playerid,24,120);
IsInCheckPoint[playerid] = 1;
return 1;
}
else return SendClientMessage(playerid,0x38FF06FF,"You Do not have enough Cash");
}
Try that one.
Reply
#5

Edit:

Nah Still makes me say 1
Reply
#6

pawn Код:
if(IsInCheckPoint[playerid] == 1)
{
   switch(text)
   {
      case 0:
      {

        if (strcmp(text,"1",true) == 0)
        {
        new Playermoney = GetPlayerMoney(playerid);
        if (Playermoney > 900)
            {
            SendClientMessage(playerid,0x38FF06FF,"[DEBUG] DEAGLE");
            GivePlayerMoney(playerid, -900);
            GivePlayerWeapon(playerid,24,120);
            IsInCheckPoint[playerid] = 1;
            return false;
        }
        else
        {
            SendClientMessage(playerid, 0x000000, "You don't have 900$.");
        }
       }
       case 1:
       {
        if(strcmp(text,"2",true) == 0)
        {
          if( Playermoney > 1000 )
          {
            SendClientMessage(playerid,0x38FF06FF,"Selection 2");
            IsInCheckPoint[playerid] = 1;
            return false;
          }
          else
          {
            SendClientMessage(playerid, 0x000000, "You don't have 1000$");
          }

         }

   }
   return true;
}
Ok I tried that But I get errors


error 033: array must be indexed (variable "-unknown-") switch(text)
error 014: invalid statement; not in switch case 1
error 001: expected token: ";", but found ":" case 1
error 029: invalid expression, assumed zero case 1
fatal error 107: too many error messages on one line case 1
Reply
#7

You need to return 0 to close the 'if (strcmp(text,"1",true) == 0) ' or it will still send the "1" to the chat... That whole switch thing your doing doesnt make much sense

In your first post: Change the last ' } ' to this:

Код:
return 0;
}
And your good to go!
Reply
#8

WTF ??!!!!!
[me=M4DKiLLA]GIVES A BIG KISS TO BMUK[/me]

Cheers mate
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)