Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////
- // © 2009-2010 Pulsar Effect //
- // All rights reserved //
- ///////////////////////////////
- // This material may not be //
- // reproduced, displayed, //
- // modified or distributed //
- // without the express prior //
- // written permission of the //
- // the copyright holder. //
- ///////////////////////////////
- local NPC = {};
- NPC.Name = "Garage";
- NPC.ID = 5;
- NPC.Model = Model("models/players/PERP2/f_3_02.mdl");
- NPC.Invisible = false; // Used for ATM Machines, Casino Tables, etc.
- NPC.Location = Vector(-5317.2427, -10296.3262, 71.0313);
- NPC.Angles = Angle(0, 0, 0);
- NPC.ShowChatBubble = "Normal";
- NPC.Sequence = 6;
- // This is always local player.
- function NPC.OnTalk ( )
- GAMEMODE.DialogPanel:SetDialog("Can I help you?");
- if (LocalPlayer():Team() == TEAM_CITIZEN) then
- GAMEMODE.DialogPanel:AddDialog("Yes, I've come to claim my car.", NPC.License)
- GAMEMODE.DialogPanel:AddDialog("I think I'm lost...", LEAVE_DIALOG)
- else
- GAMEMODE.DialogPanel:AddDialog("No.", LEAVE_DIALOG)
- end
- GAMEMODE.DialogPanel:Show();
- end
- function NPC.License()
- GAMEMODE.DialogPanel:SetDialog("Do you have a Driving License?")
- tmysql.query("SELECT `id`, `license` FROM `perp_users` WHERE `id`='".. Player.SMFID .."'", function ( DLicense )
- Player:SetUMsgInt("license", tonumber(DLicense[1][2]));
- if (DLicense[1][2] > 0) then
- GAMEMODE.DialogPanel:AddDialog("Yes, I've come to claim my car.", NPC.ClaimCar)
- GAMEMODE.DialogPanel:AddDialog("Yes, I want to change cars, please.", NPC.NewCar)
- GAMEMODE.DialogPanel:AddDialog("Nevermind, I don't want my car right now.", LEAVE_DIALOG)
- else
- GAMEMODE.DialogPanel:AddDialog("*Walks away arkwardly*", LEAVE_DIALOG)
- Player:SetPrivateInt("license", tonumber(DLicense[1][2]), true);
- end
- end);
- end
- function NPC.NewCar ( )
- GAMEMODE.ShowGarageView();
- LEAVE_DIALOG();
- end
- function NPC.ClaimCar ( )
- local CarID = LocalPlayer():GetLastCar();
- -- LocalPlayer():Notify(""..CarID.."");
- if LocalPlayer():GetLastCar() == 0 or LocalPlayer():GetLastCar() == nil or LocalPlayer():GetLastCar() == "" then
- GAMEMODE.DialogPanel:SetDialog("It doesn't seem like you were in a car recently.\n(Use Change cars menu or buy a car.)");
- GAMEMODE.DialogPanel:AddDialog("Hmm, ok then.", LEAVE_DIALOG)
- else
- /*
- if GAMEMODE.IsSerious then
- if LocalPlayer():GetCash() < 2000 then
- GAMEMODE.DialogPanel:SetDialog("It seems you don't have enough cash on you.");
- GAMEMODE.DialogPanel:AddDialog("Damn, I will be back when I get the cash.", LEAVE_DIALOG)
- else
- --LocalPlayer():TakeCash(2000);
- RunConsoleCommand('perp_v_c', CarID, 1);
- LEAVE_DIALOG();
- end
- else
- if LocalPlayer():GetCash() < 500 then
- GAMEMODE.DialogPanel:SetDialog("It seems you don't have enough cash on you.");
- GAMEMODE.DialogPanel:AddDialog("Damn, I will be back when I get the cash.", LEAVE_DIALOG)
- else
- --LocalPlayer():TakeCash(500);
- RunConsoleCommand('perp_v_c', CarID, 1);
- LEAVE_DIALOG();
- end
- end
- */
- RunConsoleCommand('perp_v_c', CarID);
- LEAVE_DIALOG();
- end
- end
- function NPC.DoFuel ( )
- local CarID = tostring(LocalPlayer():GetLastCar());
- if LocalPlayer():GetCash() < 50 then
- GAMEMODE.DialogPanel:SetDialog("It seems you don't have enough cash on you.");
- GAMEMODE.DialogPanel:AddDialog("Damn, I will be back when I get the cash.", LEAVE_DIALOG)
- else
- LocalPlayer():TakeCash(50);
- RunConsoleCommand('perp_c_c', 50);
- RunConsoleCommand('perp_v_c', CarID);
- GAMEMODE.DialogPanel:AddDialog("", LEAVE_DIALOG)
- end
- end
- function NPC.DoFix ( )
- local CarID = tostring(LocalPlayer():GetLastCar());
- if LocalPlayer():GetCash() < 2000 then
- GAMEMODE.DialogPanel:SetDialog("It seems you don't have enough cash on you.");
- GAMEMODE.DialogPanel:AddDialog("Damn, I will be back when I get the cash.", LEAVE_DIALOG)
- else
- RunConsoleCommand('perp_c_c', 2000);
- LocalPlayer():SetCarState(0);
- LocalPlayer():TakeCash(2000);
- RunConsoleCommand('perp_v_c', CarID);
- GAMEMODE.DialogPanel:AddDialog("", LEAVE_DIALOG);
- end
- end
- GAMEMODE:LoadNPC(NPC);
- function MiniDebug(Ply, Cmd, Args)
- print (LocalPlayer():GetLastCar())
- end
- concommand.Add("perp_lastcar_debug", MiniDebug)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement