Sergo
Умник
Здравствуйте уважаемые пользователи Pawno Info
Выкладываю систему сейфа как на Samp Virtual Life
Собственно начнём.
Ко всем define:
PHP:
#define SEIF 5467
PHP:
pSSd,
pSDeag,
pSShot,
pSSMG,
pSAK,
pSM4,
pSReaf,
pSNark,
PHP:
ini_setInteger(File,"SDp", PlayerInfo[playerid][pSSd]);
ini_setInteger(File,"SDeag", PlayerInfo[playerid][pSDeag]);
ini_setInteger(File,"SShot", PlayerInfo[playerid][pSShot]);
ini_setInteger(File,"SSMG", PlayerInfo[playerid][pSSMG]);
ini_setInteger(File,"SAK47", PlayerInfo[playerid][pSAK]);
ini_setInteger(File,"SM4", PlayerInfo[playerid][pSM4]);
ini_setInteger(File,"SReaf", PlayerInfo[playerid][pSReaf]);
ini_setInteger(File,"SNark", PlayerInfo[playerid][pSNark]);
PHP:
ini_setInteger(File,"SDp", PlayerInfo[playerid][pSSd]);
ini_setInteger(File,"SDeag", PlayerInfo[playerid][pSDeag]);
ini_setInteger(File,"SShot", PlayerInfo[playerid][pSShot]);
ini_setInteger(File,"SSMG", PlayerInfo[playerid][pSSMG]);
ini_setInteger(File,"SAK47", PlayerInfo[playerid][pSAK]);
ini_setInteger(File,"SM4", PlayerInfo[playerid][pSM4]);
ini_setInteger(File,"SReaf", PlayerInfo[playerid][pSReaf]);
ini_setInteger(File,"SNark", PlayerInfo[playerid][pSNark]);
PHP:
ini_setInteger(File,"SDp", PlayerInfo[playerid][pSSd]);
ini_setInteger(File,"SDeag", PlayerInfo[playerid][pSDeag]);
ini_setInteger(File,"SShot", PlayerInfo[playerid][pSShot]);
ini_setInteger(File,"SSMG", PlayerInfo[playerid][pSSMG]);
ini_setInteger(File,"SAK47", PlayerInfo[playerid][pSAK]);
ini_setInteger(File,"SM4", PlayerInfo[playerid][pSM4]);
ini_setInteger(File,"SReaf", PlayerInfo[playerid][pSReaf]);
ini_setInteger(File,"SNark", PlayerInfo[playerid][pSNark]);
PHP:
ini_getInteger(File,"SDp", PlayerInfo[playerid][pSSd]);
ini_getInteger(File,"SDeag", PlayerInfo[playerid][pSDeag]);
ini_getInteger(File,"SShot", PlayerInfo[playerid][pSShot]);
ini_getInteger(File,"SSMG", PlayerInfo[playerid][pSSMG]);
ini_getInteger(File,"SAK47", PlayerInfo[playerid][pSAK]);
ini_getInteger(File,"SM4", PlayerInfo[playerid][pSM4]);
ini_getInteger(File,"SReaf", PlayerInfo[playerid][pSReaf]);
ini_getInteger(File,"SNark", PlayerInfo[playerid][pSNark]);
PHP:
YCMD:opanel(playerid, params[], help)
{
new string[500];
new gun = PlayerInfo[playerid][pSSd];
new gun1 = PlayerInfo[playerid][pSDeag];
new gun2 = PlayerInfo[playerid][pSShot];
new gun3 = PlayerInfo[playerid][pSSMG];
new gun4 = PlayerInfo[playerid][pSAK];
new gun5 = PlayerInfo[playerid][pSM4];
new gun6 = PlayerInfo[playerid][pSReaf];
new nark = PlayerInfo[playerid][pSNark];
new bouse = PlayerInfo[playerid][pPhousekey];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (bouse != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
if(PlayerToPoint(20, playerid,HouseInfo[bouse][hExitx], HouseInfo[bouse][hExity], HouseInfo[bouse][hExitz]))
{
format(string,sizeof(string),"{FFFFFF}[1]> Положить оружие\n[2]> Положить наркотики\n{056CDC}Оружие Патроны{FFFFFF}\nSdPistol %d\nDeagle %d\nShotGun %d\nSMG %d\nAK-\
47 %d\nM4 %d\nReafle %d\nНаркотики %d",gun,gun1,gun2,gun3,gun4,gun5,gun6,nark);
SPD(playerid,SEIF,DIALOG_STYLE_LIST,"Сейф",string,"Выбрать","Назад");
}
else return SendClientMessage(playerid, COLOR_WHITE, "Ошибка: Вы не у себя в доме");
}
else return SendClientMessage(playerid, COLOR_WHITE, "Ошибка: Вы не владелец дома");
return true;
}
PHP:
if(strcmp(cmd, "/opanel", true) == 0)
{
new string[500];
new gun = PlayerInfo[playerid][pSSd];
new gun1 = PlayerInfo[playerid][pSDeag];
new gun2 = PlayerInfo[playerid][pSShot];
new gun3 = PlayerInfo[playerid][pSSMG];
new gun4 = PlayerInfo[playerid][pSAK];
new gun5 = PlayerInfo[playerid][pSM4];
new gun6 = PlayerInfo[playerid][pSReaf];
new nark = PlayerInfo[playerid][pSNark];
new bouse = PlayerInfo[playerid][pPhousekey];
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
if (bouse != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0)
{
if(PlayerToPoint(20, playerid,HouseInfo[bouse][hExitx], HouseInfo[bouse][hExity], HouseInfo[bouse][hExitz]))
{
format(string,sizeof(string),"{FFFFFF}[1]> Положить оружие\n[2]> Положить наркотики\n{056CDC}Оружие Патроны{FFFFFF}\nSdPistol %d\nDeagle %d\nShotGun %d\nSMG %d\nAK-\
47 %d\nM4 %d\nReafle %d\nНаркотики %d",gun,gun1,gun2,gun3,gun4,gun5,gun6,nark);
SPD(playerid,SEIF,DIALOG_STYLE_LIST,"Сейф",string,"Выбрать","Назад");
}
else return SendClientMessage(playerid, COLOR_WHITE, "Ошибка: Вы не у себя в доме");
}
else return SendClientMessage(playerid, COLOR_WHITE, "Ошибка: Вы не владелец дома");
return true;
}
PHP:
if(dialogid == SEIF)
{
new gun0 = PlayerInfo[playerid][pSSd];
new gun1 = PlayerInfo[playerid][pSDeag];
new gun2 = PlayerInfo[playerid][pSShot];
new gun3 = PlayerInfo[playerid][pSSMG];
new gun4 = PlayerInfo[playerid][pSAK];
new gun5 = PlayerInfo[playerid][pSM4];
new gun6 = PlayerInfo[playerid][pSReaf];
new nark = PlayerInfo[playerid][pSNark];
if(!response) return 0;
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pSlot2] == 24)
{
PlayerInfo[playerid][pSDeag] += PlayerInfo[playerid][pSlotammo2];
PlayerInfo[playerid][pSlotammo2] = 0;
PlayerInfo[playerid][pSlot2] = 0;
}
if(PlayerInfo[playerid][pSlot2] == 23)
{
PlayerInfo[playerid][pSSd] += PlayerInfo[playerid][pSlotammo2];
PlayerInfo[playerid][pSlotammo2] = 0;
PlayerInfo[playerid][pSlot2] = 0;
}
PlayerInfo[playerid][pSShot] += PlayerInfo[playerid][pSlotammo3];
PlayerInfo[playerid][pSlotammo3] = 0;
PlayerInfo[playerid][pSlot3] = 0;
PlayerInfo[playerid][pSReaf] += PlayerInfo[playerid][pSlotammo6];
PlayerInfo[playerid][pSlotammo6] = 0;
PlayerInfo[playerid][pSlot6] = 0;
if(PlayerInfo[playerid][pSlot5] == 30)
{
PlayerInfo[playerid][pSAK] += PlayerInfo[playerid][pSlotammo5];
PlayerInfo[playerid][pSlotammo5] = 0;
PlayerInfo[playerid][pSlot5] = 0;
}
if(PlayerInfo[playerid][pSlot5] == 31)
{
PlayerInfo[playerid][pSM4] += PlayerInfo[playerid][pSlotammo5];
PlayerInfo[playerid][pSlotammo5] = 0;
PlayerInfo[playerid][pSlot5] = 0;
}
PlayerInfo[playerid][pSSMG] += PlayerInfo[playerid][pSlotammo4];
PlayerInfo[playerid][pSlotammo4] = 0;
PlayerInfo[playerid][pSlot4] = 0;
ResetPlayerWeapons(playerid);
OnPlayerSave(playerid);
}
case 1:
{
PlayerInfo[playerid][pSNark] = PlayerInfo[playerid][pDrugs];
PlayerInfo[playerid][pDrugs] = 0;
OnPlayerSave(playerid);
}
case 3:
{
if(PlayerInfo[playerid][pSSd] >=100)
{
PlayerInfo[playerid][pSSd] -= 100;
gun = 23; ammo += 100;
}
if(PlayerInfo[playerid][pSSd] < 100)
{
gun = 23; ammo += PlayerInfo[playerid][pSSd];
PlayerInfo[playerid][pSSd] = 0;
}
OnPlayerSave(playerid);
}
case 4:
{
if(PlayerInfo[playerid][pSDeag] >=100)
{
PlayerInfo[playerid][pSDeag] -= 100;
gun = 24; ammo += 100;
}
if(PlayerInfo[playerid][pSDeag] < 100)
{
gun = 24; ammo += PlayerInfo[playerid][pSDeag];
PlayerInfo[playerid][pSDeag] = 0;
}
OnPlayerSave(playerid);
}
case 5:
{
if(PlayerInfo[playerid][pSShot] >=100)
{
PlayerInfo[playerid][pSShot] -= 100;
gun = 25; ammo += 100;
}
if(PlayerInfo[playerid][pSShot] < 100)
{
gun = 25; ammo += PlayerInfo[playerid][pSShot];
PlayerInfo[playerid][pSShot] = 0;
}
OnPlayerSave(playerid);
}
case 6:
{
if(PlayerInfo[playerid][pSSMG] >=100)
{
PlayerInfo[playerid][pSSMG] -= 100;
gun = 29; ammo += 100;
}
if(PlayerInfo[playerid][pSSMG] < 100)
{
gun = 29; ammo += PlayerInfo[playerid][pSSMG];
PlayerInfo[playerid][pSSMG] = 0;
}
OnPlayerSave(playerid);
}
case 7:
{
if(PlayerInfo[playerid][pSAK] >=100)
{
PlayerInfo[playerid][pSAK] -= 100;
gun = 30; ammo += 100;
}
if(PlayerInfo[playerid][pSAK] < 100)
{
gun = 30; ammo += PlayerInfo[playerid][pSAK];
PlayerInfo[playerid][pSAK] = 0;
}
OnPlayerSave(playerid);
}
case 8:
{
if(PlayerInfo[playerid][pSM4] >=100)
{
PlayerInfo[playerid][pSM4] -= 100;
gun = 31; ammo += 100;
}
if(PlayerInfo[playerid][pSM4] < 100)
{
gun = 31; ammo += PlayerInfo[playerid][pSM4];
PlayerInfo[playerid][pSM4] = 0;
}
OnPlayerSave(playerid);
}
case 9:
{
if(PlayerInfo[playerid][pSReaf] >=100)
{
PlayerInfo[playerid][pSReaf] -= 100;
gun = 33; ammo += 100;
}
if(PlayerInfo[playerid][pSReaf] < 100)
{
PlayerInfo[playerid][pSReaf] = 0;
gun = 33; ammo += PlayerInfo[playerid][pSReaf];
}
OnPlayerSave(playerid);
}
case 10:
{
if(PlayerInfo[playerid][pSNark] >=150)
{
PlayerInfo[playerid][pSNark] -= 150;
PlayerInfo[playerid][pDrugs] += 150;
}
if(PlayerInfo[playerid][pSNark] < 150)
{
PlayerInfo[playerid][pDrugs] += PlayerInfo[playerid][pSNark];
PlayerInfo[playerid][pSNark] = 0;
}
OnPlayerSave(playerid);
}
}
GetWeaponName(gun, gunname, sizeof(gunname));
GetWeaponPla(playerid, gun, ammo);
OnPlayerUpdateRL(playerid);
return 1;
}
PHP:
IsAPistol(gunid) return (gunid >= 22 && gunid <=24)? true:false;
IsAGirlsStuff(gunid) return (gunid >= 10 && gunid <= 15 || gunid == 46)? true:false;
IsAGrenade(gunid) return ((gunid >= 16 && gunid <= 18) || gunid == 39)? true:false;
IsAShotgun(gunid) return (gunid >= 25 && gunid <= 27)? true:false;
IsAMachineGun(gunid) return (gunid == 28 || gunid == 29 || gunid == 32)? true:false;
IsAnAssault(gunid) return (gunid == 30 || gunid == 31)? true:false;
IsARifle(gunid) return (gunid == 33 || gunid == 34)? true:false;
IsAHeavyAssault(gunid)return (gunid >= 35 && gunid <= 37)? true:false;
IsAStuff1(gunid) return (gunid >= 41 && gunid <= 43)? true:false;
stock GetWeaponPla(playerid,weaponid,ammo)
{
PyxiTime[playerid] = 5;
if(IsAPistol(weaponid)) PlayerInfo[playerid][pSlot2] = weaponid,PlayerInfo[playerid][pSlotammo2] = ammo;
else if(IsAShotgun(weaponid)) PlayerInfo[playerid][pSlot3] = weaponid,PlayerInfo[playerid][pSlotammo3] = ammo;
else if(IsAMachineGun(weaponid)) PlayerInfo[playerid][pSlot4] = weaponid,PlayerInfo[playerid][pSlotammo4] = ammo;
else if(IsAnAssault(weaponid)) PlayerInfo[playerid][pSlot5] = weaponid,PlayerInfo[playerid][pSlotammo5] = ammo;
else if(IsARifle(weaponid)) PlayerInfo[playerid][pSlot6] = weaponid,PlayerInfo[playerid][pSlotammo6] = ammo;
else if(IsAHeavyAssault(weaponid)) PlayerInfo[playerid][pSlot7] = weaponid,PlayerInfo[playerid][pSlotammo7] = ammo;
else if(IsAHeavyAssault(weaponid))PlayerInfo[playerid][pSlot7] = weaponid,PlayerInfo[playerid][pAmmo7] = ammo;
else if(IsAGrenade(weaponid)) PlayerInfo[playerid][pSlot8] = weaponid,PlayerInfo[playerid][pSlotammo8] = ammo;
else if(IsAStuff1(weaponid)) PlayerInfo[playerid][pSlot9] = weaponid,PlayerInfo[playerid][pSlotammo9] = ammo;
else if(IsAGirlsStuff(weaponid)) PlayerInfo[playerid][pSlot10] = weaponid,PlayerInfo[playerid][pSlotammo10] = ammo;
Weapons[playerid][weaponid]= 1; GivePlayerWeapon(playerid,weaponid,ammo);
return true;
}
Скриншот:
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Ошибки пишите в комментарии
