25.11.2010, 17:51
(
Последний раз редактировалось XoSarahMoX; 25.11.2010 в 18:29.
)
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/buydeagle", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 308.0848,-141.4177,999.6016))
{
GetPlayerMoneyNew(playerid);
GivePlayerWeapon(playerid, 24, 10);
GivePlayerMoneyNew(playerid, -2500);
SetPlayerAmmo(playerid, 2, 10);
}
return 1;
}
if (strcmp("/buyshotgun", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 308.0848,-141.4177,999.6016))
{
GetPlayerMoneyNew(playerid);
GivePlayerWeapon(playerid, 25, 20);
GivePlayerMoneyNew(playerid, -1500);
SetPlayerAmmo(playerid, 3, 20);
}
return 1;
}
if (strcmp("/buycolt", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5, 308.0848,-141.4177,999.6016))
{
GetPlayerMoneyNew(playerid);
GivePlayerWeapon(playerid, 22, 30);
GivePlayerMoneyNew(playerid, -1000);
SetPlayerAmmo(playerid, 2, 30);
}
return 1;
}
return 1;
}
, but I want it so that it checks the players money:Код:
GetPlayerMoneyNew(playerid);
. I just need the part where if they don't have the money they cant buy from the store. Atm it makes the money negative if you don't have enough money :/. Thanks for reading and hopefully someone can help
! And if I am doing anything wrong in the code please tell me ^-^ thanks for reading again!


