SA-MP Forums Archive
Locker command - 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: Locker command (/showthread.php?tid=641331)



Locker command - Cubie - 14.09.2017

I'm working on this command that is used by the PD/FD but open different dialog.
I cant get it to work tough. What am I doing wrong?
Thanks in advance.
PHP код:
CMD:locker(playeridparams[])
{
    if(
PlayerInfo[playerid][pFaction] == 2)
    {
        if(
IsPlayerInRangeOfPoint(playerid6.0, -2655.72632242.805415.2350))
        {
            
ShowPlayerDialog(playeridDIALOG_SDLOCKERDIALOG_STYLE_LIST"PD locker""Armour\nNightstick\nPepper-Spray\nDeagle\nShotgun\nMP5\nM4\nUniform""Choose""Cancel");
        }
        else return 
SCM(playeridCOLOR_LIGHTRED"You're not by the lockers.");
    } else return 
SCM(playeridCOLOR_LIGHTRED"You're not a police officer.");
    if (
PlayerInfo[playerid][pFaction] == 3)
    {
        if(
IsPlayerInRangeOfPoint(playerid6.0, -2655.72632242.805415.2350))
        {
            
ShowPlayerDialog(playeridDIALOG_FDLOCKERDIALOG_STYLE_LIST"FD locker""Armour\nFirst Aid\nShovel\nChainsaw\nUniform""Choose""Cancel");
        }
        else return 
SCM(playeridCOLOR_LIGHTRED"You're not by the lockers.");
    } else return 
SCM(playeridCOLOR_LIGHTRED"You're not a Firefighter.");
    return 
1;




Re: Locker command - Kane - 14.09.2017

What part doesn't work? Are there errors in compiling?


Respuesta: Locker command - Cothect - 14.09.2017

Код:
CMD:locker(playerid, params[])
{
    if((PlayerInfo[playerid][pFaction] != 2) && (PlayerInfo[playerid][pFaction] != 3))
        return SCM(playerid, COLOR_LIGHTRED, "You're not a Firefighter or police officer.");
	    
    if(!(IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)) && !(IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)))
        return SCM(playerid, COLOR_LIGHTRED, "You're not by the lockers.");
	    
    if((IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)) && (PlayerInfo[playerid][pFaction] == 2))
        ShowPlayerDialog(playerid, DIALOG_SDLOCKER, DIALOG_STYLE_LIST, "PD locker", "Armour\nNightstick\nPepper-Spray\nDeagle\nShotgun\nMP5\nM4\nUniform", "Choose", "Cancel");
    else if((IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)) && (PlayerInfo[playerid][pFaction] == 3))
        ShowPlayerDialog(playerid, DIALOG_FDLOCKER, DIALOG_STYLE_LIST, "FD locker", "Armour\nFirst Aid\nShovel\nChainsaw\nUniform", "Choose", "Cancel");
    return 1;
}



Re: Respuesta: Locker command - Cubie - 15.09.2017

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
What part doesn't work? Are there errors in compiling?
Quote:
Originally Posted by Cothect
Посмотреть сообщение
Код:
It was not working IG, when FD it would open the PD locker and send the "you are not a firefighter" line etc.
CMD:locker(playerid, params[])
{
    if((PlayerInfo[playerid][pFaction] != 2) && (PlayerInfo[playerid][pFaction] != 3))
        return SCM(playerid, COLOR_LIGHTRED, "You're not a Firefighter or police officer.");
	    
    if(!(IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)) && !(IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)))
        return SCM(playerid, COLOR_LIGHTRED, "You're not by the lockers.");
	    
    if((IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)) && (PlayerInfo[playerid][pFaction] == 2))
        ShowPlayerDialog(playerid, DIALOG_SDLOCKER, DIALOG_STYLE_LIST, "PD locker", "Armour\nNightstick\nPepper-Spray\nDeagle\nShotgun\nMP5\nM4\nUniform", "Choose", "Cancel");
    else if((IsPlayerInRangeOfPoint(playerid, 6.0, -2655.7263, 2242.8054, 15.2350)) && (PlayerInfo[playerid][pFaction] == 3))
        ShowPlayerDialog(playerid, DIALOG_FDLOCKER, DIALOG_STYLE_LIST, "FD locker", "Armour\nFirst Aid\nShovel\nChainsaw\nUniform", "Choose", "Cancel");
    return 1;
}
It works perfectly Thank you very much! +rep'd