[HELP] with code.
#1

hello

help me

i want make this if player is not place, not work him
pawn Код:
if(IsAtDuty(playerid))
Like this :
pawn Код:
if(groupVariables[group][gGroupType] != 1) return SCM(playerid, COLOR_GREY, "You are not a cop!");

i did this, and not work
pawn Код:
if(IsAtDuty(playerid)) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
and i am in HQ not work , say me ''You are Not in HQ"

any one help me , +rep.
Reply
#2

Why dont you try

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
Reply
#3

Try with:

pawn Код:
if(!IsAtDuty(playerid)) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
If it doesn't work maybe the problem is in the function
Reply
#4

Quote:
Originally Posted by BeesSi
Посмотреть сообщение
Why dont you try

pawn Код:
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z)) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
Because i have 2 points :
pawn Код:
stock IsAtDuty(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 100.0, 246.806, 107.572, 1003.219)) return 1;
    if(IsPlayerInRangeOfPoint(playerid, 100.0, 288.756,167.346,1007.172)) return 1;
    return 1;
}
Reply
#5

Quote:
Originally Posted by SH********
Посмотреть сообщение
Because i have 2 points :
pawn Код:
stock IsAtDuty(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid, 100.0, 246.806, 107.572, 1003.219)) return 1;
    if(IsPlayerInRangeOfPoint(playerid, 100.0, 288.756,167.346,1007.172)) return 1;
    return 1;
}
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 100.0, 246.806, 107.572, 1003.219) || (IsPlayerInRangeOfPoint(playerid, 100.0, 288.756,167.346,1007.172))) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
Compiled without error for me, try it by yourself.
Reply
#6

Quote:
Originally Posted by ReshiramZekrom
Посмотреть сообщение
Try with:

pawn Код:
if(!IsAtDuty(playerid)) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
If it doesn't work maybe the problem is in the function
Thanks bro for answer and help , i tryed it , and is work in all place, if u are not in HQ is work
Reply
#7

stock IsAtDuty(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 100.0, 246.806, 107.572, 1003.219)) return 1;
if(IsPlayerInRangeOfPoint(playerid, 100.0, 288.756,167.346,1007.172)) return 1;
return 0;
}
Change return 1 with 0
Reply
#8

Thats because you have set your range to 100.0, try lower like 8.0 or 5.0
Reply
#9

Otherwise if you wanna do without the stock you have to use quite the same thing that BeesSi wrotes, but remembere to put "!" before the function (it means that isn't right):

pawn Код:
if(!IsPlayerInRangeOfPoint(playerid, 100.0, 246.806, 107.572, 1003.219) || !IsPlayerInRangeOfPoint(playerid, 100.0, 288.756,167.346,1007.172)) return SCM(playerid, COLOR_GREY, "You are not in HQ!");
Nope, fail. It never will works sorry
Reply
#10

Quote:
Originally Posted by ReshiramZekrom
Посмотреть сообщение
stock IsAtDuty(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 100.0, 246.806, 107.572, 1003.219)) return 1;
if(IsPlayerInRangeOfPoint(playerid, 100.0, 288.756,167.346,1007.172)) return 1;
return 0;
}
Change return 1 with 0
Thanks +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)