Merlin
Умник
Автор системы: Joker_Fox
Мод : GTA Verona - new.pwn MySQL R5.
[HR][/HR]
Ко всем new : добавим
[HR][/HR]
В public OnGameModeInit() : добавим пикап.
[HR][/HR]
В public OnPlayerEnterCheckpoint(playerid) : добавим
[HR][/HR]
В public OnPlayerPickUpPickup(playerid, pickupid) : добавим
[HR][/HR]
В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) : добавим
[HR][/HR]
В конце мода просто добавим
[HR][/HR]
Результат :
Мод : GTA Verona - new.pwn MySQL R5.
[HR][/HR]
Ко всем new : добавим
PHP:
new forestJobPickUP;
new Float:cForestJob[][3] = {
{566.6660,1302.2390,11.2688},
{623.7001,1347.3214,13.1828},
{589.8292,1337.8979,11.1876},
{494.6349,1300.1104,10.0656}
};
В public OnGameModeInit() : добавим пикап.
PHP:
forestJobPickUP = CreatePickup(1275,23,590.8901,1231.3318,11.7188);
В public OnPlayerEnterCheckpoint(playerid) : добавим
Код:
Данный калбек вызывается когда игрок входит в чекпоинт
PHP:
if(GetPVarInt(playerid,"pForestJob") == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerAttachedObject(playerid,0,18635,6);
ApplyAnimation(playerid,"CHAINSAW","WEAPON_csaw",1.0,1,0,0,0,6000,0);
SetTimerEx("PreWoodLoaded",4000+random(4000),false,"i",playerid);
return 1;
}
if(GetPVarInt(playerid,"pForestJob") == 2)
{
DisablePlayerCheckpoint(playerid);
RemovePlayerAttachedObject(playerid,0);
RemovePlayerAttachedObject(playerid,4);
ApplyAnimation(playerid,"CARRY","putdwn105",4.1,0,1,1,1,1);
new KG = 10+random(10);
SetPVarInt(playerid,"ForestKG", GetPVarInt(playerid,"ForestKG")+KG);
new mes[128];
format(mes,sizeof(mes),"Вы принесли 1 бочку в ней %d кг нефти. Всего добыто вами кг нефти: %d",KG,GetPVarInt(playerid,"ForestKG"));
SendClientMessage(playerid,-1,mes);
new P = random(sizeof(cForestJob));
SetPlayerCheckpoint(playerid,cForestJob[P][0],cForestJob[P][1],cForestJob[P][2],1.0);
SetPVarInt(playerid,"pForestJob",1);
return 1;
}
В public OnPlayerPickUpPickup(playerid, pickupid) : добавим
PHP:
if(pickupid == forestJobPickUP)
{
if(!GetPVarInt(playerid,"PForestJob")) ShowPlayerDialog(playerid,50,0,"Работа Нефтянника","{ffffff}Вы хотите начать работу нефтянника?","Да","Нет");
else ShowPlayerDialog(playerid,50,0,"Завершение работы","{ffffff}Вы хотите закончить работу и забрать деньги?","Да","Нет");
}
В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) : добавим
PHP:
case 50:
{
if(!response)return 1;
if(!GetPVarInt(playerid,"pForestJob"))
{
SetPVarInt(playerid,"pForestJob",1);
SetPlayerSkin(playerid,16);
new P = random(sizeof(cForestJob));
SetPlayerCheckpoint(playerid,cForestJob[P][0],cForestJob[P][1],cForestJob[P][2],0.8);
SendClientMessage(playerid,-1,"{33AA33}Вы начали работу нефтянника. Идите на {FF0000}красную{33AA33} метку");
return 1;
}
else
{
new ZP = GetPVarInt(playerid,"ForestKG")*PriceFKG,
mes[128];
format(mes,sizeof(mes),"{33AA33}Вы заработали {FFFFFF}%d$. {33AA33}Приходите еще",GetPVarInt(playerid,"ForestKG"));
SendClientMessage(playerid,-1,mes);
PlayerInfo[playerid][pCash] += ZP;
DeletePVar(playerid,"ForestKG");
DeletePVar(playerid,"pForestJob");
RemovePlayerAttachedObject(playerid,0);
RemovePlayerAttachedObject(playerid,4);
DisablePlayerCheckpoint(playerid);
SetPlayerSkin(playerid,PlayerInfo[playerid][pSkin]);
return 1;
}
}
В конце мода просто добавим
PHP:
forward PreWoodLoaded(playerid);
public PreWoodLoaded(playerid)
{
GameTextForPlayer(playerid, "~g~Please Wait", 1000,3);
RemovePlayerAttachedObject(playerid,0);
RemovePlayerAttachedObject(playerid,4);
ClearAnimations(playerid);
SetPlayerAttachedObject(playerid, 4,935, 1, 0.350699, 0.500000, 0.000000, 259.531341, 30.949592, 0.000000, 0.476124, 0.468181, 0.470769);
SetPVarInt(playerid,"pForestJob",2);
SetPlayerCheckpoint(playerid,591.9299,1251.8320,11.7113,1.0);
return 1;
}
Результат :
Последнее редактирование модератором:
