Need help with object
#1

Im making a defuse system but the problem is, that looks like the script doesnt check if the player is near object
My code
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new Float:x, Float:y, Float:z;
	new Float:q, Float:w, Float:e;
	new deton;
	GetObjectPos(deton, q,w,e);
	if (strcmp("/detonate", cmdtext, true, 10) == 0)
	{
		GetPlayerPos(playerid, x,y,z);
		deton = CreateObject(1252,x,y,z,0,0,0);
		GameTextForPlayer(playerid, "Bomb planted!",2000,3);
		return 1;
	}
	if (strcmp("/defuse", cmdtext, true, 10) == 0)
	{
		if(IsPlayerInRangeOfPoint(playerid, 10.5,q,w,e))
		{
		TextDrawShowForPlayer(playerid,Textdraw0[playerid]);
		TextDrawShowForPlayer(playerid,Textdraw1[playerid]);
		TextDrawShowForPlayer(playerid,Textdraw2[playerid]);
		GameTextForPlayer(playerid, "Defusing bomb!",2000,3);
		taim = SetTimer("defuse",50,true);
		playerid = defid;
		}
		else
		{
		GameTextForPlayer(playerid, "You need to be near the bomb!",2000,3);
		}
		return 1;
	}
	return 0;
}
Reply


Messages In This Thread
Need help with object - by Kain1297 - 27.07.2012, 01:19
Re: Need help with object - by Ranama - 27.07.2012, 01:32
Respuesta: Need help with object - by Kain1297 - 27.07.2012, 01:44
Re: Need help with object - by Devilxz97 - 27.07.2012, 01:46
Respuesta: Need help with object - by Kain1297 - 27.07.2012, 01:48

Forum Jump:


Users browsing this thread: 3 Guest(s)