SHOW:
|
|
- or go back to the newest paste.
1 | /*================================================ | |
2 | | wHosp System | | |
3 | | Created by: WagnerPM | | |
4 | |================================================= | |
5 | */ | |
6 | #include <a_samp> | |
7 | ||
8 | //***********| Color |***********// | |
9 | #define COLOR_HOSP 0xFF6A6AFF | |
10 | ||
11 | //***********| Variable |***********// | |
12 | enum hInfo | |
13 | { | |
14 | wHospital | |
15 | } | |
16 | new PlayerHosp[MAX_PLAYERS][hInfo]; | |
17 | ||
18 | //***********| Forward |***********// | |
19 | forward dHospital(playerid); | |
20 | forward LeaveHosp(playerid); | |
21 | ||
22 | //***********| CallBack |***********// | |
23 | public OnPlayerSpawn(playerid) | |
24 | { | |
25 | dHospital(playerid); | |
26 | return 1; | |
27 | } | |
28 | ||
29 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
30 | { | |
31 | if(dialogid == 8439) | |
32 | { | |
33 | if(response) | |
34 | { | |
35 | PlayerHosp[playerid][wHospital] = 1; | |
36 | SetPlayerPos(playerid, 1147.0319,-1320.8429,13.6194); | |
37 | SetPlayerCameraPos(playerid, 1213.0211,-1324.1941,29.4499); | |
38 | SetPlayerCameraLookAt(playerid, 1147.0319,-1320.8429,13.6194); | |
39 | SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY] You were taken to the All Saints General Hospital."); | |
40 | SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY]{FFFFFF} * Time to exit: 3 minutes"); | |
41 | SetTimerEx("LeaveHosp",180000, false,"i",playerid); | |
42 | } | |
43 | else | |
44 | { | |
45 | PlayerHosp[playerid][wHospital] = 2; | |
46 | SetPlayerPos(playerid, 2042.8104,-1406.6571,17.4756); | |
47 | SetPlayerCameraPos(playerid, 1989.3195,-1459.0018,64.9587); | |
48 | SetPlayerCameraLookAt(playerid, 2042.8104,-1406.6571,17.4756); | |
49 | SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY] You were taken to the County General Hospital"); | |
50 | SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY]{FFFFFF} * Time to exit: 30 seconds"); | |
51 | SetTimerEx("LeaveHosp",30000, false,"i",playerid); | |
52 | } | |
53 | } | |
54 | return 1; | |
55 | } | |
56 | ||
57 | public dHospital(playerid) | |
58 | { | |
59 | if(PlayerHosp[playerid][wHospital] > 0) | |
60 | { | |
61 | PlayerHosp[playerid][wHospital] = 1; | |
62 | TogglePlayerControllable(playerid, 0); | |
63 | new wstg[500]; | |
64 | strins(wstg,"\n{FF0000}Where do you want to go?",strlen(wstg)); | |
65 | strins(wstg,"\n\n {FF6A6A}All Saints General Hospital.",strlen(wstg)); | |
66 | strins(wstg,"\n {DEDBDB}Cost: {00D632}R$50 dollars{DEDBDB} | Time: {00D632}3 Minutes.",strlen(wstg)); | |
67 | strins(wstg,"\n {FF6A6A}County General Hospital.",strlen(wstg)); | |
68 | strins(wstg,"\n {DEDBDB}Cost: {00D632}R$800 dollars{DEDBDB} | Time: {00D632}30 Seconds.",strlen(wstg)); | |
69 | ShowPlayerDialog(playerid,8439, DIALOG_STYLE_MSGBOX, "You're sick!",wstg, "All Saints", "County"); | |
70 | } | |
71 | return 1; | |
72 | } | |
73 | ||
74 | public LeaveHosp(playerid) | |
75 | { | |
76 | if(PlayerHosp[playerid][wHospital] == 1) | |
77 | { | |
78 | PlayerHosp[playerid][wHospital] = 0; | |
79 | GivePlayerMoney(playerid,-50); | |
80 | TogglePlayerControllable(playerid, 1); | |
81 | SendClientMessage(playerid,COLOR_HOSP,"[RELEASED] You are healed."); | |
82 | SendClientMessage(playerid,COLOR_HOSP,"[RELEASED]{FFFFFF} * Cost: 50 dollars."); | |
83 | SetPlayerPos(playerid,1176.5968,-1323.2819,14.0292); | |
84 | SetPlayerFacingAngle(playerid,267.7651); | |
85 | SetCameraBehindPlayer(playerid); | |
86 | } | |
87 | if(PlayerHosp[playerid][wHospital] == 2) | |
88 | { | |
89 | PlayerHosp[playerid][wHospital] = 0; | |
90 | GivePlayerMoney(playerid,-800); | |
91 | TogglePlayerControllable(playerid, 1); | |
92 | SendClientMessage(playerid,COLOR_HOSP,"[RELEASED] You are healed."); | |
93 | SendClientMessage(playerid,COLOR_HOSP,"[RELEASED]{FFFFFF} * Cost: 800 dollars."); | |
94 | SetPlayerPos(playerid,2032.3580,-1404.8065,17.2500); | |
95 | SetPlayerFacingAngle(playerid,150.3944); | |
96 | SetCameraBehindPlayer(playerid); | |
97 | } | |
98 | return 1; | |
99 | } | |
100 | ||
101 | public OnPlayerDeath(playerid, killerid, reason) | |
102 | { | |
103 | SetTimerEx("dHospital",5000, false,"i",playerid); | |
104 | return 1; | |
105 | } |