Save team
#1

How can i temperarily save a team, in otherwords i made this aduty command and i want to save the admin team and color and then restore it once he/she uses and /aduty command again and goes off duty...

PHP код:
CMD:adminduty(playeridparams[])
{
    if (
playerData[playerid][pd_AdminRank])
    {
        new 
message[MAX_STRING], playerName[MAX_PLAYER_NAME];
        
GetPlayerName(playeridplayerNamesizeof(playerName));
        if (!
playerData[playerid][pd_IsOnDuty])
        {
            
playerData[playerid][pd_IsOnDuty] = true;
            
format(messagesizeof(message), "[SERVER] %s %s(%i) is now on-duty."GetStaffClassName(playerid), playerNameplayerid);
              
SetPVarInt(playerid"LastSkin"GetPlayerSkin(playerid));
            
GetPlayerHealth(playeridaHealth[playerid]);
              
GetPlayerArmour(playeridaArmour[playerid]);
            for (new 
0i<13i++)
            {
                
GetPlayerWeaponData(playeridipWeapon[playerid][i], pAmmo[playerid][i]);
            }
            
ResetPlayerWeapons(playerid);
            
SetPlayerSkinEx(playeridSKIN_STAFF);
            
SetPlayerTeam(playeridNO_TEAM);
            
SetPlayerColor(playeridCOLOR_ADMIN);
            
SetPlayerHealth(playeridMAX_HEALTH_ADMINISTRATOR);
            
Update3DTextLabelText(t3dRankLabel[playerid], COLOR_ADMIN"Staff");
            
playerData[playerid][pd_TeamId] = NO_TEAM;
            
GivePlayerWeaponEx(playeridWEAPON_MINIGUNMAX_WEAPON_AMMO);
        }
        else
        {
            
playerData[playerid][pd_IsOnDuty] = false;
            
format(messagesizeof(message), "[SERVER] %s %s(%i) is now off-duty."GetStaffClassName(playerid), playerNameplayerid);
               
ResetPlayerWeapons(playerid);
            
SetPlayerSkin(playeridGetPVarInt(playerid"LastSkin"));
            
SetPlayerHealth(playeridaHealth[playerid]);
            
SetPlayerArmour(playeridaArmour[playerid]);
            for(new 
i=0i<13i++)
            {
                
GivePlayerWeaponEx(playerid,pWeapon[playerid][i],pAmmo[playerid][i]);
            }
        
//    ForceClassSelection(playerid);
        //    SetPlayerHealth(playerid, 0.0);
        //    playerData[playerid][pd_Deaths] --;
        //    FirstSpawn[playerid] = 1;
        
}
        if (
pHasHelmet[playerid])
        {
            new const 
SKIN_ID GetPlayerSkin(playerid);
            
SetPlayerAttachedObject(playeridSLOT_PAO_HAT19108BONE_HEADgHelmetOffsets[SKIN_ID][0], gHelmetOffsets[SKIN_ID][1], gHelmetOffsets[SKIN_ID][2], gHelmetOffsets[SKIN_ID][3], gHelmetOffsets[SKIN_ID][4], gHelmetOffsets[SKIN_ID][5], gHelmetOffsets[SKIN_ID][6], gHelmetOffsets[SKIN_ID][7], gHelmetOffsets[SKIN_ID][8]);
        }
        
SendClientMessageToAll(COLOR_SERVERmessage);
    }
    else
    {
        
SendScreenMessage(playeridLOCALE_MESSAGE_NOTAUTHORIZEDCOMMAND);
    }
    
    return 
1;

Reply


Messages In This Thread
Save team - by 1fret - 27.12.2017, 05:53
Re: Save team - by JaKe Elite - 27.12.2017, 13:39
Re: Save team - by 1fret - 27.12.2017, 22:58
Re: Save team - by 1fret - 28.12.2017, 23:09
Re: Save team - by Primes007 - 29.12.2017, 06:04
Re: Save team - by 1fret - 29.12.2017, 13:16

Forum Jump:


Users browsing this thread: 1 Guest(s)