[Ajuda] Tapete de Pregos flutuando :(
#1

Olб pessoal, estou com um pequeno problema no tapete de pregos, ele fica praticamente flutuando e quando dou /deletartapete ele some mais o local continua a dar dano jб procurei search e nгo conseguir resolver o problema se poderem me ajudar agradeзo
OLHA AKI:
Код:
#define FILTERSCRIPT
#include <a_samp>
#define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3)
new
Tapete,
Angle,
Float:xx,
Float:yy,
Float:zz;
forward
      PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward
	  Pneu(playerid);
public
     PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
//	    printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}
public
     OnFilterScriptInit()
{

	SetTimer("Pneu",199,1);
	return 1;
}
public
    Pneu(playerid)
{
new Dano[4];
if (IsPlayerInAnyVehicle(playerid))
{
if (PlayerToPoint(5.0, playerid,xx,yy,zz))
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], Dano[3]);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1));
GameTextForPlayer(playerid,"~y~[~w~H~g~T~~r~S] ~w~Pneu Furado",6000,1);
}
}
}

public
     OnPlayerCommandText(playerid, cmdtext[])
{

if (strcmp("/criartapete", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid,xx,yy,zz);
GetPlayerFacingAngle(playerid, Angle);
Tapete = CreateObject(2899, xx, yy, zz, 0, 0, Angle);

return 1;
}

if (strcmp("/deletartapete", cmdtext, true, 10) == 0)
{
DestroyObject(Tapete);

return 1;
}

return 0;
}
Reply
#2

Quote:
Originally Posted by Andrielbad
Посмотреть сообщение
Olб pessoal, estou com um pequeno problema no tapete de pregos, ele fica praticamente flutuando e quando dou /deletartapete ele some mais o local continua a dar dano jб procurei search e nгo conseguir resolver o problema se poderem me ajudar agradeзo
OLHA AKI:
Код:
#define FILTERSCRIPT
#include <a_samp>
#define TireDano(%1,%2,%3,%4) %1 | (%2 << 1) | (%3 << 2) | (%4 << 3)
new
Tapete,
Angle,
Float:xx,
Float:yy,
Float:zz;
forward
      PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
forward
	  Pneu(playerid);
public
     PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
	{
		new Float:oldposx, Float:oldposy, Float:oldposz;
		new Float:tempposx, Float:tempposy, Float:tempposz;
		GetPlayerPos(playerid, oldposx, oldposy, oldposz);
		tempposx = (oldposx -x);
		tempposy = (oldposy -y);
		tempposz = (oldposz -z);
//	    printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
		if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
		{
			return 1;
		}
	}
	return 0;
}
public
     OnFilterScriptInit()
{

	SetTimer("Pneu",199,1);
	return 1;
}
public
    Pneu(playerid)
{
new Dano[4];
if (IsPlayerInAnyVehicle(playerid))
{
if (PlayerToPoint(5.0, playerid,xx,yy,zz))
{
GetVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], Dano[3]);
UpdateVehicleDamageStatus(GetPlayerVehicleID(playerid), Dano[0], Dano[1], Dano[2], TireDano(1, 1, 1, 1));
GameTextForPlayer(playerid,"~y~[~w~H~g~T~~r~S] ~w~Pneu Furado",6000,1);
}
}
}

public
     OnPlayerCommandText(playerid, cmdtext[])
{

if (strcmp("/criartapete", cmdtext, true, 10) == 0)
{
GetPlayerPos(playerid,xx,yy,zz);
GetPlayerFacingAngle(playerid, Angle);
Tapete = CreateObject(2899, xx, yy, zz, 0, 0, Angle);

return 1;
}

if (strcmp("/deletartapete", cmdtext, true, 10) == 0)
{
DestroyObject(Tapete);

return 1;
}

return 0;
}
ta bugado so no cod , ou vc duplico sas coisa '-'

pawn Код:
GetPlayerPos(playerid,xx,yy,zz);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)