Creating a locker instead of /lspd & /fbi
#6

Looked a bit through your code, and added some comments in your code.
Maybe it helps, I did my best to help you.

pawn Код:
CMD:locker(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.5,255.385696, 77.201263, 1003.640625 || IsPlayerInRangeOfPoint(playerid,3,310.3679,-1537.5204,-45.1338 && 3.5,255.385696, 77.201263)))
        // line above just won't work, some parameters are missing and it's a misuse of the function
        {
            ShowPlayerDialogEx(playerid, DUTYMENU, DIALOG_STYLE_LIST, "LSPD Menu","Duty\nEquipment\nTactical\nUniform\nUndercover\nClear Suspect", "Select", "Cancel");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You're not in range of your lockers.");
        }
    }
    if(PlayerInfo[playerid][pFaction] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
        if(IsPlayerInRangeOfPoint(playerid,3,310.3679,-1537.5204,-45.1338 && 3.5,255.385696, 77.201263 || IsPlayerInRangeOfPoint(playerid,3.5,255.385696, 77.201263, 1003.640625)))
        // again, line above won't work.
        {
            ShowPlayerDialogEx(playerid, FDUTYMENU, DIALOG_STYLE_LIST, "FBI Menu","Duty\nEquipment\nSWAT Uniform\nUniform\nUndercover\nClear Suspect", "Select", "Cancel");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You're not in range of your lockers.");
        }
    }
    return 1;
}

// when you use the if function, you can only use one native. For example:
// IsPlayerInRangeOfPoint(playerid, range, X, Y, Z) || IsPlayerInrangeOfPoint(playerid, range, X, Y, Z)
// So close the native before you want to use the "or" function or "equals" function.

// Also, the latest parameter in IsPlayerInRangeOfPoint is missing. You're missing a Z-coord.

CMD:locker(playerid, params[])
{
    if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
    {
        if(IsPlayerInRangeOfPoint(playerid,3.5,255.385696, 77.201263, 1003.640625) || IsPlayerInRangeOfPoint(playerid,3,310.3679,-1537.5204,-45.1338) || IsPlayerInRangeOfPoint(playerid, 3.5,255.385696, 77.201263, /*Z-coord missing*/))
        {
            ShowPlayerDialogEx(playerid, DUTYMENU, DIALOG_STYLE_LIST, "LSPD Menu","Duty\nEquipment\nTactical\nUniform\nUndercover\nClear Suspect", "Select", "Cancel");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You're not in range of your lockers.");
        }
    }
    if(PlayerInfo[playerid][pFaction] == 2 || PlayerInfo[playerid][pLeader] == 2)
    {
        if(IsPlayerInRangeOfPoint(playerid,3,310.3679,-1537.5204,-45.1338) || IsPlayerInRangeOfPoint(playerid,3.5,255.385696, 77.201263,/* Z-coord missing*/) || IsPlayerInRangeOfPoint(playerid,3.5,255.385696, 77.201263, 1003.640625))
        {
            ShowPlayerDialogEx(playerid, FDUTYMENU, DIALOG_STYLE_LIST, "FBI Menu","Duty\nEquipment\nSWAT Uniform\nUniform\nUndercover\nClear Suspect", "Select", "Cancel");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, "You're not in range of your lockers.");
        }
    }
    return 1;
}
Reply


Messages In This Thread
Creating a locker instead of /lspd & /fbi - by Cyrodii - 06.07.2014, 00:22
Re : Creating a locker instead of /lspd & /fbi - by Noliax8 - 06.07.2014, 00:26
Re: Creating a locker instead of /lspd & /fbi - by Cyrodii - 06.07.2014, 00:29
Re : Creating a locker instead of /lspd & /fbi - by Noliax8 - 06.07.2014, 00:32
Re: Creating a locker instead of /lspd & /fbi - by Cyrodii - 06.07.2014, 00:39
Re: Creating a locker instead of /lspd & /fbi - by sidney123 - 06.07.2014, 00:44
Re: Creating a locker instead of /lspd & /fbi - by Cyrodii - 06.07.2014, 00:54
Re : Creating a locker instead of /lspd & /fbi - by Noliax8 - 06.07.2014, 07:31

Forum Jump:


Users browsing this thread: 1 Guest(s)