06.07.2014, 00:44
Looked a bit through your code, and added some comments in your code.
Maybe it helps, I did my best to help you.
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;
}

