SA-MP Forums Archive
Bug in /planedm - 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: Bug in /planedm (/showthread.php?tid=577022)



Bug in /planedm - WaJeeH - 08.06.2015

Hi Guyz..
I need your help.
I have created a command, /planedm and i have saved it's position....but there's some mistake there because when i try to test it by /planedm the player keeps falling down like this:



Here is the script:
Код:
COMMAND:planedm(playerid, params[])
{
	new string[128];
	if(PlayerInfo[playerid][pSpawned] == 1)
	{

	if(ServerInfo[sBlockTele] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"This Command Is Disabled By An Adminstrator.");
	return 1;
	}

	if(InSniper[playerid] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command In Sniper DM.");
	return 1;
	}

	if(InDMS[playerid] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command In Deathmatch Stadium.");
	return 1;
	}

	if(InMDM[playerid] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command In Minigun DM.");
	return 1;
	}

	if(Freezed[playerid] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While Freezed.");
	return 1;
	}

	if(PlayerInfo[playerid][pJailed] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command in Jail.");
	return 1;
	}

	if(Caged[playerid] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While Caged.");
	return 1;
	}

	if(InDuel[playerid] == 1)
	{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While in Duel Challenge.");
	return 1;
	}

	if(PlayerInfo[playerid][pTeleTime] > 0)
	{
	SendClientMessage(playerid,COLOR_ERROR,"Please Wait Before Teleporting Again.");
	return 1;
	}
    SetPlayerInterior(playerid, 73);
	SetPlayerPosEx(playerid,1.6274,31.5907,1199.6012,182.6938,0,0);
	SetCameraBehindPlayer(playerid);

	SendClientMessage(playerid,COLOR_ORANGE,"You Have Been Successfully Teleported To Plane DM.");

	format(string, sizeof(string), "%s (%d) Has Been Teleported To plane. (/planedm)",PlayerInfo[playerid][pName],playerid);
	SendClientMessageToOthers(playerid,COLOR_ORANGE,string);

	PlayerInfo[playerid][pTeleTime] = 7;
	}else{
	SendClientMessage(playerid,COLOR_ERROR,"You Cannot Use This Command While You're Dead.");
	}
    return 1;
}



Re: Bug in /planedm - Vince - 08.06.2015

If you use dynamic objects, make sure that they're streamed in first before setting the player's position (Streamer_UpdateEx). Also make sure that you choose the correct interior and virtual world, if applicable.


Re: Bug in /planedm - WaJeeH - 08.06.2015

I didnt Get you..Can you explain more?


Re: Bug in /planedm - JaydenJason - 08.06.2015

Quote:
Originally Posted by Vince
Посмотреть сообщение
If you use dynamic objects, make sure that they're streamed in first before setting the player's position (Streamer_UpdateEx). Also make sure that you choose the correct interior and virtual world, if applicable.
^^^^
You could also try making a 5(can be more/less) second timer to freeze the player, then unfreezing the player once timer ended


Re: Bug in /planedm - WaJeeH - 08.06.2015

Nono, You have totally changed it :/
Read that script and help.


Re: Bug in /planedm - MaxJohnson - 08.06.2015

change the interior and make sure that you have correct saved positions