Command problem
#1

Hi I have a problem with my command

pawn Код:
COMMAND:intid(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < ADMIN_LVL_ALL) return ShowInfoForPlayer(playerid, "~r~Too Low", 6000);
    new str[36];
    for(new i = 1; i < MAX_INTERIOR; i++)
    {
        if(IsPlayerInRangeOfPoint(playerid, 2.0, InteriorInfo[i][iExtX], InteriorInfo[i][iExtY], InteriorInfo[i][iExtZ]))
        {
            format(str,sizeof(str),"Near id: %d", i);
            SendClientMessage(playerid, COLOR_RED, str);
            return 1;
        }
    }
    return 1;
}
My command doesn't display i when I'm near an interior.

Thanks in advance
Reply
#2

try to set the the range 10.0 . If work the problem is the range else with the printf look the Exitx,y,z of you interior if is correctly updated

Edit: When you not use the params[] use after the first "{" #pragma unused params for not have warning.
Reply
#3

Why are using playerid in the loop? You have already declared i above.
Try replacing playerid with i.
Reply
#4

Well, the message is displayed but it look like that : "Near id: "

I'm using playerid because I want to know if an interior is near the player.

Thanks for you help.

@holahola: I don't have any warning.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)