SA-MP Forums Archive
/exit cmd. - 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: /exit cmd. (/showthread.php?tid=412909)



/exit cmd. - kepa333 - 03.02.2013

Hello there i realy need to fix this cmd so i gonna ask here again.

Here is an explain about a problem:

[ame="http://www.youtube.com/watch?v=JcjHXzrVP_A"]http://www.youtube.com/watch?v=JcjHXzrVP_A[/ame]

bizz exit part:

Код HTML:
			if(BizzEntered[playerid] != 9999)
		    {
		        new i = BizzEntered[playerid];

				if (IsPlayerInRangeOfPoint(playerid, 3,BizzInfo[i][bExitX], BizzInfo[i][bExitY], BizzInfo[i][bExitZ]))
				{
				    SafeSetPlayerInterior(playerid,0);
					SetPlayerVirtualWorld(playerid, 0);
					OnPlayerExitFood(playerid);
					SafeSetPlayerPos(playerid,BizzInfo[i][bEntranceX],[bEntranceY],BizzInfo[i][bEntranceZ]);
					SetPlayerVirtualWorld(playerid, 0);
					BizzEntered[playerid] = 9999;
				}
			}
bizz enter part:

Код HTML:
			for(new i = 0; i < sizeof(BizzInfo); i++)
			{
				if (IsPlayerInRangeOfPoint(playerid, 5,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
				{
					if(PlayerInfo[playerid][pPbiskey] == i || GetPlayerMoney(playerid) >= BizzInfo[i][bEntranceCost])
					{
						if(PlayerInfo[playerid][pPbiskey] != i)
						{
							if(BizzInfo[i][bLocked] == 1)
							{
								GameTextForPlayer(playerid, "~r~Closed", 5000, 1);
								return 1;
							}
							if(BizzInfo[i][bProducts] == 0)
							{
								GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
								return 1;
							}
							SafeGivePlayerMoney(playerid,-BizzInfo[i][bEntranceCost]);
							format(string, sizeof(string), "~r~-$%d~n~~w~type /exit~n~to get out", BizzInfo[i][bEntranceCost]);
							BizzInfo[i][bTill] += BizzInfo[i][bEntranceCost];
							ExtortionBiz(i, BizzInfo[i][bEntranceCost]);
							BizzInfo[i][bProducts]--;
							OnPropUpdate(2,i);
							GameTextForPlayer(playerid, string, 5000, 3);
						}
						PlayerInfo[playerid][pInteriorNr] = BizzInfo[i][bInteriorNr];
						SetPlayerVirtualWorld(playerid,BizzInfo[i][bVirWorld]);
						SafeSetPlayerInterior(playerid,BizzInfo[i][bInterior]);
						SafeSetPlayerPos(playerid,BizzInfo[i][bExitX],BizzInfo[i][bExitY],BizzInfo[i][bExitZ]);
						new dood[MAX_PLAYER_NAME];
						GetPlayerName(playerid, dood, sizeof(dood));
						BizzEntered[playerid] = i;
						new h,mi,s,y,m,d;
						getdate(y,m,d);
						gettime(h,mi,s);
						format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s payed $%d to enter biz %d",d,m,y,h,mi,s, dood, BizzInfo[i][bEntranceCost], i);
						printf("%s", string);
						PayLog(string);
						if(BizzInfo[i][bVirWorld] == 0 || BizzInfo[i][bVirWorld] == 1)
						{
						    OnPlayerEnterFood(playerid, 1);
						}
						else if(BizzInfo[i][bVirWorld] == 2 || BizzInfo[i][bVirWorld] == 3)
						{
						    OnPlayerEnterFood(playerid, 2);
						}
						else if(BizzInfo[i][bVirWorld] == 4 || BizzInfo[i][bVirWorld] == 5)
						{
						    OnPlayerEnterFood(playerid, 3);
						}
						else if(BizzInfo[i][bVirWorld] == 6)
						{
						    OnPlayerEnterFood(playerid, 4);
						}
					}
					else
					{
						GameTextForPlayer(playerid, "~r~You dont have the cash", 5000, 1);
					}
				}
			}
If you guys need saving and loading code tell it.


Re: /exit cmd. - Zigonja - 03.02.2013

did you checked if there is another SetPlayerPos?


Re: /exit cmd. - kepa333 - 03.02.2013

there isnt another teleport


Re: /exit cmd. - kepa333 - 04.02.2013

bump.


Re: /exit cmd. - kepa333 - 04.02.2013

Bump plz help me i cant open server becouse of it... Can any one check it via teamewiwer or something?


Re: /exit cmd. - kepa333 - 08.02.2013

bump i cant fix it...


Re: /exit cmd. - Flake. - 08.02.2013

when they exit the building just move the playerpos slightly forward, and maybe make a timer so it freezes the player and lets the map load for a second or two


Re: /exit cmd. - Threshold - 08.02.2013

pawn Код:
SafeSetPlayerPos(playerid,BizzInfo[BizzEntered[playerid]][bEntranceX], BizzInfo[BizzEntered[playerid]][bEntranceY],BizzInfo[BizzEntered[playerid]][bEntranceZ]);



Re: /exit cmd. - [MG]Dimi - 08.02.2013

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
pawn Код:
SafeSetPlayerPos(playerid,BizzInfo[BizzEntered[playerid]][bEntranceX], BizzInfo[BizzEntered[playerid]][bEntranceY],BizzInfo[BizzEntered[playerid]][bEntranceZ]);
This helps a a lot since he has stock of your function SafeSetplayerPos</sarcasm>


Re: /exit cmd. - MattSlater - 09.02.2013

Freeze the player when the use /exit and then set a 3 second timer or so, which will then unfreeze them after the time is up.