Quick help.
#1

Could someone fix this? I want someone to only be able to use this command if they are apart of faction 5 and at certain cords.

Код:
		if(strcmp(cmd, "/yakgun", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  
			GetPlayerName(playerid, sendername, sizeof(sendername));
		if(PlayerInfo[playerid][pMember]== 5 ||PlayerInfo[playerid][pLeader] == 5 )
			{
				if(!PlayerToPoint(3.0, playerid, 1202.4243,-986.2501,43.4766))
  {


					if(OnDuty[playerid]==0)
			    {
				  	format(string, sizeof(string), "* Yakuza member %s has taken weapons from Yakuza HQ", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						GivePlayerWeapon(playerid, 24, 60);
						OnDuty[playerid] = 1;
					}
					else if(OnDuty[playerid]==1)
					{
						format(string, sizeof(string), "* Yakuza member %s has put weapons back in Yakuza HQ", sendername);
						ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
						GivePlayerWeapon(playerid, 24, -61);
						OnDuty[playerid] = 1;
					}
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD2, "  You are not at the Yakuza HQ!");
					return 1;
				}
			}

			else
			{
			  SendClientMessage(playerid, COLOR_GRAD1, "  You are not a member of Yakuza!");
			}
		}
		return 1;
	}
Reply
#2

Good!
Reply
#3

maybe say the problem? what i need to divine? say what the problem of the code, error, dont word.
Reply
#4

They can do the command from anywhere and I'm trying to make it they have to be in those cords.
Reply
#5

if(!PlayerToPoint(3.0, playerid, 1202.4243,-986.2501,43.4766))

! means not so your saying if they are not in those coords they can do it

change it to this..

if(PlayerToPoint(3.0, playerid, 1202.4243,-986.2501,43.4766))
Reply
#6

Im guessing this is for the GF script?

Ask in that topic.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)