Jump to content
  • 0

Nu se schimba pretul de la /bizfee


Jimmi

Question

Problema intalnita (descriere):ă:Am trecut biz-urile si sbiz-urile pe mysql.Acum cand folosesc /bizfee nu se mai actualizeaza pretul de intrare in biz/sbiz.
Ero(area / rile) / warning-(ul / urile):
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?:Da

[15:26:45] >> mysql_query( Connection handle: 1 )
[15:26:45] CMySQLHandler::Query(SELECT * FROM `sbizz` ORDER BY `ID`) - Successfully executed.
[15:26:45] >> mysql_store_result( Connection handle: 1 )
[15:26:45] CMySQLHandler::StoreResult() - Result was stored.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = '', `Message` = '', `Extortion` = '', EntX = 0.000000, EntY = 0.000000, EntZ = 0.000000, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 0, Price = 0, EPrice = 0, Till = 0, Locked = 0, Interior = 0, Products = 0, MaxProducts = 0, ProductPrice = 0 WHERE ID = 0) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 1, `Owner` = 'Trickster.', `Message` = 'Car Rent LS', `Extortion` = 'Jimmi', EntX = 564.715026, EntY = -1293.530029, EntZ = 17.248199, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 5, Price = 5000000, EPrice = 2000, Till = 10650, Locked = 0, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 1) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'Car Rent LV', `Extortion` = 'No-one', EntX = 2200.639892, EntY = 1394.219970, EntZ = 11.062500, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 5, Price = 2000000, EPrice = 2000, Till = 0, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 2) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'Phone Company', `Extortion` = 'No-one', EntX = 1327.930053, EntY = -1558.560058, EntZ = 13.546899, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 11, Price = 3000000, EPrice = 1, Till = 25525, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 3) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 1, `Owner` = 'Trickster.', `Message` = 'Gas Company LS', `Extortion` = 'No-one', EntX = 1000.109985, EntY = -920.078002, EntZ = 42.328098, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 12, Price = 20000000, EPrice = 15, Till = 1897065, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 4) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'Electrica', `Extortion` = 'No-one', EntX = 1329.920043, EntY = -985.466979, EntZ = 33.896598, ExitX = -959.643981, ExitY = 1955.949951, ExitZ = 9.000000, Level = 10, Price = 23000000, EPrice = 2, Till = 142335145, Locked = 1, Interior = 17, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 5) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'Gas Company LV', `Extortion` = 'No-one', EntX = 0.000000, EntY = 0.000000, EntZ = 999.000000, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 12, Price = 23000000, EPrice = 2, Till = 27540000, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 300 WHERE ID = 6) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'CNN Las Venturas', `Extortion` = 'No-one', EntX = 2079.500000, EntY = 2046.040039, EntZ = 11.057900, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 15, Price = 23000000, EPrice = 5, Till = 2001200000, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 7) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'CNN Los Santos', `Extortion` = 'No-one', EntX = 845.726013, EntY = -1045.329956, EntZ = 25.441999, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 15, Price = 5000000, EPrice = 5, Till = 0, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 8) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'Kart Racing', `Extortion` = 'No-one', EntX = 0.000000, EntY = 0.000000, EntZ = 999.000000, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 20, Price = 23000000, EPrice = 1500, Till = 24330700, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 9) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_query( Connection handle: 1 )
[15:26:46] CMySQLHandler::Query(UPDATE `sbizz` SET `Owned` = 0, `Owner` = 'The State', `Message` = 'Paintball', `Extortion` = 'No-one', EntX = 1310.160034, EntY = -1367.180053, EntZ = 13.522800, ExitX = 0.000000, ExitY = 0.000000, ExitZ = 0.000000, Level = 20, Price = 23000000, EPrice = 4000, Till = 1345381, Locked = 1, Interior = 0, Products = 100, MaxProducts = 500, ProductPrice = 100 WHERE ID = 10) - Successfully executed.
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
[15:26:46] >> mysql_retrieve_row( Connection handle: 1 )
Liniile de cod / sursa / script-ul(obligatoriu):
if(strcmp(cmd, "/bizfee", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        new bouse = PlayerInfo[playerid][pPbiskey];
        new query[256];
        if (bouse == 255) return SendClientMessage(playerid, COLOR_GRAD2, "   Nu detii o afacere !");
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "{00FF00}Folosire:{FFFFFF} /bizfee [EntranceFee]");
        if(strval(tmp) < 0 || strval(tmp) > 2000) return SendClientMessage(playerid, COLOR_WHITE, "Suma minima este de $0, suma maxima este de $2000.");
        if (bouse >= 100)
        {
            if(bouse == 102)
            {
                if(strval(tmp) > 0 && strval(tmp) < 51) { } else { SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Phone Company: {FFFFFF} /bizfee poate fi maxim 50!"); return 1; }
            }
            if(bouse == 103)
            {
                if(strval(tmp) > 0 && strval(tmp) < 51) { } else { SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Gas Company: {FFFFFF} /bizfee poate fi maxim 50!"); return 1; }
            }
            if(bouse == 104)
            {
                if(strval(tmp) > 0 && strval(tmp) < 101) { } else { SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Electricity Company: {FFFFFF} /bizfee poate fi maxim 100!"); return 1; }
            }
            if(bouse == 106 || bouse == 107)
            {
                if(strval(tmp) > 0 && strval(tmp) < 51) { } else { SendClientMessage(playerid, COLOR_WHITE, "{0066FF}CNN: {FFFFFF} /bizfee poate fi maxim 50!"); return 1; }
            }
            SBizzInfo[bouse-100][sbEntranceCost] = strval(tmp);
            format(string, sizeof(string), "Pretul de intrare a fost setat pe $%d.", SBizzInfo[bouse-100][sbEntranceCost]);
            OnPropUpdate();
            SendClientMessage(playerid, COLOR_WHITE, string);
        }
        else
        {
            if(bouse >= 5 && bouse <= 11 || bouse >= 19 && bouse <= 25)
            {
                if(strval(tmp) > 0 && strval(tmp) < 501) { } else { SendClientMessage(playerid, COLOR_WHITE, "{0066FF}24/7: {FFFFFF} /bizfee poate fi maxim 500!"); return 1; }
            }
            BizzInfo[bouse][bEntranceCost] = strval(tmp);
            format(string, sizeof(string), "Pretul de intrare a fost setat pe $%d.", BizzInfo[bouse][bEntranceCost]);
            OnPropUpdate();
            SendClientMessage(playerid, COLOR_WHITE, string);
            format(query,sizeof(query),"UPDATE `bizz` SET `ePrice`='%s'",BizzInfo[bouse][bEntranceCost]);
             mysql_query(query);
        }
    }
    return 1;
}
Link to comment
Share on other sites

Recommended Posts

  • 0

Poftim.Cu asta cumperi si biz si sbiz:

if(strcmp(cmd, "/buybiz", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
		{
			new Float:oldposx, Float:oldposy, Float:oldposz;
			GetPlayerName(playerid, playername, sizeof(playername));
			GetPlayerPos(playerid, oldposx, oldposy, oldposz);
			if(PlayerInfo[playerid][pPbiskey] != 255)
			{
				SendClientMessage(playerid, COLOR_WHITE, "   Deja detii o afacere, scrie /sellbiz daca vrei sa o cumperi pe aceasta.");
				return 1;
			}
			for(new b = 1; b < sizeof(SBizzInfo); b++)
			{
				if(PlayerToPoint(2.0, playerid, SBizzInfo[b][sbEntranceX], SBizzInfo[b][sbEntranceY], SBizzInfo[b][sbEntranceZ]) && SBizzInfo[b][sbOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < SBizzInfo[b][sbLevelNeeded])
					{
						format(string, sizeof(string), "{0066FF}Info: {FFFFFF}You must be level %d to purchase this.",SBizzInfo[b][sbLevelNeeded]);
						SendClientMessage(playerid, COLOR_WHITE, string);
						return 1;
					}
					if(GetPlayerCash(playerid) >= SBizzInfo[b][sbBuyPrice])
					{
						PlayerInfo[playerid][pPbiskey] = b+100;
						SBizzInfo[b][sbOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(SBizzInfo[b][sbOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerMoneyEx(playerid,-SBizzInfo[b][sbBuyPrice]);
						PlayerInfo[playerid][pLocal] = b ;
						PlayerPlayMusic(playerid);
						SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new purchase.");
						SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
						new wakaname1[25],str1[128];
						GetPlayerName(playerid,wakaname1,sizeof(wakaname1));
						format(str1,sizeof(str1),"UPDATE players SET `Money`='%d',`Bizz`='%d' WHERE `username`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pPbiskey],wakaname1);
						mysql_query(str1);
						format(str1,sizeof(str1),"UPDATE `sbizz` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",SBizzInfo[b][sbOwner],b);
						mysql_query(str1);
						UpdateSBizzText(b);
						SetPlayerVirtualWorld(playerid, b);
						MySQLCheckConnection();
						// facultativ. OnPropTextdrawUpdate(3,b);
						return 1;
					}
					else return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Info: {FFFFFF}You don't have the cash for that.");
				}
			}
			for(new b = 0; b < sizeof(BizzInfo); b++)
			{
				if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
					{
						format(string, sizeof(string), "Iti trebuie nivelul %d!",BizzInfo[b][bLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerCash(playerid) >= BizzInfo[b][bBuyPrice])
					{
						PlayerInfo[playerid][pPbiskey] = b+100;
						BizzInfo[b][bOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerMoneyEx(playerid,-BizzInfo[b][bBuyPrice]);
						PlayerInfo[playerid][pLocal] = b ;
						PlayerPlayMusic(playerid);
						SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new purchase.");
						SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
						new wakaname1[25],str1[128];
						GetPlayerName(playerid,wakaname1,sizeof(wakaname1));
						format(str1,sizeof(str1),"UPDATE players SET `Money`='%d',`Bizz`='%d' WHERE `username`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pPbiskey],wakaname1);
						mysql_query(str1);
						format(str1,sizeof(str1),"UPDATE `bizz` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",BizzInfo[b][bOwner],b);
						mysql_query(str1);
						UpdateBizzText(b);
						SetPlayerVirtualWorld(playerid, b);
						MySQLCheckConnection();
						print("Dude, s-a executat super ok comanda asta, totu mere bine si la mai multe");
						return 1;
					}
					else return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Info: {FFFFFF}You don't have the cash for that.");
				}
			}
		}
		return 1;
	}

 

Link to comment
Share on other sites

  • 0

Uite, de aici

for(new b = 0; b < sizeof(BizzInfo); b++)

sterge acel +100

PlayerInfo[playerid][pPbiskey] = b+100;

Si la comanda /bizzfee, de aici

BizzInfo[bouse - 100][bEntranceCost] = strval(tmp);

sterge acel - 100

Link to comment
Share on other sites

  • 0

Am modificat

for(new b = 0; b < sizeof(BizzInfo); b++)
			{
				if(PlayerToPoint(2.0, playerid, BizzInfo[b][bEntranceX], BizzInfo[b][bEntranceY], BizzInfo[b][bEntranceZ]) && BizzInfo[b][bOwned] == 0)
				{
					if(PlayerInfo[playerid][pLevel] < BizzInfo[b][bLevelNeeded])
					{
						format(string, sizeof(string), "Iti trebuie nivelul %d!",BizzInfo[b][bLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerCash(playerid) >= BizzInfo[b][bBuyPrice])
					{
						PlayerInfo[playerid][pPbiskey];
						BizzInfo[b][bOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerMoneyEx(playerid,-BizzInfo[b][bBuyPrice]);
						PlayerInfo[playerid][pLocal] = b ;
						PlayerPlayMusic(playerid);
						SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new purchase.");
						SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new business help section.");
						new wakaname1[25],str1[128];
						GetPlayerName(playerid,wakaname1,sizeof(wakaname1));
						format(str1,sizeof(str1),"UPDATE players SET `Money`='%d',`Bizz`='%d' WHERE `username`='%s'",GetPlayerCash(playerid),PlayerInfo[playerid][pPbiskey],wakaname1);
						mysql_query(str1);
						format(str1,sizeof(str1),"UPDATE `bizz` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",BizzInfo[b][bOwner],b);
						mysql_query(str1);
						UpdateBizzText(b);
						SetPlayerVirtualWorld(playerid, b);
						MySQLCheckConnection();
						print("Dude, s-a executat super ok comanda asta, totu mere bine si la mai multe");
						return 1;
					}
					else return SendClientMessage(playerid, COLOR_WHITE, "{0066FF}Info: {FFFFFF}You don't have the cash for that.");
				}
			}
		}
		return 1;
	}
	si acuma la /stats ramane biz 255.Adica nu imi da niciun id.

 

Link to comment
Share on other sites

  • 0

Merge acuma se actualizeaza in baza de date dar scrisul de pe server ramane aceleasi si nu iti trage banii acuma cand intri intr-un biz/sbiz.

Textul ala:

public UpdateBizzText(bizid)
{
	new string[512];
	if(BizzInfo[bizid][bOwned] == 0) format(string, sizeof(string), "{00BC00}De Vanzare!\nNume: {F6F6F6}%s\n{00BC00}Detinator: {F6F6F6}-\n{00BC00}Pret: {F6F6F6}$%d\n{00BC00}Level: {F6F6F6}%d\n{00BC00}ID-ul afacerii: {F6F6F6}%d", BizzInfo[bizid][bMessage], BizzInfo[bizid][bBuyPrice], BizzInfo[bizid][bLevelNeeded], bizid);
    if(BizzInfo[bizid][bOwned] == 1) format(string, sizeof(string), "{00BC00}Nume: {F6F6F6}%s\n{00BC00}Detinator: {F6F6F6}%s\n{00BC00}Extortion: {F6F6F6}%s\n{00BC00}Intrare: {F6F6F6}$%d\n{00BC00}ID-ul afacerii: {F6F6F6}%d", BizzInfo[bizid][bMessage], BizzInfo[bizid][bOwner], BizzInfo[bizid][bExtortion], BizzInfo[bizid][bEntranceCost], bizid);
	Update3DTextLabelText(BizzLabel[bizid], COLOR_WHITE, string);
	return 1;
}

public UpdateSBizzText(bizid)
{
	new string[512];
	if(SBizzInfo[bizid][sbOwned] == 0) format(string, sizeof(string), "{00BC00}De Vanzare!\nNume: {F6F6F6}%s\n{00BC00}Detinator: {F6F6F6}-\n{00BC00}Pret: {F6F6F6}$%d\n{00BC00}Level: {F6F6F6}%d\n{00BC00}ID-ul afacerii S: {F6F6F6}%d", SBizzInfo[bizid][sbMessage], SBizzInfo[bizid][sbBuyPrice], SBizzInfo[bizid][sbLevelNeeded], bizid);
    if(SBizzInfo[bizid][sbOwned] == 1) format(string, sizeof(string), "{00BC00}Nume: {F6F6F6}%s\n{00BC00}Detinator: {F6F6F6}%s\n{00BC00}Extortion: {F6F6F6}%s\n{00BC00}Intrare: {F6F6F6}$%d\n{00BC00}ID-ul afacerii S: {F6F6F6}%d", SBizzInfo[bizid][sbMessage], SBizzInfo[bizid][sbOwner], SBizzInfo[bizid][sbExtortion], SBizzInfo[bizid][sbEntranceCost], bizid);
	Update3DTextLabelText(SBizzLabel[bizid], COLOR_WHITE, string);
	return 1;
}

in consola arata ca mi-a tras bani

http://imgur.com/G52uMMO

Edited by jimmi
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.