SA-MP Forums Archive
Let only VIP's and Admins use a specific 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: Let only VIP's and Admins use a specific command. (/showthread.php?tid=426133)



Let only VIP's and Admins use a specific command. - Eminem 2ka9 - 27.03.2013

Right now, i have:
pawn Код:
if(AccInfo[playerid][Level] >=1) AccInfo[playerid][pVip] > 0)
        {
But this only lets the person use the command if he is BOTH VIP and Admin.
How do i make it so the player only has to be 1 of them. (VIP, Admin)

Thanks.


Re: Let only VIP's and Admins use a specific command. - StuartD - 27.03.2013

pawn Код:
if(AccInfo[playerid][Level] >=1 || AccInfo[playerid][pVip] > 0)
{
try that


Re: Let only VIP's and Admins use a specific command. - Glad2BeHere - 27.03.2013

pawn Код:
if(AccInfo[playerid][Level] >=1 || AccInfo[playerid][pVip] > 0)



Re: Let only VIP's and Admins use a specific command. - Eminem 2ka9 - 27.03.2013

Oh i see those two || is all I needed.

Okay, works good now.


Re: Let only VIP's and Admins use a specific command. - StuartD - 27.03.2013

Welcomes .


Re: Let only VIP's and Admins use a specific command. - Eminem 2ka9 - 28.03.2013

I have 1 more problem, maybe you or anyone may be able to figure it out.

I want to restrict anyone from spawning as this class without having 2000 score, can it be done?
Doesn't seem to be working for me, the second dialog still appears, and refuses to prompt for 2000 score.


pawn Код:
case 6:
                {

                    if(GetPlayerScore(playerid) < 2000)
                        {
                    gTeam[playerid] = T_SPECIAL;
                    SetPlayerColor(playerid, C_GREY);
                    GameTextForPlayer(playerid, "~r~US Army", 3000, 3);
                    //ShowPlayerDialog(playerid, Skin_Dialog, DIALOG_STYLE_LIST, "Select a Skin", "", "Choose", "");
                    SetSpawnInfo(playerid, 0, 121, -1217.3820,1493.2750,21.6103,280.8538, 0, 0, 0, 0, 0, 0);
                    }
                    else
                    {
                    SendClientMessage(playerid, C_RED, "You need 2000 score to become US Army.");
                    return ShowPlayerDialog(playerid, Team_Dialog, DIALOG_STYLE_LIST, "{33AA33}Team Selection", "{15FF00}England\n{FF0000}Soviet Union\n{FFFF00}Taliban Cell\n{0000BB}United States\n{A86EFC}Australian Armada\n{FF9900}European Alliance\n{AFAFAF}US Army", "Choose", "");
                    }
                }
            }
            ShowPlayerDialog(playerid, Class_Dialog, DIALOG_STYLE_LIST, "{15FF00}Class Selection", "Assault\nMedic             \t{FF0000}(Score: 50)\nSniper            \t{FF0000}(Score: 300)\nAnti-Tank         \t{FF0000}(Score: 500)\nSpy               \t{FF0000}(Score: 2500)\nPilot          \t{FF0000}(Score: 6500)\nEngineer          \t{FF0000}(Score: 1000)\nSpecial Operations\t{FF0000}(Score: 10000)", "Choose", "");
        }