(HELP)GivePlayerMoney, GetPlayerMoney
#1

Hello, if i have this script in that
Quote:

if(dialogid == 137)
{
if(response)
{
PlayerData[playerid][Step] = 1;
GivePlayerMoney (playerid, -500);
SendClientMessage(playerid, COLOR_GREY, "You paid 500 dollars. Get out of this bulding to start test.");
SetPlayerCheckpoint(playerid, 2046.8928,-1908.0372,13.5469,280.0000);
}

So, when i have 0 dollars and do it, i will have -500 but i dont want that
I wanna that will say me, you dont have money, if i wont have

I checked something with GetPlayerMoney but it doesnt work, so help me.
I tried it like this
Quote:

if(response)
{
PlayerData[playerid][Step] = 1;
if (GetPlayerMoney(playerid) < 500)
SendClientMessage(playerid, COLOR_RED, "You dont have enough money.");
GivePlayerMoney (playerid, -500);
SendClientMessage(playerid, COLOR_GREY, "You paid 500 dollars. Get out of this bulding to start test.");
SetPlayerCheckpoint(playerid, 2046.8928,-1908.0372,13.5469,280.0000);
}

Please HELP ME Thx..
Reply
#2

pawn Код:
if(response)
{
     PlayerData[playerid][Step] = 1;
     if (GetPlayerMoney(playerid) < 500)
     {
        SendClientMessage(playerid, COLOR_RED, "You dont have enough money.");
     }
     else
     {
        GivePlayerMoney (playerid, -500);
        SendClientMessage(playerid, COLOR_GREY, "You paid 500 dollars. Get out of this bulding to start test.");
        SetPlayerCheckpoint(playerid, 2046.8928,-1908.0372,13.5469,280.0000);
     }
}
Reply
#3

It's dont work, it says me, "you dont have enough money" but when i get out of house and get into car, i am doing a test. And if i can't pay it, i can't do it.. so how please
Reply
#4

What?
That code will show "You don't have enough money" if your money is under 500.
If you have more than 500, it will start the test.
Reply
#5

Yes, but i dont know, when i left the house(license school) and there are some driving test cars and when i get in, i can do a test without pay
Reply
#6

pawn Код:
if(response)
{
     PlayerData[playerid][Step] = 1;
     if (GetPlayerMoney(playerid) < 500)
     {
        SendClientMessage(playerid, COLOR_RED, "You dont have enough money.");
        RemovePlayerFromVehicle(playerid);
     }
     else
     {
        GivePlayerMoney (playerid, -500);
        SendClientMessage(playerid, COLOR_GREY, "You paid 500 dollars. Get out of this bulding to start test.");
        SetPlayerCheckpoint(playerid, 2046.8928,-1908.0372,13.5469,280.0000);
     }
}
Is this what you want?
Reply
#7

Actually more accurate would be :
if (GetPlayerMoney(playerid) <= 500)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)