IsPlayerInRangeOfPoint ( Wanna Add 2 Ranges ) {HELP}
#1

Hey Guys,
I Need A But Help I Need To Put Two Ranges For Medic How Can I Do It I Tried Many Ways But I Does Not Worked So Please Help Me


Quote:
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1252.2406,321.0259,-11.7422)) return( I Wanna Add 1 More Range Point ) SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 57);
}

Quote:
I Tried This Formula But It Dosen't Work
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1252.2406,321.0259,-11.7422)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 57);
}
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 99998888888) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 57);
}

Reply
#2

Like this maybe? Wtf is that position 10, 99998888888 ?

PHP код:
else if(IsMedic(playerid))
{
    if(!
IsPlayerInRangeOfPoint(playerid101252.2406,321.0259,-11.7422)) return SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
    {
        
SSSShowDialog(playerid57);
    }
    else if(!
IsPlayerInRangeOfPoint(playerid1099998888888) return SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
    {
        
SSSShowDialog(playerid57);
    }

Reply
#3

Quote:
(13887) : error 029: invalid expression, assumed zero
(13887) : warning 215: expression has no effect
(13887) : error 001: expected token: ";", but found "if"

Quote:
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1252.2406,321.0259,-11.7422)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 57);
}
13887 :- else if(!IsPlayerInRangeOfPoint(playerid, 10, 9999888888 return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 57);
}
}

These Errors RIP Me -_-
Thanks bro But...
Reply
#4

You're missing the coordinates. I've duplicated them, just change

PHP код:
else if(IsMedic(playerid))
{
    if(!
IsPlayerInRangeOfPoint(playerid101252.2406,321.0259,-11.7422)) return SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
    {
        
SSSShowDialog(playerid57);
    }
    else if(!
IsPlayerInRangeOfPoint(playerid101252.2406,321.0259,-11.7422)) return SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
    {
        
SSSShowDialog(playerid57);
    }

Reply
#5

Quote:
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1252.2406,321.0259,-11.7422)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 33);
}
else if(!IsPlayerInRangeOfPoint(playerid, 10, -196.6472,-1741.1837,675.7687)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 33);
}
}

Still Errors ARe :-
Quote:
(13887) : error 029: invalid expression, assumed zero
(13887) : warning 215: expression has no effect
(13887) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Reply
#6

Show the whole code please
Reply
#7

Quote:
CMD:locker(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(IsACop(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 2.2,256.2174,77.3295,1004.0344)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
if(DayNoPD == 1) return SendClientMessage(playerid, COLOR_OOC, "You can't access your locker ((/day)).");
SSSShowDialog(playerid, 5);
}
else if(IsAGov(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 352.1964,173.3516,1025.7891)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SetPlayerArmour(playerid, 100);
SetPlayerHealth(playerid, 100);
GiveDodWeapon(playerid, 29, 999);
GiveDodWeapon(playerid, 24, 999);
GiveDodWeapon(playerid, 31, 999);
GiveDodWeapon(playerid, 34, 999);
format(string, sizeof(string), "* %s grabs a Desert Eagel ,MP5 ,M4 and Sniper from the lockers.", RPN(playerid), params);
SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
}
else if(IsAReporter(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 2, 1203.1322,-751.8103,1073.1819)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 27);
}
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1252.2406,321.0259,-11.7422)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 33);
}
31887 else if(!IsPlayerInRangeOfPoint(playerid, 10, -196.6472,-1741.1837,675.7687)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 33);
}
}
else if(IsFBI(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 3, 1564.0781,-1671.5887,1723.1050)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 35);
}
else if(IsARES(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 3, 861.6902,96.3586,1006.2343)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
SSSShowDialog(playerid, 43);
}
else if(IsHitman(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 3, 297.5770,-105.2555,985.5322)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
ShowModelSelectionMenu(playerid, undercover, "Select Skin");
}
else SendClientMessage(playerid, COLOR_GREY, "You are not near a locker you can open.");
return 1;
}

Someone Help Guys
Reply
#8

can you highlight the part which is line 13887?
Reply
#9

Quote:
else if(IsMedic(playerid))
{
if(!IsPlayerInRangeOfPoint(playerid, 10, 1252.2406,321.0259,-11.7422)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 33);
}
13887 :- else if(!IsPlayerInRangeOfPoint(playerid, 10, -196.6472,-1741.1837,675.7687)) return SendClientMessage(playerid, COLOR_GREY, "You aren't near your locker.");
{
SSSShowDialog(playerid, 33);
}
}

Still Errors ARe :-
Quote:
(13887) : error 029: invalid expression, assumed zero
(13887) : warning 215: expression has no effect
(13887) : error 001: expected token: ";", but found "if"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

Reply
#10

PHP код:
CMD:locker(playeridparams[])
{
    new 
string[128];

    if(!
IsPlayerLoggedIn(playerid))
        return 
SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");

    if(
IsACop(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid2.2,256.2174,77.3295,1004.0344)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
        
        if(
DayNoPD == 1
            return 
SendClientMessage(playeridCOLOR_OOC"You can't access your locker ((/day)).");

        
SSSShowDialog(playerid5);
    }
    else if(
IsAGov(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid2352.1964,173.3516,1025.7891)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");

        
SetPlayerArmour(playerid100);
        
SetPlayerHealth(playerid100);
        
GiveDodWeapon(playerid29999);
        
GiveDodWeapon(playerid24999);
        
GiveDodWeapon(playerid31999);
        
GiveDodWeapon(playerid34999);
        
format(stringsizeof(string), "* %s grabs a Desert Eagel ,MP5 ,M4 and Sniper from the lockers."RPN(playerid), params);
        
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
    }
    else if(
IsAReporter(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid21203.1322,-751.8103,1073.1819)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
    
        
SSSShowDialog(playerid27);
    }
    else if(
IsMedic(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid101252.2406,321.0259,-11.7422) || !IsPlayerInRangeOfPoint(playerid10, -196.6472,-1741.1837,675.7687)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker."); 

        
SSSShowDialog(playerid33);
    }
    else if(
IsFBI(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid31564.0781,-1671.5887,1723.1050)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
    
        
SSSShowDialog(playerid35);
    }
    else if(
IsARES(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid3861.6902,96.3586,1006.2343)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
        
        
SSSShowDialog(playerid43);
    }
    else if(
IsHitman(playerid))
    {
        if(!
IsPlayerInRangeOfPoint(playerid3297.5770,-105.2555,985.5322)) 
            return 
SendClientMessage(playeridCOLOR_GREY"You aren't near your locker.");
        
        
ShowModelSelectionMenu(playeridundercover"Select Skin");
    }
    else 
SendClientMessage(playeridCOLOR_GREY"You are not near a locker you can open.");

    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)