Prone Script.
#1

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;
	}
Reply
#2

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

-1 to -0.5
Reply
#3

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. ~.~
Reply
#4

Freeze him?
Reply
#5

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

ah
Reply
#7

Anyone else? Ideas?
Reply
#8

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..
Reply
#9

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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)