SA-MP Forums Archive
(HELP)GivePlayerMoney, GetPlayerMoney - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (HELP)GivePlayerMoney, GetPlayerMoney (/showthread.php?tid=268664)



(HELP)GivePlayerMoney, GetPlayerMoney - spaty2 - 13.07.2011

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..


Re: (HELP)GivePlayerMoney, GetPlayerMoney - WooTFTW - 13.07.2011

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



Re: (HELP)GivePlayerMoney, GetPlayerMoney - spaty2 - 13.07.2011

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


Re: (HELP)GivePlayerMoney, GetPlayerMoney - WooTFTW - 13.07.2011

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.


Re: (HELP)GivePlayerMoney, GetPlayerMoney - spaty2 - 13.07.2011

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


Re: (HELP)GivePlayerMoney, GetPlayerMoney - WooTFTW - 13.07.2011

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?


Re: (HELP)GivePlayerMoney, GetPlayerMoney - 22reiko - 13.07.2011

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