Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ENT:AcceptInput(name, activator, caller)
- if (!self.nextUse or CurTime() >= self.nextUse) then
- if (name == "Use" and caller:IsPlayer()) then
- if (caller:GetNWInt("melon")>0) or (caller:GetNWInt("cabbage")>0) or (caller:GetNWInt("watermelon")>0) or (caller:GetNWInt("tomato")>0) or (caller:GetNWInt("orange")>0) or
- (caller:GetNWInt("apple")>0) or (caller:GetNWInt("lemon")>0) or (caller:GetNWInt("potato")>0) then
- caller:SendLua("local tab={Color(255,255,255),[[Hello ]],Color(0,75,255),[["..caller:Nick().."]],Color(255,255,255),[[!]]}chat.AddText(unpack(tab))");
- self:EmitSound("vo/npc/male01/nice.wav", 70, 100);
- local totalAmount = 0;
- if (caller:GetNWInt("melon")>0) then
- local money = math.Round(caller:GetNWInt("melon")*FS_Melon_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("melon") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(213,213,25),[["..caller:GetNWInt("melon").." Melons]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("melon") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(213,213,25),[["..caller:GetNWInt("melon").." Melon]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("melon", 0);
- end;
- if (caller:GetNWInt("cabbage")>0) then
- local money = math.Round(caller:GetNWInt("cabbage")*FS_Cabbage_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("cabbage") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(177,222,160),[["..caller:GetNWInt("cabbage").." Cabbages]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("cabbage") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(177,222,160),[["..caller:GetNWInt("cabbage").." Cabbage]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("cabbage", 0);
- end;
- if (caller:GetNWInt("watermelon")>0) then
- local money = math.Round(caller:GetNWInt("watermelon")*FS_Watermelon_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("watermelon") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(119,214,25),[["..caller:GetNWInt("watermelon").." Watermelons]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("watermelon") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(119,214,25),[["..caller:GetNWInt("watermelon").." Watermelon]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("watermelon", 0);
- end;
- if (caller:GetNWInt("tomato")>0) then
- local money = math.Round(caller:GetNWInt("tomato")*FS_Tomato_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("tomato") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(175,0,0),[["..caller:GetNWInt("tomato").." Tomatoes]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("tomato") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(175,0,0),[["..caller:GetNWInt("tomato").." Tomato]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("tomato", 0);
- end;
- if (caller:GetNWInt("orange")>0) then
- local money = math.Round(caller:GetNWInt("orange")*FS_Orange_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("orange") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(246,165,42),[["..caller:GetNWInt("orange").." Oranges]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("orange") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(246,165,42),[["..caller:GetNWInt("orange").." Orange]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("orange", 0);
- end;
- if (caller:GetNWInt("apple")>0) then
- local money = math.Round(caller:GetNWInt("apple")*FS_Apple_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("apple") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(138,239,95),[["..caller:GetNWInt("apple").." Apples]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("apple") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(138,239,95),[["..caller:GetNWInt("apple").." Apple]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("apple", 0);
- end;
- if (caller:GetNWInt("lemon")>0) then
- local money = math.Round(caller:GetNWInt("lemon")*FS_Lemon_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("lemon") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(225,255,0),[["..caller:GetNWInt("lemon").." Lemons]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("lemon") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(225,255,0),[["..caller:GetNWInt("lemon").." Lemon]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("lemon", 0);
- end;
- if (caller:GetNWInt("potato")>0) then
- local money = math.Round(caller:GetNWInt("potato")*FS_Potato_Price);
- totalAmount = totalAmount + money;
- if (GAMEMODE.Version == "2.5.1") then
- caller:addMoney(money);
- elseif (GAMEMODE.Version == "2.4.3") then
- caller:AddMoney(money);
- end;
- if (caller:GetNWInt("potato") > 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(125,82,17),[["..caller:GetNWInt("potato").." Potatoes]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- elseif (caller:GetNWInt("potato") == 1) then
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..money.."$]],Color(255,255,255),[[ for selling ]],Color(125,82,17),[["..caller:GetNWInt("potato").." Potato]],Color(255,255,255),[[.]]}chat.AddText(unpack(tab))");
- end;
- caller:SetNWInt("potato", 0);
- end;
- caller:SendLua("local tab={Color(255,255,255),[[You got ]],Color(25,255,25),[["..totalAmount.."$ ]],Color(255,255,255),[[total.]]}chat.AddText(unpack(tab))");
- else
- self:EmitSound("vo/npc/male01/sorry0"..math.random(1, 3)..".wav", 70, 100);
- caller:SendLua("local tab={Color(255,255,255),[[You don't have anything to sell!]]}chat.AddText(unpack(tab))");
- end;
- end;
- self.nextUse = CurTime() + 1;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement