Script BUG help - 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: Script BUG help (
/showthread.php?tid=335855)
Script BUG help -
boyan96 - 20.04.2012
PHP код:
stock BuyBusiness(playerid, bizid)
{
new string2[256];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
#if defined PRINT_HOUSES
printf("%s Bought Store ID %d", name, bizid);
#endif
GivePlayerMoney(playerid, -bInfo[bizid][bCost]);
format(string2,sizeof(string2), BIZ_FILE, bizid);
INI_Open(string2);
INI_WriteString("Name", name);
INI_WriteInt("Locked", 0);
INI_Save();
INI_Close();
bInfo[bizid][bName] = name;
bInfo[bizid][bLocked] = 0;
SetPlayerScore(playerid, - 80000);
ShowBoughtStoreMessage(playerid);
return 1;
}
What is wrong here I wont when player buy a bussiness to get - 80000 score
Re: Script BUG help -
Xaviour212 - 20.04.2012
remove
SetPlayerScore(playerid, - 80000);
Re: Script BUG help -
Bogdan1992 - 20.04.2012
Problem solved. You were setting them to -80000 instead to give them.
pawn Код:
stock BuyBusiness(playerid, bizid)
{
new string2[256];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
#if defined PRINT_HOUSES
printf("%s Bought Store ID %d", name, bizid);
#endif
GivePlayerMoney(playerid, -bInfo[bizid][bCost]);
format(string2,sizeof(string2), BIZ_FILE, bizid);
INI_Open(string2);
INI_WriteString("Name", name);
INI_WriteInt("Locked", 0);
INI_Save();
INI_Close();
bInfo[bizid][bName] = name;
bInfo[bizid][bLocked] = 0;
GivePlayerScore(playerid, - 80000);
ShowBoughtStoreMessage(playerid);
return 1;
}
EDIT: Xaviour212 was faster
Re: Script BUG help -
boyan96 - 20.04.2012
but I want to take their score (80000)
Re: Script BUG help -
Xaviour212 - 20.04.2012
change
SetPlayerScore(playerid, - 80000); to
SetPlayerScore(playerid, 80000);
Re: Script BUG help -
boyan96 - 20.04.2012
PHP код:
stock BuyBusiness(playerid, bizid)
{
new string2[256];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
#if defined PRINT_HOUSES
printf("%s Bought Store ID %d", name, bizid);
#endif
GivePlayerMoney(playerid, -bInfo[bizid][bCost]);
format(string2,sizeof(string2), BIZ_FILE, bizid);
INI_Open(string2);
INI_WriteString("Name", name);
INI_WriteInt("Locked", 0);
INI_Save();
INI_Close();
bInfo[bizid][bName] = name;
bInfo[bizid][bLocked] = 0;
ShowBoughtStoreMessage(playerid);
SetPlayerScore(playerid, 80000);
return 1;
}
but this do not get from them 80000 score and try with SetPlayerScore(playerid, -80000); and again do not get from them the score
Re: Script BUG help -
Bogdan1992 - 20.04.2012
pawn Код:
stock BuyBusiness(playerid, bizid)
{
new string2[256], score = GetPlayerScore(playerid);
new name[24];
GetPlayerName(playerid, name, sizeof(name));
#if defined PRINT_HOUSES
printf("%s Bought Store ID %d", name, bizid);
#endif
GivePlayerMoney(playerid, -bInfo[bizid][bCost]);
format(string2,sizeof(string2), BIZ_FILE, bizid);
INI_Open(string2);
INI_WriteString("Name", name);
INI_WriteInt("Locked", 0);
INI_Save();
INI_Close();
bInfo[bizid][bName] = name;
bInfo[bizid][bLocked] = 0;
ShowBoughtStoreMessage(playerid);
SetPlayerScore(playerid, score - 80000);
return 1;
}
Re: Script BUG help -
boyan96 - 20.04.2012
and this don't work
Re: Script BUG help -
boyan96 - 20.04.2012
someone ?
Re: Script BUG help -
Marco_Valentine - 20.04.2012
SetPlayerScore(killerid, GetPlayerScore(killerid) + 80000);
to add 80000 to their score
SetPlayerScore(killerid, GetPlayerScore(killerid) - 80000);
to take 80000 from their score