SA-MP Forums Archive
Prone Script. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Prone Script. (/showthread.php?tid=146533)



Prone Script. - v0nz - 08.05.2010

I'm using "SetPlayerPos(playerid, x,y,z-1);" right now when the player types /prone he will be teleported underground, but the problem is, I want him to be stuck in the ground and he is teleported through. Is there someway I can create an object that'll keep him in place underground just being able to shoot?

Код:
#include <a_samp>
#include "gl_common"

#define TEXT_WHITE 0xffffffff
#define TEXT_YELLOW 0xffff00ff

//------------------------------------------------

public OnFilterScriptInit()
{
	print("Prone Script Loaded.");
	return 1;
}
//------------------------------------------------

public OnPlayerCommandText(playerid, cmdtext[])
{
	new idx;
	new cmd[256];
	cmd = strtok(cmdtext, idx);

	if(!strcmp(cmdtext, "/prone", true))
	{
		new Float:x,Float:y,Float:z;
 		SendClientMessage(playerid, TEXT_WHITE, "You have gone prone.");
		SetPlayerPos(playerid, x,y,z-1);
 		}
		return 0;
	}



Re: Prone Script. - DRIFT_HUNTER - 08.05.2010

try to change SetPlayerPos(playerid, x,y,z-1);

-1 to -0.5


Re: Prone Script. - v0nz - 08.05.2010

Quote:
Originally Posted by DRIFT_HUNTER
try to change SetPlayerPos(playerid, x,y,z-1);

-1 to -0.5
Tried that aswell before, same result. ~.~


Re: Prone Script. - ruarai - 08.05.2010

Freeze him?


Re: Prone Script. - v0nz - 08.05.2010

If I freeze him using TogglePlayerControllable, I won't be able to have him shoot.


Re: Prone Script. - ruarai - 08.05.2010

ah


Re: Prone Script. - v0nz - 08.05.2010

Anyone else? Ideas?


Re: Prone Script. - Babul - 08.05.2010

maybe AttachObjectToPlayer ID 3095 (platform), sticked below the ground (where he stood on foot)?
the object will move with him, so maybe its possible to walk on it then.. hm..


Re: Prone Script. - v0nz - 08.05.2010

Quote:
Originally Posted by Babul
maybe AttachObjectToPlayer ID 3095 (platform), sticked below the ground (where he stood on foot)?
the object will move with him, so maybe its possible to walk on it then.. hm..
If it is attached to him and his is transfered z-1 then the platform will move z-1 aswell.


Re: Prone Script. - dcmd_crash - 08.05.2010

Why not CreateObject with the platform using GetPlayerPos(playerid, X, Y, Z); Then CreateObject(platformID, X, Y, Z-1); then SetPlayerPos(playerid, X, Y, Z-);

Could work, if you see what I mean? Maybe you'll need to set the object at -2