14.03.2010, 13:06
Today I made a new fishing system because couldn't find any, I made it and its the code,
The problem is, it doesnt check the vehicle and when I say the cmd it looks like all fishes caught but no money, only 8 * -10(bait money), Please fix it!
Код:
if (strcmp("/fish", cmdtext, true) == 0) { new vehicle; new fishrnd; new weightrnd; vehicle = GetPlayerVehicleID(playerid); fishrnd = random(10); weightrnd = random(10); if (vehicle = 453) { if (fishrnd = 1) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught some Shrimps"); GivePlayerMoney(playerid, (1 * weightrnd)); } if (fishrnd = 2) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught some Sardine"); GivePlayerMoney(playerid, (2 * weightrnd)); } if (fishrnd = 3) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught some Herring"); GivePlayerMoney(playerid, (3 * weightrnd)); } if (fishrnd = 4) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught some Mackerel"); GivePlayerMoney(playerid, (4 * weightrnd)); } if (fishrnd = 5) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught some Trout"); GivePlayerMoney(playerid, (5 * weightrnd)); } if (fishrnd = 6) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught a pair of pants and threw it back"); } if (fishrnd = 7) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught a used condom and threw it back"); } if (fishrnd = 8) { GivePlayerMoney(playerid, -10); SendClientMessage(playerid, COLOR_OOC, "[Fishing] You caught a moneybag, lucky you"); GivePlayerMoney(playerid, (10 * weightrnd)); } } else if (vehicle != 453) { SendClientMessage(playerid, COLOR_OOC, "[Fishing] You are not in a Reefer"); } return 1; }