Jeka1999
Умник
Если многим понравится, то мб выложу версию 2 как на ВЛ (со скиллами).))
Ко всем new
В public OnPlayerCommandText(playerid, cmdtext[])
В public Fresh()
В public OnGameModeInit()
В public OnPlayerPickUpPickup(playerid, pickupid)
В public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
В конец мода создаем stock
Ну вроде все.)
Будут ошибки пишите.
Автор: Jeka1999
Ко всем new
PHP:
new fishbuy;
PHP:
if(strcmp("/fish", cmdtext, true, 10) == 0)
{
if(Player****[playerid][pLevel] < 3) return SendClientMessage(playerid, COLOR_WHITE, "Функция доступна с 3 уровня");
if(VaildFishPlace(playerid) && !IsPlayerInAnyVehicle(playerid))
{
if(GetPVarInt(playerid, "Fishing") > 0) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Вы уже рыбачите!");
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
new randfish = 10 + random(19);
SetPVarInt(playerid, "FishingTime", randfish);
GameTextForPlayer(playerid,"~g~Waiting....", randfish*1000, 6);
new object = SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
SetPVarInt(playerid, "FishingObject", object);
SetPVarInt(playerid, "Fishing", 1);
}
else SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Вы должны находиться на пристани ЛС!");
return 1;
}
PHP:
if(strcmp("/stopfish", cmdtext, true, 10) == 0)
{
if(GetPVarInt(playerid, "Fishing") == 0) return SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Вы не рыбачите!");
TogglePlayerControllable(playerid, 1);
ApplyAnimation(playerid,"CARRY","crry_prtial",4.0,0,0,0,0,0);
DeletePVar(playerid, "FishingTime");
DeletePVar(playerid, "Fishing");
RemovePlayerAttachedObject(playerid,0);
RemovePlayerAttachedObject(playerid,GetPVarInt(playerid, "FishingObject"));
DeletePVar(playerid, "FishingObject");
SendClientMessage(playerid, COLOR_GREY, "{F70000}x{ADAEAD} Вы отменили процесс рыбалки");
return 1;
}
PHP:
if(GetPVarInt(i, "FishingTime") > 0 && GetPVarInt(i, "Fishing") > 0)
{
SetPVarInt(i, "FishingTime", GetPVarInt(i, "FishingTime") - 1);
if(GetPVarInt(i, "FishingTime") == 0)
{
new fish = random(3), massa, massa_, name[20];
if(fish == 0) name = "Маленькую", massa = 1 + random(15);
if(fish == 1) name = "Среднюю", massa = 15 + random(15);
if(fish == 2) name = "Большую", massa = 30 + random(15);
if(fish == 3) name = "Ничего", massa = 0;
else massa_ = massa;
Player****[i][pFishes] += massa_;
if(fish == 3) SendClientMessage(i, COLOR_BLUE, "Вы ничего не поймали. Попробуйте еще раз");
else SendMes(i, COLOR_WHITE, "Вы поймали {00B464}%s{F0F0F0} рыбу. Вес: {00B464}%i{F0F0F0} кг", name, massa_);
TogglePlayerControllable(i, 1);
ApplyAnimation(i,"CARRY","crry_prtial",4.0,0,0,0,0,0);
DeletePVar(i, "FishingTime");
DeletePVar(i, "Fishing");
RemovePlayerAttachedObject(i,0);
RemovePlayerAttachedObject(i,GetPVarInt(i, "FishingObject"));
DeletePVar(i, "FishingObject");
}
}
PHP:
fishbuy = CreatePickup(1239, 23, 360.2308,-2031.9965,7.8359);//Рыбалка
PHP:
if(pickupid == fishbuy) //
{
format(string, 256, "{ffffff}Введите кол-во кг рыбы:\n\nВы имеете {00B464}%i{F0F0F0} кг рыбы\nНа {00B464}1{F0F0F0} единицу кг рыбы приходиться {00B464}8 {F0F0F0}долларов", Player****[playerid][pFishes]);
SPD(playerid, 19010, 1, "Рыба", string, "Принять", "Отмена");
}
PHP:
case 19010:
{
if(!response) return 1;
new price = strval(inputtext);
if(!strlen(inputtext))
{
format(string, 256, "{ffffff}Введите кол-во кг рыбы:\n\nВы имеете {00B464}%i{F0F0F0} кг рыбы\nНа {00B464}1{F0F0F0} единицу кг рыбы приходиться {00B464}8 {F0F0F0}долларов", Player****[playerid][pFishes]);
return ShowPlayerDialog(playerid, 19010, 1, "Рыба", string, "Принять", "Отмена");
}
if(price < 1 || price > Player****[playerid][pFishes])
{
SendClientMessage(playerid, COLOR_GREY, "У вас нет столько кг рыбы!");
format(string, 256, "{ffffff}Введите кол-во кг рыбы:\n\nВы имеете {00B464}%i{F0F0F0} кг рыбы\nНа {00B464}1{F0F0F0} единицу кг рыбы приходиться {00B464}8 {F0F0F0}долларов", Player****[playerid][pFishes]);
return ShowPlayerDialog(playerid, 19010, 1, "Рыба", string, "Принять", "Отмена");
}
SendMes(playerid, COLOR_WHITE, "Вы продали {00B464}%i{F0F0F0} кг рыбы. Вам выдано: {00B464}%i{F0F0F0} долларов", price, price*8);
GiveMoney(playerid, price*8);
Player****[playerid][pFishes] -= price;
return 1;
}
PHP:
stock VaildFishPlace(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 4,403.8266,-2088.7598,7.8359) || IsPlayerInRangeOfPoint(playerid, 4,398.7553,-2088.7490,7.8359)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, 4,396.2197,-2088.6692,7.8359) || IsPlayerInRangeOfPoint(playerid, 4,391.1094,-2088.7976,7.8359)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, 4,383.4157,-2088.7849,7.8359) || IsPlayerInRangeOfPoint(playerid, 4,374.9598,-2088.7979,7.8359)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, 4,369.8107,-2088.7927,7.8359) || IsPlayerInRangeOfPoint(playerid, 4,367.3637,-2088.7925,7.8359)) return 1;
else if(IsPlayerInRangeOfPoint(playerid, 4,362.2244,-2088.7981,7.8359) || IsPlayerInRangeOfPoint(playerid, 4,354.5382,-2088.7979,7.8359)) return 1;
return 0;
}
Будут ошибки пишите.
Автор: Jeka1999
