[Ajuda] Sistema Drop de armas
#1

Boa noite,
Gostaria de saber se hб como alterar esse cуdigo para que seja bloqueado, que certas armas sejam dropadas, a fim de tornб-las exclusivas, segue o cуdigo:
PHP Code:
CMD:largararma(playerid)
    {
        if(
GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
        new 
GunID GetPlayerWeapon(playerid);
        new 
GunAmmo GetPlayerAmmo(playerid);
        new 
Float:xFloat:yFloat:z;
        if(
GunID && GunAmmo != 0)
        {
            new 
MAX_OBJ+1;
            for(new 
0MAX_OBJa++)
            {
                if(
dGunData[a][ObjPos][0] == 0.0)
                {
                    
a;
                    break;
                }
            }
            if(
MAX_OBJ) return SendClientMessage(playerid0x33AA3300"Vocк nгo pode largar esta arma no momento, tente novamente mais tarde!");
            
RemovePlayerWeapon(playeridGunID);
            
GetPlayerPos(playeridxyz);
            
CreateDroppedGun(GunIDGunAmmoxyz);
            
ApplyAnimation(playerid,"BOMBER","BOM_Plant_2Idle",4.1,0,1,1,0,0);
            new 
buffer[85];
            
format(buffersizeof(buffer), "Vocк largou um(a) %s."GunNames[dGunData[f][ObjData][0]]);
            
SendClientMessage(playerid0x33AA3300buffer);
            
format(buffersizeof(buffer), "* %s colocou um(a) %s no chгo."NomePlayer(playerid), GunNames[dGunData[f][ObjData][0]]);
            
SendClientMessageInRange(30.0playeridbufferCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            
printf("%s"buffer);
        }
        return 
1;
    }
    
CMD:parma(playerid)
    {
        if(
GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
        new 
MAX_OBJ+1;
        for(new 
0MAX_OBJa++)
        {
            if(
IsPlayerInRangeOfPoint(playerid1.8dGunData[a][ObjPos][0], dGunData[a][ObjPos][1], dGunData[a][ObjPos][2]))
            {
                
a;
                break;
            }
        }
        if(
MAX_OBJ) return 1;
        if(
gettime() < GetPVarInt(playerid#VarFlood8))
            
return 1;
        
SetPVarInt(playerid#VarFlood8, gettime()+2);
        
GivePlayerWeapon(playeriddGunData[f][ObjData][0], dGunData[f][ObjData][1]);
        
DestroyDroppedObject(f);
        
ApplyAnimation(playerid,"BOMBER","BOM_Plant_2Idle",4.1,0,1,1,0,0);
        new 
buffer[75];
        
format(buffersizeof(buffer), "Vocк pegou um(a) %s."GunNames[dGunData[f][ObjData][0]]);
          
SendClientMessage(playerid0x33AA3300buffer);
        
format(buffersizeof(buffer), "* %s pegou um(a) %s do chгo."NomePlayer(playerid), GunNames[dGunData[f][ObjData][0]]);
        
SendClientMessageInRange(30.0playeridbufferCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
printf("%s"buffer);
        if(
dGunData[f][ObjData][0] == 47PlayerInfo[playerid][pExplosivos]++;
          return 
1;
    }
stock CreateDroppedGun(GunIDGunAmmoFloat:gPosXFloat:gPosYFloat:gPosZ)
{
    new 
MAX_OBJ+1;
    for(new 
0MAX_OBJa++)
    {
        if(
dGunData[a][ObjPos][0] == 0.0)
        {
            
a;
            break;
        }
    }
    if(
MAX_OBJ) return;
    
dGunData[f][dropTimer] = gettime() + (30*60);//30 minutos para a arma desaparecer
    
dGunData[f][ObjData][0] = GunID;
    
dGunData[f][ObjData][1] = GunAmmo;
    
dGunData[f][ObjPos][0] = gPosX;
    
dGunData[f][ObjPos][1] = gPosY;
    
dGunData[f][ObjPos][2] = gPosZ;
    
dGunData[f][ObjID] = CreateDynamicObject(GunObjects[GunID], dGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-193.7120.0random(360), -1, -1, -180.0);
    new 
buffer[50];
    
format(buffersizeof buffer"%s",GunNames[dGunData[f][ObjData][0]]);
     
dGunData[f][text3d] = CreateDynamic3DTextLabel(buffer0x9ACD32AAdGunData[f][ObjPos][0], dGunData[f][ObjPos][1], dGunData[f][ObjPos][2]-115.0INVALID_PLAYER_IDINVALID_VEHICLE_ID0, -1, -1, -180.0);
    return;
}
stock DestroyDroppedObject(dropid)
{
        
DestroyDynamicObject(dGunData[dropid][ObjID]);
        
DestroyDynamic3DTextLabel(dGunData[dropid][text3d]);
        
dGunData[dropid][ObjPos][0] = 0.0;
        
dGunData[dropid][ObjPos][1] = 0.0;
        
dGunData[dropid][ObjPos][2] = 0.0;
        
dGunData[dropid][ObjID] = -1;
        
//dGunData[f][ObjData][0] = 0;
        
dGunData[dropid][ObjData][1] = 0;
        return 
1
}
Reply


Messages In This Thread
Sistema Drop de armas - by LuanGamer - 20.01.2017, 20:07
Re: Sistema Drop de armas - by FallweN - 20.01.2017, 20:24
Re: Sistema Drop de armas - by LuanGamer - 21.01.2017, 13:57
Re: Sistema Drop de armas - by LuanGamer - 21.01.2017, 14:18

Forum Jump:


Users browsing this thread: 2 Guest(s)