Need help iwth buying gun
#1

Hey guys. I scripted that when you do /buygun tec-9 in the ammunation you will get a tec-9

But I want that if you don't have enough money it says: You don't have enough money. but now when I
Have not enough money my money just go to RED and you can buy it.

This is my script

Код:
  }
	if (strcmp("/buygun tec-9", cmdtext, true, 10) == 0)
	{
  if(IsPlayerInRangeOfPoint(playerid, 1.0, 294.7390,-38.4376,1001.5156))
  {

	GivePlayerMoney(playerid,-2500);
	GivePlayerWeapon(playerid,32,500);
	
	SendClientMessage(playerid, 0x33AA33AA, "You do not have enough money!");
	}
	else
	SendClientMessage(playerid, 0x33AA33AA, "You are not inside the ammunation or you don't have enough money");
Reply
#2

Above the 'GivePlayerMoney' part, add this
pawn Код:
if(GetPlayerMoney(playerid)<2500)return SendClientMessage(playerid,0x33AA33AA,"You do not have enough money");
Also remove your "You do not have enough money!" message.
Reply
#3

Thanks. I was trying sometihing with the < too. But I faileeed xD
Reply
#4

Quote:
Originally Posted by bartje01
Hey guys. I scripted that when you do /buygun tec-9 in the ammunation you will get a tec-9

But I want that if you don't have enough money it says: You don't have enough money. but now when I
Have not enough money my money just go to RED and you can buy it.

This is my script

Код:
	if (strcmp("/buygun tec-9", cmdtext, true, 10) == 0)
	{
  if(IsPlayerInRangeOfPoint(playerid, 1.0, 294.7390,-38.4376,1001.5156))
  {

	GivePlayerMoney(playerid,-2500);
	GivePlayerWeapon(playerid,32,500);
	
	SendClientMessage(playerid, 0x33AA33AA, "You do not have enough money!");
	}
	else
	SendClientMessage(playerid, 0x33AA33AA, "You are not inside the ammunation or you don't have enough money");
lol


ok

Код:
if (strcmp("/buygun tec-9", cmdtext, true, 10) == 0)
{
     if(IsPlayerInRangeOfPoint(playerid, 1.0, 294.7390,-38.4376,1001.5156))
     
    
  {
        new checkcash;
        checkcash = GetPlayerMoney(playerid);
        if(checkcash > 2500)
          
    {
            GivePlayerMoney(playerid,-2500);
                GivePlayerWeapon(playerid,32,500);
            
    }
        else {
            SendClientMessage(playerid, 0x33AA33AA, "You do not have enough money!");
            
    }
      
  }
    else {
        SendClientMessage(playerid, 0x33AA33AA, "You are not inside the ammunation");
  }
}
(100 edits later)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)