Need some help.
#1

Pawn Code:
pawn Код:
if (strcmp("/adminpack", cmdtext, true, 10) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
        SendClientMessage(playerid,0x0077BB00,"~Command denied~");
        return 1;
        }
        {
        SetPlayerHealth(playerid,100000);
        SetPlayerArmour(playerid,100000);
        GivePlayerWeapon(playerid,38,99999);
        }
        {
        SendClientMessage(playerid, 0x0077BB00, "~Command Accepted~");
        SendClientMessage(playerid, 0xAFAFAFAA, "Your hp has been set to 100000.");
        SendClientMessage(playerid, 0xAFAFAFAA, "Your armour has been set to 100000.");
        SendClientMessage(playerid, 0xAFAFAFAA, "You have recieved a minigun with 99999 bullets.");
        SendClientMessage(playerid, 0xAFAFAFAA, "Enjoy your admin pack.");
        }
        return 1;
    }
I'm trying to make it the where if your not logged into the RCON it will show "~Command denied~" but I test it IG, when i'm not logged into the RCON, and it gives me the health, armour and the minigun.
Reply
#2

pawn Код:
if (strcmp("/adminpack", cmdtext, true, 10) == 0)
{
    if(!IsPlayerAdmin(playerid))
    {
        SendClientMessage(playerid,0x0077BB00,"~Command denied~");
        return 1;
    }
    else
    {
        SetPlayerHealth(playerid,100000);
        SetPlayerArmour(playerid,100000);
        GivePlayerWeapon(playerid,38,99999);
        SendClientMessage(playerid, 0x0077BB00, "~Command Accepted~");
        SendClientMessage(playerid, 0xAFAFAFAA, "Your hp has been set to 100000.");
        SendClientMessage(playerid, 0xAFAFAFAA, "Your armour has been set to 100000.");
        SendClientMessage(playerid, 0xAFAFAFAA, "You have recieved a minigun with 99999 bullets.");
        SendClientMessage(playerid, 0xAFAFAFAA, "Enjoy your admin pack.");
    }
    return 1;
}
Untested.
Reply
#3

^That worked.^ Thank you very much.
Reply
#4

IsPlayerAdmin(playerid) = if they're admin
!IsPlayerAdmin(playerid) = if they aren't admin

It's good to remember if you're going to be using RCON :P
Reply
#5

Quote:
Originally Posted by nogh445
Посмотреть сообщение
^That worked.^ Thank you very much.
Not a problem.

& Antonio; +1!

Merry Christmas to you both!
Reply
#6

Quote:
Originally Posted by [ABK]Antonio
Посмотреть сообщение
IsPlayerAdmin(playerid) = if they're admin
!IsPlayerAdmin(playerid) = if they aren't admin

It's good to remember if you're going to be using RCON :P
I'll be sure to remember.
Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)