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!
if (strcmp("/buydeagle", cmdtext, true, 10) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 10, 308.0848,-141.4177,999.6016))
{
if(GetPlayerMoneyNew(playerid) >= 2500)
{
GetPlayerMoneyNew(playerid);
GivePlayerWeapon(playerid, 24, 10);
GivePlayerMoneyNew(playerid, -2500);
SetPlayerAmmo(playerid, 2, 10);
}
else
{
SendClientMessage(playerid, CHANGE_COLOR," You don't have 2500$");
}
}
}
you solved my problem ^-^ also where do I find the:
?
does anyone know how to make it so that if someone spawns a weapon with
?
|
oh ok
does anyone know how to make it so that if someone spawns a weapon withGivePlayerWeapon they get banned? And maybe I can change my normal GivePlayerWeapon to GivePlayerWeaponNew so that hackers cant spawn their own weapons without buying it in the store ? |
|
< less than
> greater than = equals to <= less than or equals to >= greater than or equals to |
and it didnt work on my script I want to somehow change the normal GivePlayerWeapon thing to something like GivePlayerWeaponNew anyone know how to do that?
|
I looked at the junkbuster thing
and it didnt work on my script I want to somehow change the normal GivePlayerWeapon thing to something like GivePlayerWeaponNew anyone know how to do that? |
stock givePlayerWeapon ( playerid, weaponid )
{
GivePlayerWeapon ( playerid, weaponid, 134122 );
return 1;
}
.