08.07.2017, 00:51
Pasa que tengo el siguiente pickup creado para la entrada de un hospital, pero al entrar, funciona pero al salir desaparece (lo tengo para que no desaparezca nunca) y luego de eso, tengo un fs que tira las armas al suelo cuando mueres (weapondrop) y cuando agarro 1 arma es como si cojiera el pickup de la entrada :S
Код:
//-ENTRADAS if(pickupid == EntradaHosp) { SetPlayerPos(playerid, 1552.537841, 1173.282348, 1043.252807); SetPlayerInterior(playerid, 0); Informacion[playerid][EnInt] = 1; //-CARGADOR-DE-OBJETOS-// CargarInterior(playerid); } else if(pickupid == SalidaHosp) { SetPlayerPos(playerid, 1177.051391, -1324.129516, 14.051601); SetPlayerInterior(playerid, 0); Informacion[playerid][EnInt] = 0; //-CARGADOR-DE-OBJETOS-// CargarInterior(playerid); } WEAPONDROP //-ARMAS EN EL SUELO #define WEAPON_RESPAWN_TIME 30 // Esto es el tardar De las armas floten en el piso. #define MONEY_BAG_MONEY 0 // -1 = Bolsa de dinero en con todo el jugador de dinero 0 = bolsa de dinero OFF = 1 + bolsa de dinero en la cantidad dada. #define MONEY_BAG_MODE 0 // 1 = El dinero viene del jugador matado 0 = El dinero viene desde el servidor. new ForbiddenWeapons[]= { 38, 44, 45 }; // Aquн hay que aсadir identificadores de armas que no desee que se crearб. new WeaponDrop[MAX_PLAYERS][14]; new WeaponData[MAX_PLAYERS][14][3]; new WeaponTimer[MAX_PLAYERS]; new BagMoney = MONEY_BAG_MONEY; new BagMode = MONEY_BAG_MODE; stock OnWeaponDrop(playerid) { new Float:x, Float:y, Float:z, dropped; GetPlayerPos(playerid,x,y,z); new world = GetPlayerVirtualWorld(playerid); for(new i=0; i<13; i++) { new weapon, ammo; GetPlayerWeaponData(playerid, i, weapon, ammo); if((ammo > 0 || weapon == 1) && weapon != 0) { new model = GetModel(weapon); if(model != -1) { WeaponData[playerid][i][0] = weapon; WeaponData[playerid][i][1] = ammo; WeaponData[playerid][i][2] = world; dropped++; } } } if(BagMoney != 0) { if(BagMoney == -1 && GetPlayerMoney(playerid) > 0) { WeaponData[playerid][13][0] = GetPlayerMoney(playerid); if(BagMode) GivePlayerMoney(playerid, -WeaponData[playerid][13][0]); WeaponDrop[playerid][13] = CreatePickup(1550, 1, x, y, z); if(dropped <= 0) dropped=1; } if(BagMoney > 0) { WeaponData[playerid][13][0] = BagMoney; if(BagMode) GivePlayerMoney(playerid, -WeaponData[playerid][13][0]); WeaponDrop[playerid][13] = CreatePickup(1550, 1, x, y, z); if(dropped <= 0) dropped=1; } } if(dropped > 0) { new radius; if(dropped < 3) radius = 1; if(dropped < 6) radius = 2; //* Si desea otro radio, cambiar aquн. * // if(dropped < 9) radius = 3; if(dropped > 8) radius = 4; new Float:degree, Float:tmp; degree = 360.0 / (float(dropped)); tmp = degree; if(WeaponTimer[playerid] != -1) KillTimer(WeaponTimer[playerid]); WeaponTimer[playerid] = SetTimerEx("RemovePickups", WEAPON_RESPAWN_TIME*1000, 0, "d", playerid); for(new i=0; i<13; i++) { if((WeaponData[playerid][i][1] > 0 || WeaponData[playerid][i][0] == 1) && WeaponData[playerid][i][0] > 0) { new model = GetModel(WeaponData[playerid][i][0]); if(model != -1) { WeaponDrop[playerid][i] = CreatePickup(model, 1, x+(floatsin(degree, degrees)*radius), y+(floatcos(degree, degrees)*radius), z, world); degree = degree + tmp; } } } } return 1; } stock GetModel(weaponid) { for(new i=0; i<sizeof(ForbiddenWeapons); i++) { if(weaponid == ForbiddenWeapons[i]) { return -1; } } switch(weaponid) { case 1: return 331; case 2: return 333; case 3: return 334; case 4: return 335; case 5: return 336; case 6: return 337; case 7: return 338; case 8: return 339; case 9: return 341; case 10: return 321; case 11: return 322; case 12: return 323; case 13: return 324; case 14: return 325; case 15: return 326; case 16: return 342; case 17: return 343; case 18: return 344; case 22: return 346; case 23: return 347; case 24: return 348; case 25: return 349; case 26: return 350; case 27: return 351; case 28: return 352; case 29: return 353; case 30: return 355; case 31: return 356; case 32: return 372; case 33: return 357; case 34: return 358; case 35: return 359; case 36: return 360; case 37: return 361; case 38: return 362; case 39: return 363; case 40: return 364; case 41: return 365; case 42: return 366; case 43: return 367; case 44: return 368; case 45: return 369; case 46: return 371; default: return -1; } return -1; } forward RemovePickups(playerid); public RemovePickups(playerid) { if(WeaponTimer[playerid] != -1) KillTimer(WeaponTimer[playerid]); WeaponTimer[playerid] = -1; for(new a=0; a<14; a++) { if(WeaponDrop[playerid][a] != -1) { DestroyPickup(WeaponDrop[playerid][a]); WeaponDrop[playerid][a] = -1; WeaponData[playerid][a][0] = -1; WeaponData[playerid][a][1] = -1; WeaponData[playerid][a][2] = -1; } } return 1; } stock GetWeaponSlot(weaponid) { switch(weaponid) { case 0,1: return 0; case 2..9: return 1; case 22..24: return 2; case 25..27: return 3; case 28,29,32: return 4; case 30,31: return 5; case 33,34: return 6; case 35..38: return 7; case 16..18,39: return 8; case 41..43: return 9; case 10..15: return 10; case 44..46: return 11; case 40: return 12; default: return -1; } return -1; } stock GetJ_WeaponName(id) { new wName[32]; wName="INVALID_WEAPON"; switch(id) { case 0: wName="Fist"; case 1: wName="Brass Knuckles"; case 2: wName="Golf Club"; case 3: wName="Night Stick"; case 4: wName="Knife"; case 5: wName="Baseball Bat"; case 6: wName="Shovel"; case 7: wName="Pool Cue"; case 8: wName="Katana"; case 9: wName="Chainsaw"; case 10: wName="Purple Dildo"; case 11: wName="Small White Vibrator"; case 12: wName="Large White Vibrator"; case 13: wName="Silver Vibrator"; case 14: wName="Flowers"; case 15: wName="Cane"; case 16: wName="Grenade"; case 17: wName="Tear Gas"; case 18: wName="Molotov Cocktail"; case 22: wName="9mm"; case 23: wName="Silenced 9mm"; case 24: wName="Desert Eagle"; case 25: wName="Shotgun"; case 26: wName="Sawnoff Shotgun"; case 27: wName="Combat Shotgun"; case 28: wName="Micro SMG"; case 29: wName="MP5"; case 30: wName="AK 47"; case 31: wName="M4"; case 32: wName="Tec 9"; case 33: wName="Country Rifle"; case 34: wName="Sniper Rifle"; case 35: wName="Rocket Launcher"; case 36: wName="HS Rocket Launcher"; case 37: wName="Flamethrower"; case 38: wName="Minigun"; case 39: wName="Satchel Charge"; case 40: wName="Detonator"; case 41: wName="Spraycan"; case 42: wName="Fire Extinguiser"; case 43: wName="Camera"; case 44: wName="Night Vision Goggles"; case 45: wName="Thermal Goggles"; case 46: wName="Parachute"; } return wName; }