How to take playerid money down
#1

i have a weapon menu,
i have a gun set price at 500
so i have
GivePlayerMoney(playerid, 500);
but you can still buy it, even if you have 0 dollars,
you just go into dept,
how do i make it soo you MUST have the correct amount of money to buy it
is it something like
GetPlayerMoney(
Reply
#2

pawn Код:
if(GetPlayerMoney(playerid) >= 500)
Reply
#3

and to take his money do:
SetPlayerMoney(playerid,-500);
Reply
#4

Quote:
Originally Posted by OmeRinG
and to take his money do:
SetPlayerMoney(playerid,-500);
#

Ok and will that make it, soo if you dont have enough money, u cant buy it?
Reply
#5

Quote:
Originally Posted by aspire5630
Quote:
Originally Posted by OmeRinG
and to take his money do:
SetPlayerMoney(playerid,-500);
#

Ok and will that make it, soo if you dont have enough money, u cant buy it?
no, but this will:
Quote:
Originally Posted by backwardsman97
pawn Код:
if(GetPlayerMoney(playerid) >= 500)
Reply
#6

Quote:
Originally Posted by OmeRinG
and to take his money do:
SetPlayerMoney(playerid,-500);
Correction:
pawn Код:
GivePlayerMoney(playerid, -500);
Reply
#7

Quote:
Originally Posted by bogeyman_EST
Quote:
Originally Posted by OmeRinG
and to take his money do:
SetPlayerMoney(playerid,-500);
Correction:
pawn Код:
GivePlayerMoney(playerid, -500);
Noop doesent work
says "unkown Command"
but still gives you the nos, and dosent take $500 of you, Gives you it for free :S
Reply
#8

Sorry for double post
Anyone know? :P
how to make it, so it takes your money down, but you NEED THE amount of money or more to buy it
not just
GivePlayerMoney(playerid, -1000);
because if you dont have 1000 it just puts you in debt, i need one where if you dont have enough, you cant buy it
Reply
#9

I already put it.

pawn Код:
if(GetPlayerMoney(playerid) >= 500)
{
   //They don't have enough cash
   return 1;
}
If that doesn't work then post your command because it means you are putting it in wrong.
Reply
#10

Quote:
Originally Posted by backwardsman97
I already put it.

pawn Код:
if(GetPlayerMoney(playerid) >= 500)
{
  //They don't have enough cash
  return 1;
}
If that doesn't work then post your command because it means you are putting it in wrong.
]


Not worked
this is my code
Код:
				if(strcmp(cmdtext, "/nos", true) == 0){
            if(IsPlayerInAnyVehicle(playerid)) {
            switch(GetVehicleModel( GetPlayerVehicleID(playerid) )) {
                    case 448,461,462,463,468,471,509,510,521,522,523,581,586,449:
                    return SendClientMessage(playerid,0xFFFF00AA,"ERROR: You can not tune this vehicle!");
                }
  					AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
						if(GetPlayerMoney(playerid) >= 500)
						SendClientMessage(playerid, RED,"You Cannot Afford This!!!");
     				SendClientMessage(playerid,0xFFFF00AA,"Nos Installed, $1000");
            return PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
     		      } else return SendClientMessage(playerid,0xFFFF00AA,"ERROR: You must be in a vehicle.");
    }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)