aduty problem
#7

pawn Код:
#define GetPlayerCash(%0) PlayerInfo[%0][pCash]
pawn Код:
CMD:aduty(playerid, params[])
{
    new str[126];
    if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
    if(AdminDuty[playerid] != 1)
    {
        PlayerInfo[playerid][pCash] = GetPlayerCash(playerid); //This
        SetPlayerHealth(playerid,99999);
        SetPlayerArmour(playerid,99999);
        if(isnull(PlayerInfo[playerid][pAName])) return SendClientMessage(playerid, -1, "You don't have an admin name.");
        AdminDuty[playerid] = 1;
        format(str, sizeof(str), "%s (ID %i - %s) is now on duty as a level %i admin.", PlayerInfo[playerid][pAName], playerid, GetName(playerid), PlayerInfo[playerid][pAdmin]);
        SendClientMessageToAdmins(-1, str, 1);
        SetPlayerName(playerid, PlayerInfo[playerid][pAName]);
        SendClientMessage(playerid, -1, "You are now on duty as an admin, you do now have access to all of your commands.");
        GetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
    }
    else
    {
        TogglePlayerSpectating(playerid, false);
        SetCameraBehindPlayer(playerid);
        AdminDuty[playerid] = 0;
        SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pLastX], PlayerInfo[playerid][pLastY], PlayerInfo[playerid][pLastZ], 0, 0, 0, 0, 0, 0, 0);
        SpawnPlayer(playerid);
        SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
        ResetSetPlayerCash(playerid); //This
        GivePlayerCash(playerid, PlayerInfo[playerid][pCash]);
        SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
        SetPlayerScore(playerid,PlayerInfo[playerid][pLevel]);
        SetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
        SetPlayerArmour(playerid,PlayerInfo[playerid][pArmour]);
        SetPlayerName(playerid, PlayerInfo[playerid][pName]);
        new string[126];
        format(string, 126, "%s Old cash: %i - New cash: %i", GetName(playerid), PlayerInfo[playerid][pCash], aCash);
        AdminLog(string);
        PlayerInfo[playerid][pCash] = aCash[playerid];
        SetPlayerPos(playerid, PlayerInfo[playerid][pAx], PlayerInfo[playerid][pAy], PlayerInfo[playerid][pAz]);
        format(str, sizeof(str), "%s (ID %i - %s) is now off admin duty.", PlayerInfo[playerid][pAName], playerid, GetName(playerid));
        SendClientMessageToAdmins(-1, str, 1);
        SendClientMessage(playerid, -1, "You are now off duty as an admin and have only a limited access to your commands.");
        spec[playerid] = -1;
    }
    return 1;
}
Okay try this one.
Reply


Messages In This Thread
aduty problem - by drichie - 05.06.2013, 11:57
Re: aduty problem - by drichie - 05.06.2013, 13:11
Re: aduty problem - by Kalladel - 05.06.2013, 13:21
Re: aduty problem - by drichie - 05.06.2013, 13:51
Re: aduty problem - by IceBilizard - 05.06.2013, 13:57
Re: aduty problem - by drichie - 05.06.2013, 14:12
Re: aduty problem - by Kalladel - 05.06.2013, 14:23
Re: aduty problem - by drichie - 05.06.2013, 14:34
Re: aduty problem - by drichie - 05.06.2013, 15:26
Re: aduty problem - by drichie - 06.06.2013, 12:09

Forum Jump:


Users browsing this thread: 2 Guest(s)