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: GetPlayerMoney (
/showthread.php?tid=78954)
GetPlayerMoney -
[TouchX]Ash - 24.05.2009
Hey.
Код:
if (GetPlayerMoney(playerid) > {Amount?} )
{
if(strcmp(gunid, "stretch", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A Stretch");
HouseInfo[house][hVec] = 409;
GivePlayerMoney(playerid,-50000);
}
else if(strcmp(gunid, "zr350", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A ZR-350");
HouseInfo[house][hVec] = 477;
GivePlayerMoney(playerid,-100000);
}
else if(strcmp(gunid, "stallion", true, strlen(gunid)) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A Stallion");
HouseInfo[house][hVec] = 439;
GivePlayerMoney(playerid,-150000);
}
else
{
SendClientMessage(playerid, COLOR_RED, " You can't afford that {Amount?} ");
return 1;
}
}
How would I make it so, for every different price, if you don't have the correct amount of money you can't buy it?
Thanks in advance and I respect if you don't want to help, because of it being within the GodFather, but it will help for other scripts.
Re: GetPlayerMoney -
LTomi - 24.05.2009
Код:
if(strcmp(gunid, "stretch", true, strlen(gunid)) == 0)
{
if (GetPlayerMoney(playerid) >= 50000)
{
SendClientMessage(playerid, COLOR_BLUE, "New Upgrade: Your House Car Is Now A Stretch");
HouseInfo[house][hVec] = 409;
GivePlayerMoney(playerid,-50000);
}
else
{
SendClientMessage(playerid, COLOR_RED, "You can't afford that!");
}
return 1;
}
Do it with all cars, I think.
Re: GetPlayerMoney -
[TouchX]Ash - 24.05.2009
Works a treat! Thank you very much =]
Much appreciated.