SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/07/2013, 09:13 AM   #1
Kapone21
Big Clucker
 
Kapone21's Avatar
 
Join Date: Jan 2013
Location: Romania,Braila
Posts: 141
Reputation: -13
Default /buybizz problem godfather

Hello my command /buybiz work ok but the 3D text don't change and still saying this bizz is for sale he change only after restart... how can i make to remove and add a new text 3d after buying?


Code:
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, "Tu ai deja un biz! scrie /sellbiz daca vrei sa-ti iei unul nou");
				return 1;
			}
			for(new b = 0; 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), "Trebuie sa ai nivelul %d",SBizzInfo[b][sbLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerMoney(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);
						GivePlayerMoney(playerid,-SBizzInfo[b][sbBuyPrice]);
						PlayerPlayMusic(playerid);
						SendClientMessage(playerid, COLOR_WHITE, "Felicitari ai cumparat un Business!");
						SendClientMessage(playerid, COLOR_WHITE, "Scrie /businesshelp pentru informatii1");
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateEx(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "Nu ai destui bani");
						return 1;
					}
				}
			}
			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), "You Must Be Level %d To Purchase This",BizzInfo[b][bLevelNeeded]);
						SendClientMessage(playerid, COLOR_GRAD5, string);
						return 1;
					}
					if(GetPlayerMoney(playerid) > BizzInfo[b][bBuyPrice])
					{
						PlayerInfo[playerid][pPbiskey] = b;
						BizzInfo[b][bOwned] = 1;
						GetPlayerName(playerid, sendername, sizeof(sendername));
						strmid(BizzInfo[b][bOwner], sendername, 0, strlen(sendername), 255);
						GivePlayerMoney(playerid,-BizzInfo[b][bBuyPrice]);
						PlayerPlayMusic(playerid);
						SetPlayerInterior(playerid,BizzInfo[b][bInterior]);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						SetPlayerPos(playerid,BizzInfo[b][bExitX],BizzInfo[b][bExitY],BizzInfo[b][bExitZ]);
						PlayerInfo[playerid][pInt] = BizzInfo[b][bInterior];
						PlayerInfo[playerid][pLocal] = b ;
						SendClientMessage(playerid, COLOR_WHITE, "Felicitari! Ai cumparat un business!");
						SendClientMessage(playerid, COLOR_WHITE, "Scrie /businesshelp pentru informatii!");
                        DateProp(playerid);
						OnPropUpdate();
						OnPlayerUpdateEx(playerid);
						return 1;
					}
					else
					{
						SendClientMessage(playerid, COLOR_WHITE, "You don't have the cash for that");
						return 1;
					}
				}
			}
		}
		return 1;
	}
Kapone21 is offline   Reply With Quote
Old 27/07/2013, 09:18 AM   #2
arjanforgames
Huge Clucker
 
arjanforgames's Avatar
 
Join Date: Mar 2011
Location: Your front door
Posts: 289
Reputation: 5
Default Re: /buybizz problem godfather

http://wiki.sa-mp.com/wiki/Update3DTextLabelText
__________________
Carry out a random act of kindness, with no expectation of reward, safe in the knowledge that one day someone might do the same for you.
arjanforgames is offline   Reply With Quote
Old 27/07/2013, 10:29 AM   #3
Kapone21
Big Clucker
 
Kapone21's Avatar
 
Join Date: Jan 2013
Location: Romania,Braila
Posts: 141
Reputation: -13
Default Re: /buybizz problem godfather

one thanks
Kapone21 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/buybizz command ? NewbBeginner Help Archive 2 16/02/2011 05:41 PM
[HELP]Godfather House Car Problem eDz0r Help Archive 5 13/06/2010 05:30 PM
Problem with Godfather GM FreeSoul Help Archive 1 25/04/2009 07:04 AM
Problem With GodFather When I Add Houses Almamu Help Archive 3 30/03/2009 02:19 PM


All times are GMT. The time now is 05:02 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.