Problems with admin script
#1

pawn Код:
dcmd_aduty(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 1)
    {
        new String[128],Name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, Name, sizeof(Name));
        if(GetPVarInt(playerid,"AdutyOn") == 1)
        {
            format(String, sizeof(String), "{001AC4}Admin: %s is now off duty.", Name);
            SendClientMessageToAll(-1, String);
            SetPVarInt(playerid,"AdutyOn",0);
            Delete3DTextLabel(AdminLabel[playerid]);
            KillTimer(AdminGodTimer[playerid]);
            SetPVarInt(playerid,"AGodModeOn",0);
            SetPlayerHealth(playerid,100);
            ResetPlayerWeapons(playerid);
            SetPlayerSkin(playerid, GetPVarInt(playerid,"ASkinID"));
            return 1;
        }
        else
        {
            format(String, sizeof(String), "{001AC4}Admin: %s is now on duty.", Name);
            SendClientMessageToAll(-1, String);
            SetPVarInt(playerid,"AdutyOn",1);
            AdminLabel[playerid] = Create3DTextLabel("Admin on duty\n Do NOT attack!",0xE60000FF,20.0,40.0,50.0,40.0,0,1);
            Attach3DTextLabelToPlayer(AdminLabel[playerid], playerid, 0.0, 0.0, 0.3);
            SetPVarInt(playerid,"ASkinID",GetPlayerSkin(playerid));
            SetPlayerSkin(playerid, 217);
            SetPlayerHealth(playerid,999);
            AdminGodTimer[playerid] = SetTimerEx("AGodMode", 500, 1, "i", playerid);
            SetPVarInt(playerid,"AGodModeOn",1);
            GivePlayerWeapon(playerid,24,999);
            GivePlayerWeapon(playerid,31,999);
            GivePlayerWeapon(playerid,37,999);
            return 1;
        }
    }
    else return SendClientMessage(playerid,red, "ERROR: You are not an Admin.");
}
There are always some random people who have that "Admin on duty do NOT attack" on their head, even if they are not admin Is there something wrong there?
Reply
#2

its was samp bug create3dtextlable not work good on 3c
Reply
#3

So I can't get it to work properly until new update comes for samp? But it worked in Ravens roleplay
Reply
#4

//OnPlayerConnect

AccInfo[playerid][Level] = 0;
Reply
#5

change this?

#pragma unused params
if(AccInfo[playerid][Level] >= 1)

to

#pragma unused params
if(AccInfo[playerid][Level] >= 0)

??
Reply
#6

Quote:
Originally Posted by ColdIce
Посмотреть сообщение
change this?

#pragma unused params
if(AccInfo[playerid][Level] >= 1)

to

#pragma unused params
if(AccInfo[playerid][Level] >= 0)

??
No way that would work!

Then every single player in the server will have the text...
Reply
#7

pawn Код:
public OnPlayerConnect(playerid)
{
    #if EnableCamHack == true
    KeyState[playerid] = 0;
    FollowOn[playerid] = 0;
    AccInfo[playerid][InCamMod]     = 0;
    AccInfo[playerid][LockedCam]    = 0;
    #endif
    AccInfo[playerid][Deaths]       = 0;
    AccInfo[playerid][Kills]        = 0;
    AccInfo[playerid][Jailed]       = 0;
    AccInfo[playerid][Frozen]       = 0;
    AccInfo[playerid][Level]        = 0;
    AccInfo[playerid][pVip]         = 0;
    AccInfo[playerid][LoggedIn]     = 0;
    AccInfo[playerid][Registered]   = 0;
    AccInfo[playerid][God]          = 0;
    AccInfo[playerid][GodCar]       = 0;
    AccInfo[playerid][TimesSpawned] = 0;
    AccInfo[playerid][Muted]        = 0;
    AccInfo[playerid][MuteWarnings] = 0;
    AccInfo[playerid][Warnings]     = 0;
    AccInfo[playerid][Caps]         = 0;
    AccInfo[playerid][DoorsLocked]  = 0;
    AccInfo[playerid][pCar]         = -1;
    AccInfo[playerid][SpamCount]    = 0;
    AccInfo[playerid][MaxAdv]       = 0;
    AccInfo[playerid][SpamTime]     = 0;
    AccInfo[playerid][PingCount]    = 0;
    AccInfo[playerid][PingTime]     = 0;
    AccInfo[playerid][FailLogin]    = 0;
    AccInfo[playerid][Hide]         = 0;
    AccInfo[playerid][pInvis]       = 0;
    AccInfo[playerid][OnDuty]       = 0;
    AccInfo[playerid][pGps]         = -1;
   
    #if EnableTwoRcon == true
    AccInfo[playerid][MaxRcon] = 0;
    #endif

    AccInfo[playerid][ConnectTime] = gettime();
    for(new i; i<PING_MAX_EXCEEDS; i++)
    AccInfo[playerid][pPing][i] = 0;
    //------------------------------------------------------
    new string[128];
    new str[128];
    new file[256];
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
    new tmp3[50]; GetPlayerIp(playerid,tmp3,50);
   
    ResetForbiddenWeaponsForPlayer(playerid);
    TempBanCheck(playerid);
I dont see what u are talking about
Reply
#8

Why using PVar's if you have AccInfo[playerid][OnDuty] on your script?

Also you are checking if player is lvl 1 or more, then if theyre on duty, if not, they will get text "Admin on duty\n Do NOT attack!"...

The problem is in this:
if(AccInfo[playerid][Level] >= 1)

should be:
if(AccInfo[playerid][_____ADMIN____] >= 1)
Reply
#9

Ahh, I did not make this, I had other member here make it for me.
Reply
#10

pawn Код:
dcmd_aduty(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][Level] >= 1)
    {
To

pawn Код:
dcmd_aduty(playerid,params[])
{
    #pragma unused params
    if(AccInfo[playerid][_____ADMIN____] >= 1)
    {
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)