Well I made a command, /buygun when in a business Ammunation.
But when I use /buygun [name] It doesnt lower my cash which I want tom like I make it 2000, and it lowers 4000.
Код:
if(strcmp(cmd, "/buygun", true) == 0)
{
if(!IsPlayerInRangeOfPoint(playerid, 50, 286.148986,-40.644397,1001.515625))
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in a Ammunation!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "_______________________________________");
SendClientMessage(playerid, COLOR_GREY, " Shotgun $2000, MP5 $4000, Vest $3000 ");
SendClientMessage(playerid, COLOR_GREY, "_______________________________________");
return 1;
}
for(new i = 0; i < sizeof(BizzInfo); i++)
if(strcmp(tmp,"Shotgun",true) == 0)
{
if(PlayerInfo[playerid][pCash] > 1999)
{
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-2000;
BizzInfo[i][bTill] += 2000;
GivePlayerWeapon(playerid, 25, 999999); PlayerInfo[playerid][pGun3] = 25; //shotgun
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
if(strcmp(tmp,"Vest",true) == 0)
{
if(PlayerInfo[playerid][pCash] > 2999)
{
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-3000;
BizzInfo[i][bTill] += 3000;
SetPlayerArmour(playerid, 50.0);
}
}
for(new i = 0; i < sizeof(BizzInfo); i++)
if(strcmp(tmp,"Mp5",true) == 0)
{
if(PlayerInfo[playerid][pCash] > 3999)
{
GivePlayerWeapon(playerid, 29, 999999); PlayerInfo[playerid][pGun4] = 29; //mp5
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]-4000;
BizzInfo[i][bTill] += 4000;
}
}
return 1;
}
I really don't udnerstand it, besides it is supposed the cash you pay goes to the owner of the business.