Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*================================================
- | wHosp System |
- | Created by: WagnerPM |
- |=================================================
- */
- #include <a_samp>
- //***********| Color |***********//
- #define COLOR_HOSP 0xFF6A6AFF
- //***********| Variable |***********//
- enum hInfo
- {
- wHospital
- }
- new PlayerHosp[MAX_PLAYERS][hInfo];
- //***********| Forward |***********//
- forward dHospital(playerid);
- forward LeaveHosp(playerid);
- //***********| CallBack |***********//
- public OnPlayerSpawn(playerid)
- {
- dHospital(playerid);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 8439)
- {
- if(response)
- {
- PlayerHosp[playerid][wHospital] = 1;
- SetPlayerPos(playerid, 1147.0319,-1320.8429,13.6194);
- SetPlayerCameraPos(playerid, 1213.0211,-1324.1941,29.4499);
- SetPlayerCameraLookAt(playerid, 1147.0319,-1320.8429,13.6194);
- SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY] You were taken to the All Saints General Hospital.");
- SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY]{FFFFFF} * Time to exit: 3 minutes");
- SetTimerEx("LeaveHosp",180000, false,"i",playerid);
- }
- else
- {
- PlayerHosp[playerid][wHospital] = 2;
- SetPlayerPos(playerid, 2042.8104,-1406.6571,17.4756);
- SetPlayerCameraPos(playerid, 1989.3195,-1459.0018,64.9587);
- SetPlayerCameraLookAt(playerid, 2042.8104,-1406.6571,17.4756);
- SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY] You were taken to the County General Hospital");
- SendClientMessage(playerid,COLOR_HOSP,"[EMERGENCY]{FFFFFF} * Time to exit: 30 seconds");
- SetTimerEx("LeaveHosp",30000, false,"i",playerid);
- }
- }
- return 1;
- }
- public dHospital(playerid)
- {
- if(PlayerHosp[playerid][wHospital] > 0)
- {
- PlayerHosp[playerid][wHospital] = 1;
- TogglePlayerControllable(playerid, 0);
- new wstg[500];
- strins(wstg,"\n{FF0000}Where do you want to go?",strlen(wstg));
- strins(wstg,"\n\n {FF6A6A}All Saints General Hospital.",strlen(wstg));
- strins(wstg,"\n {DEDBDB}Cost: {00D632}R$50 dollars{DEDBDB} | Time: {00D632}3 Minutes.",strlen(wstg));
- strins(wstg,"\n {FF6A6A}County General Hospital.",strlen(wstg));
- strins(wstg,"\n {DEDBDB}Cost: {00D632}R$800 dollars{DEDBDB} | Time: {00D632}30 Seconds.",strlen(wstg));
- ShowPlayerDialog(playerid,8439, DIALOG_STYLE_MSGBOX, "You're sick!",wstg, "All Saints", "County");
- }
- return 1;
- }
- public LeaveHosp(playerid)
- {
- if(PlayerHosp[playerid][wHospital] == 1)
- {
- PlayerHosp[playerid][wHospital] = 0;
- GivePlayerMoney(playerid,-50);
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid,COLOR_HOSP,"[RELEASED] You are healed.");
- SendClientMessage(playerid,COLOR_HOSP,"[RELEASED]{FFFFFF} * Cost: 50 dollars.");
- SetPlayerPos(playerid,1176.5968,-1323.2819,14.0292);
- SetPlayerFacingAngle(playerid,267.7651);
- SetCameraBehindPlayer(playerid);
- }
- if(PlayerHosp[playerid][wHospital] == 2)
- {
- PlayerHosp[playerid][wHospital] = 0;
- GivePlayerMoney(playerid,-800);
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid,COLOR_HOSP,"[RELEASED] You are healed.");
- SendClientMessage(playerid,COLOR_HOSP,"[RELEASED]{FFFFFF} * Cost: 800 dollars.");
- SetPlayerPos(playerid,2032.3580,-1404.8065,17.2500);
- SetPlayerFacingAngle(playerid,150.3944);
- SetCameraBehindPlayer(playerid);
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SetTimerEx("dHospital",5000, false,"i",playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement