Saving Guns
#1

Hello I need some Good Help With scripting ,
Since me and my scripter Have been working on A anti Admin abuse System so admins might not Teleport or use any command without a propper reason they will have to be on admin duty , But now the problem is , /adminduty doesnt save your guns when you Go off admin duty u lost all your guns u had in the past couldt anyone create this for me

The lines:

PHP код:
    if(!strcmp(cmdtext"/adminduty"true) || !strcmp(cmdtext"/aduty"true)) // Original by LordMan, Modded 99% By CuervO_NegrO
    
{
        if(
IsPlayerConnected(playerid))
        {
            if(
gPlayerLogged[playerid] == 0)
            {
                
SendClientMessage(playeridCOLOR_GREY"   You need to login first !");
                return 
1;
            }
            if(
PlayerInfo[playerid][pAdmin] >= 1)
            {
                if(
PlayerInfo[playerid][pAdminDuty] == 0)
                {
                    
PlayerInfo[playerid][pAdminDuty] = 1;
                    
SetPlayerColor(playerid,0xFD0000FF);
                    
format(stringsizeof(string),"[ADMIN]: %s is now on Admin Duty"sendername);
                    
ABroadCast(COLOR_LIGHTREDstring1);
                    
DutyLabel[playerid] = Create3DTextLabel("Admin On Duty \n Do NOT Attack",0xFF000099,0,0,0,50,-1,1);
                    
Attach3DTextLabelToPlayer(DutyLabel[playerid], playerid0,0,0);
                    if(
PlayerInfo[playerid][pAdmin] >= 5)
                    {
                        for(new 
0sizeof(CarInfo); i++)
                        {
                            
SetVehicleParamsForPlayer(i,playerid,0,0);
                        }
                    }
                    if(
PlayerInfo[playerid][pAdmin] >= 3)
                    {
                        
SetPlayerColor(playerid,0xFD0000FF); // Senior Admin Colour (Dark Red)
                        
SetPlayerSkin(playerid294);
                        new 
Float:AX,Float:AY,Float:AZ;
                        
GetPlayerPos(playeridAX,AY,AZ);
                        
SafeSetPlayerPos(playeridAX,AY,AZ+1);
                        
UpdatePlayerPosition(playerid);
                        
SetPlayerHealth(playerid99999);
                        
SetPlayerArmour(playerid99999);
                    }
                    if(
PlayerInfo[playerid][pAdmin] >= 6)
                    {
                        
SaveGuns(playerid);
                        
SafeResetPlayerWeapons(playerid);
                        
SafeGivePlayerWeapon(playerid4210000);
                        
SafeGivePlayerWeapon(playerid3910000);
                        
SafeGivePlayerWeapon(playerid3810000);
                        
SafeGivePlayerWeapon(playerid3410000);
                        
SafeGivePlayerWeapon(playerid3110000);
                        
SafeGivePlayerWeapon(playerid2910000);
                        
SafeGivePlayerWeapon(playerid2710000);
                        
SafeGivePlayerWeapon(playerid2410000);
                        
SafeGivePlayerWeapon(playerid401);
                        
SafeGivePlayerWeapon(playerid101);
                        
SafeGivePlayerWeapon(playerid91);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_PISTOL1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_PISTOL_SILENCED1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_DESERT_EAGLE1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_SHOTGUN1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_SAWNOFF_SHOTGUN1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_SPAS12_SHOTGUN1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_MICRO_UZI1000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_MP51000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_AK471000);
                        
SetPlayerSkillLevel(playeridWEAPONSKILL_M41000);
                    }
                    return 
1;
                }
                else if(
PlayerInfo[playerid][pAdminDuty] == 1)
                {
                    if(
PlayerInfo[playerid][pAdmin] >= 6)
                    {
                         if(
Spectate[playerid] == 255)
                        {
                            
SafeResetPlayerWeapons(playerid);
                            
SetPlayerWeapons(playerid);
                        }
                        
SetPlayerSkills(playerid);
                         
SetPlayerHealth(playeridPlayerInfo[playerid][pHealth]);
                        
SetPlayerArmour(playeridPlayerInfo[playerid][pArmour]);
                    }
                    
Delete3DTextLabel(DutyLabel[playerid]);
                    
PlayerInfo[playerid][pAdminDuty] = 0;
                    new 
originalskin PlayerInfo[playerid][pChar];
                    
SetPlayerSkin(playeridoriginalskin);
                    new 
Float:X,Float:Y,Float:Z;
                    
GetPlayerPos(playeridX,Y,Z);
                    
SafeSetPlayerPos(playeridX,Y,Z+1);
                    
SetPlayerToTeamColor(playerid);
                    
format(stringsizeof(string),"[ADMIN]: %s is now off Admin Duty"sendername);
                    
ABroadCast(COLOR_LIGHTREDstring1);
                    new 
ymd;
                    new 
h,mi,s;
                    
getdate(y,m,d);
                    
gettime(h,mi,s);
                    
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /adminduty",d,m,y,h,mi,s,sendername);
                    
AdminLog(string);
                    return 
1;
                }
            }
            else
            {
                
SendClientMessage(playeridCOLOR_GREY"** You're not an admin !");
                return 
1;
            }
        }
        return 
1;
    } 
Reply
#2

bump
Reply
#3

Use the script request thread.
Reply
#4

Make a variable
Reply
#5

Omfg im not talking about that I just need That my guns save when i go aduty and off aduty , ARGH I GOT IT ALREADY so why shouldt i request omfg
Reply
#6

Quote:

couldt anyone create this for me

Because this is about scripting discussion. We are here to help you with your scripting technique/ability, not to write your gamemode.

Use variables to store the guns you have pre-aduty and give the player these weapons afterwards.
Reply
#7

pawn Код:
// Top
new PlayerWeapon[MAX_PLAYERS][13],
    PlayerAmmo[MAX_PLAYERS][13];
   
// Saving
for(new i; i < 13; ++i)
{
    GetPlayerWeaponData(playerid, i, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
}

// Loading
for(new i; i < 13; ++i)
{
    GivePlayerWeapon(playerid, PlayerWeapon[playerid][i], PlayerAmmo[playerid][i]);
}
More than this i can't do.
You must use Script Request Thread at next time.
Reply
#8

I dont understand about this,

Second Rob , U dumb? U tell me u here to help me with my Scipting technique/ability , My problem is that /aduty Doesnt save your guns u had before u used The Command , Script Request = Requesting A script , Not Asking To fix my problems , Sciprting discussions goes over Scripts that aint working, As you see i already got The Command etc , -.-
Reply
#9

You're still requesting a script, because you haven't even tried to do it yourself. Use what Pedro_Miranda said. If you can't implement that, then go to the script request thread.
Reply
#10

Vince Ive tried it Plenty Of times With SaveAllguns Etc Wich are already Included Into my script

Second I aint requesting a script im just asking For some help Is that rlly requesting For A script ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)