Problem /bizwithdraw :( HELP PLEASe - 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)
+--- Thread: Problem /bizwithdraw :( HELP PLEASe (
/showthread.php?tid=459692)
Problem /bizwithdraw :( HELP PLEASe -
Kapone21 - 24.08.2013
The problem is my 24/7 shops don't put on bank on respective biz money look the codes:
Код:
for(new i = 0; i < sizeof( BizzInfo ); i++)
{
if(IsPlayerInRangeOfPoint( playerid, 3, BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
{
if(GetPlayerVirtualWorld( playerid ) == 0)
{
if(BizzInfo[i][bLocked] == 0)
{
SetPlayerInterior( playerid, BizzInfo[i][bInteriorID]);
SetPlayerPos( playerid, BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]);
PlayerInfo[playerid][InBusiness] = i;
SetPlayerVirtualWorld( playerid, BizzInfo[i][bVirWorld]);
PlayerInfo[playerid][pVirWorld] = BizzInfo[i][bVirWorld];
if(BizzInfo[i][bRadio] != 0 && BizzInfo[i][bRadio] != RADIOS+1)
{
new cRadio = BizzInfo[i][bRadio];
switch(cRadio)
{
case 1:
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1283687");
}
case 2:
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1979774");
}
case 3:
{
StopAudioStreamForPlayer(playerid);
PlayAudioStreamForPlayer(playerid, "http://yp.shoutcast.com/sbin/tunein-station.pls?id=1281016");
}
}
}
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else
{
GameTextForPlayer(playerid, "~r~ESTE INCHIS!", 1000, 5);
}
}
}
}
here part of a buy command
Код:
if (item == 1 && GetPlayerMoney(playerid) > 500)
{
GivePlayerMoney(playerid,- 500);
PlayerInfo[playerid][pCash] -= 500;
BizzInfo[PlayerInfo[playerid][InBusiness]][bTill] += 500;
BizzInfo[PlayerInfo[playerid][InBusiness]][bProducts] -= 1;
SendClientMessage(playerid, COLOR_RED, "{FFFFFF}(({6699FF}INFO: Ai nevoie de o cartela pentru a folosi telefonul!))");
SendClientMessage(playerid, COLOR_RED, "{FFFFFF}(({6699FF}INFO: Poti cumpara o cartela de la un {FFCC33}Orange Shop {6699FF}sau {FF0033}Vodafone Shop{FFFFFF}))");
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
new randphone = 1000 + random(8999);//minimum 1000 max 9999
PlayerInfo[playerid][pPnumber] = randphone;
SendClientMessage(playerid, COLOR_GRAD4, string);
return 1;
}
Bizwithdraw
Код:
if(strcmp(cmd, "/bizwithdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new bouse = PlayerInfo[playerid][pPbiskey];
if (bouse == 255)
{
SendClientMessage(playerid, COLOR_GRAD2, " Nu detii un business");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
format(string, sizeof(string), " You have $%d in your Business Bank.", BizzInfo[bouse][bTill]);
SendClientMessage(playerid, COLOR_GRAD3, string);
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bizwithdraw [amount]");
return 1;
}
new cashdeposit = strvalEx(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bizwithdraw [amount]");
return 1;
}
if(cashdeposit > BizzInfo[bouse][bTill] || cashdeposit < 1)
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough money!");
return 1;
}
else
{
PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash]+cashdeposit;
GivePlayerMoney(playerid,cashdeposit);
BizzInfo[bouse][bTill] -= cashdeposit;
format(string, sizeof(string), " You have withdrawn $%d from your Business Bank.", cashdeposit);
SaveBusiness(bouse);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
}
return 1;
}
The problem is: when a player buy something from shop , command don't put on bank of respective bizz money
when i type /bizwithdraw appear 0 money on bank

what's wrong?
Re: Problem /bizwithdraw :( HELP PLEASe -
Kapone21 - 24.08.2013
heelp

(