isplayerinrangeofpoint & else if not
#6

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Код:
if (strcmp("/open police", cmdtext, true, 10) == 0)
	{
	    if(GetPlayerSkin(playerid)!=280) return SendClientMessage(playerid, COLOR_ERROR,"You are not a cop");
  if(IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
		{
		    
  	  MoveDynamicObject(copgate, 1151.3508, -1222.7382, 9.6951, 3);
		SendClientMessage(playerid, COLOR_BLUE, "Gate: Opened.");
		return 1;
	}
        else if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1151.2433,-1226.3589,17.2747))
		    {
		        SendClientMessage(playerid, COLOR_RED, "You are not near the gate.");
                        return 1;
			}
Quote:
Originally Posted by Andre02
Посмотреть сообщение
Try this:

PHP код:
if(strcmp("/open police"cmdtexttrue10) == 0)
{
    if(
GetPlayerSkin(playerid)!=280) return SendClientMessage(playeridCOLOR_ERROR,"You are not a cop");
    if(
IsPlayerInRangeOfPoint(playerid3.01151.2433,-1226.3589,17.2747));
    {
        
MoveDynamicObject(copgate1151.3508, -1222.73829.69513);
        
SendClientMessage(playeridCOLOR_BLUE"Gate: Opened.");
    }
    else
    {
         
SendClientMessage(playeridCOLOR_RED"You are not near the gate.");
    }
    return 
1;

And read this: https://sampwiki.blast.hk/wiki/Control_Structures#else
and this: https://sampwiki.blast.hk/wiki/Control_Structures#else_if
But what you are not satisfied with my code?
Reply


Messages In This Thread
isplayerinrangeofpoint & else if not - by Aleksabre - 12.08.2015, 23:12
Re: isplayerinrangeofpoint & else if not - by DarkLored - 12.08.2015, 23:17
Re: isplayerinrangeofpoint & else if not - by kennydalglish - 12.08.2015, 23:19
Re: isplayerinrangeofpoint & else if not - by kennydalglish - 12.08.2015, 23:22
Re: isplayerinrangeofpoint & else if not - by Andre02 - 12.08.2015, 23:22
Re: isplayerinrangeofpoint & else if not - by kennydalglish - 12.08.2015, 23:27
Re: isplayerinrangeofpoint & else if not - by Andre02 - 12.08.2015, 23:32
Re: isplayerinrangeofpoint & else if not - by Aleksabre - 13.08.2015, 00:11
Re: isplayerinrangeofpoint & else if not - by zDivine - 13.08.2015, 00:14
Re: isplayerinrangeofpoint & else if not - by Aleksabre - 13.08.2015, 00:15

Forum Jump:


Users browsing this thread: 1 Guest(s)