SA-MP Forums Archive
Quick playerrange questions[+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Quick playerrange questions[+REP] (/showthread.php?tid=319429)



Quick playerrange questions[+REP] - Mark_Weston - 19.02.2012

Hey there, I need some quick help.
pawn Код:
CMD:pduty(playerid,params[]) {
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0) {
        new string[64];
            if(IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10)
            if(IsPlayerInRangeOfPoint(playerid, 5, 1708.702026,-1669.956909,27.195312) && GetPlayerInterior(playerid) == 18) { // I know that this is wrong but how do I make it work on two ranges?
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
        }
    }
    return 1;
}
The question is what I am doing wrong?


Re: Quick playerrange questions[+REP] - Nuke547 - 19.02.2012

Im not sure what was going wrong, but this is what should work:

PHP код:
CMD:pduty(playerid,params[])
{
    if(
groupVariables[playerVariables[playerid][pGroup]][gGroupType] == && playerVariables[playerid][pGroup] != 0)
    {
        new 
string[64];
        if(
IsPlayerInRangeOfPoint(playerid5264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10)
        {
            if(
IsPlayerInRangeOfPoint(playerid51708.702026,-1669.956909,27.195312) && GetPlayerInterior(playerid) == 18)
            {
                
format(stringsizeof(string), "%s Menu"groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
                
ShowPlayerDialog(playeridDIALOG_LSPDDIALOG_STYLE_LISTstring"Equipment\nRelease Suspect\nClothing\nClear Suspect""Select""Cancel");
            }
        }
    }
    return 
1;




Re: Quick playerrange questions[+REP] - JhnzRep - 19.02.2012

EDIT: ^ Pretty sure this won't work. Reason: He would have to be at to 2 points at the same time. o_O

pawn Код:
CMD:pduty(playerid,params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0)
    {
        new string[64];
            if(IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10)
            {
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
            }
            if(IsPlayerInRangeOfPoint(playerid, 5, 1708.702026,-1669.956909,27.195312) && GetPlayerInterior(playerid) == 18)
            {
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
            }
   }
    return 1;
}



Re: Quick playerrange questions[+REP] - johnnyman1 - 19.02.2012

Код:
CMD:pduty(playerid,params[]) {
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0) {
	    new string[64];
            if(IsPlayerInRangeOfPoint(playerid, 5, 1708.702026,-1669.956909,27.195312) && GetPlayerInterior(playerid) == 18 || IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10) { // I know that this is wrong but how do I make it work on two ranges?
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
        }
    }
    return 1;
}



Re: Quick playerrange questions[+REP] - JhnzRep - 19.02.2012

Quote:
Originally Posted by johnnyman1
Посмотреть сообщение
Код:
CMD:pduty(playerid,params[]) {
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0) {
	    new string[64];
            if(IsPlayerInRangeOfPoint(playerid, 5, 1708.702026,-1669.956909,27.195312) && GetPlayerInterior(playerid) == 18 || IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10) { // I know that this is wrong but how do I make it work on two ranges?
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
        }
    }
    return 1;
}
Could possibly work, but mine is probably more effective or the same.


Re: Quick playerrange questions[+REP] - Mark_Weston - 19.02.2012

Quote:
Originally Posted by JhnzRep
Посмотреть сообщение
EDIT: ^ Pretty sure this won't work. Reason: He would have to be at to 2 points at the same time. o_O

pawn Код:
CMD:pduty(playerid,params[])
{
    if(groupVariables[playerVariables[playerid][pGroup]][gGroupType] == 1 && playerVariables[playerid][pGroup] != 0)
    {
        new string[64];
            if(IsPlayerInRangeOfPoint(playerid, 5, 264.1055,109.8094,1004.6172) && GetPlayerInterior(playerid) == 10)
            {
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
            }
            if(IsPlayerInRangeOfPoint(playerid, 5, 1708.702026,-1669.956909,27.195312) && GetPlayerInterior(playerid) == 18)
            {
            format(string, sizeof(string), "%s Menu", groupVariables[playerVariables[playerid][pGroup]][gGroupName]);
            ShowPlayerDialog(playerid, DIALOG_LSPD, DIALOG_STYLE_LIST, string, "Equipment\nRelease Suspect\nClothing\nClear Suspect", "Select", "Cancel");
            }
   }
    return 1;
}
Thank you <3 it worked, I gave +rep to you and everyone that gave me help


Re: Quick playerrange questions[+REP] - JhnzRep - 19.02.2012

Your welcome, need anymore help? PM me.