Gate open command
#1

i made this gate command but it doesn't do anything

Код:
	if(strcmp(cmd,"/yaksc",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 7.0,1812.69995117,-2072.80004883,15.30000019))
	    if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6)
	    {
			MoveObject(yskladvlez,1812.69995117,-2072.80004883,8.50000019, 5.000);
			SendClientMessage(playerid, COLOR_YELLOW, "Ja otvori vratata na skladot.");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Ja otvori vratata na skladot.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Ne si clen.");
		}
		return 1;
	}
	if(strcmp(cmd,"/yakso",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1812.69995117,-2072.80004883,15.30000019))
     	if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6)
	    {
			MoveObject(yskladvlez,1812.69995117,-2072.80004883,15.30000019, 5.000);
			SendClientMessage(playerid, COLOR_YELLOW, "Ja zatvori vratata na skladot.");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Ja zatvori vratata na skladot.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Ne si clen .");
		}
		return 1;
	}
 	if(strcmp(cmd,"/yaks1o",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1789.90002441,-2030.09997559,11.00000000))
     	if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6)
	    {
			MoveObject(ysklad, 1789.90002441,-2030.09997559,5.00000000, 5.000);
			SendClientMessage(playerid, COLOR_YELLOW, "Go otvoti skladot.");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Go otvori skladot.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Ne si clen.");
		}
		return 1;
	}
	if(strcmp(cmd,"/yaks1c",true)==0)
	{
	    if(IsPlayerInRangeOfPoint(playerid, 7.0, 1789.90002441,-2030.09997559,11.00000000))
     	if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6||PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6)
	    {
			MoveObject(ysklad, 1789.90002441,-2030.09997559,11.00000000, 5.000);
			SendClientMessage(playerid, COLOR_YELLOW, "Go zatvori Skladot.");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Go zatvori skladot.", sendername);
			ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
		}
		else
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Ne si clen .");
		}
		return 1;
	}
This is not the first gate i have made i have many other and they all work only this one doesn't work i don't know whats the problem i have the
Код:
new ysklad;
and
Код:
new yskladvlez;
i also have assigned the objects like
Код:
ysklad = CreateObject...
But i when i go to the gate and Type /yakso nothing happens i have a same command like this for another 2 gates and they work
Reply
#2

Try with this, using PlayerToPoint and dynamics objects:
Код:
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Код:
new gatename;
Код:
gatename = CreateDynamicObject(ID, X, Y, Z, RotX, RotY, RotZ);
Код:
if(strcmp(cmd,"/yaksc",true)==0)
	{
	    if(PlayerToPoint(Distance, playerid, X, Y, Z))
            {
	        if(PlayerInfo[playerid][pMember] == 6||PlayerInfo[playerid][pLeader] == 6)
	       {
			MoveDynamicObject(gatename, X, Y, Z);
			SendClientMessage(playerid, COLOR_YELLOW, "Ja otvori vratata na skladot.");
			GetPlayerName(playerid, sendername, sizeof(sendername));
			format(string, sizeof(string), "* %s Ja otvori vratata na skladot.", sendername);
			ProxDetector(30.0, playerid, string,                    COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
                }
	}
		else
		{
			SendClientMessage(playerid, COLOR_YELLOW, "Ne si clen.");
		}
		return 1;
	}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)