SA-MP Forums Archive
MONEH! - 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: MONEH! (/showthread.php?tid=129665)



MONEH! - Biggs - 23.02.2010


I know this seems dumb question, but i forgot how to make it so when you use a command, whats the code to make it take money off a player who uses a command "e.g. /fix makes you loose 1000$"


Re: MONEH! - VonLeeuwen - 23.02.2010

GetPlayerMoney
GivePlayerMoney
ResetPlayerMoney

I think thats all money commands.


Re: MONEH! - Biggs - 23.02.2010

Quote:
Originally Posted by VonLeeuwen
GetPlayerMoney
GivePlayerMoney
ResetPlayerMoney

I think thats all money commands.
I don't want it to reset money, i just want it to take an amount


Re: MONEH! - bajskorv123 - 23.02.2010

Код:
GivePlayerMoney(playerid, 1000);//Gives you $1000
GivePlayerMoney(playerid, -1000);//Removes $1000



Re: MONEH! - Biggs - 23.02.2010

Oh yeah, haha i forgot, I'm so stupid


Re: MONEH! - VonLeeuwen - 23.02.2010

Agreed.

Just kidding, just kidding Good luck scripting :P


Re: MONEH! - Biggs - 23.02.2010

Ohh damn, idk how to make it so if you don't have 1000$ it will give you a message saying you don't have 1000$

Код:
if (!strcmp("/fix", cmdtext, true))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    RepairVehicle(GetPlayerVehicleID(playerid));
    GivePlayerMoney(playerid, -1000);
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
    return 1;
  }



Re: MONEH! - VonLeeuwen - 23.02.2010

Код:
if (!strcmp("/fix", cmdtext, true))
  {
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
    if(GetPlayerMoney(playerid) < 1000) return SendClientMessage(playerid, 0xFFFFFFFF, "You do not have $1000");
    RepairVehicle(GetPlayerVehicleID(playerid));
    GivePlayerMoney(playerid, -1000);
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
    return 1;
  }
I think that should work, untested tho.


Re: MONEH! - Correlli - 23.02.2010

Quote:
Originally Posted by Biggs
Ohh damn, idk how to make it so if you don't have 1000$ it will give you a message saying you don't have 1000$
https://sampwiki.blast.hk/wiki/GetPlayerMoney


Re: MONEH! - bajskorv123 - 23.02.2010

pawn Код:
if (!strcmp("/fix", cmdtext, true))
{
  new Float:Money;
  Money = GetPlayerMoney(playerid);
  if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not in a vehicle!");
  if(Money => 1000)
  {
    RepairVehicle(GetPlayerVehicleID(playerid));
    GivePlayerMoney(playerid, -1000);
    SendClientMessage(playerid, 0xFFFFFFFF, "Your vehicle has been successfully repaired!");
  }
  return 1;
}