Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===================================================================================================================================================//
- //=====================||||||||||||====||||||||||====|===========||||||||||=====|============|======|||||||||||=====|================================//
- //=====================|===============|========|====|===========|========|=====|=\==========|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|===\========|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|====\=======|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|=====\======|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|=====\======|======|||||||||||=====|================================//
- //=====================|===============|========|====|===========|========|=====|======\=====|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|=======\====|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|=======\====|======|===============|================================//
- //=====================|===============|========|====|===========|========|=====|========\===|======|===============|================================//
- //=====================||||||||||||====||||||||||====|||||||||===||||||||||=====|==========\=|======|||||||||||=====||||||||=========================//
- //===================================================================================================================================================//
- //===================================================================================================================================================//
- #include <a_samp>
- //Hospital Spawns
- #define MAX_HOSPITALS 8
- new Float:Hospitalcoor[MAX_HOSPITALS][4] =
- {
- {2027.4375,-1421.0703,16.9922,137.2809}, // LS Hospital
- {1177.9089,-1323.9611,14.0939,269.8222}, // LS Hospital #2
- {1579.6106,1769.0625,10.8203,90.7178}, // LV Hospital
- {-321.8259,1056.7279,19.7422,316.0064}, // Fort Carson Hospital
- {-1514.8807,2527.8003,55.7315,358.6234}, // El Quebrados Hospital
- {-2662.0439,630.5056,14.4531,177.8114}, // San Fierro Hospital
- {-2199.2495,-2311.0444,30.6250,321.2772}, // Angel Pine Hospital
- {1244.1959,332.2817,19.5547,338.3063} // Montgomery Hospital
- };
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- //if(PlayerInfo[playerid][LoggedIn] == 1) // Check is play login or not
- if(IsPlayerConnected(playerid))
- {
- new Float:PDX,Float:PDY,Float:PDZ;
- new Float:absX,Float:absY,Float:absZ;
- new FinalValue=0,Final=0;
- GetPlayerPos(playerid,PDX,PDY,PDZ);
- for(new i = 0; i < MAX_HOSPITALS ; i++)
- {
- absX = PDX - Hospitalcoor[i][0];
- floatabs(absX);
- if(absX <= FinalValue)
- {
- FinalValue = absX;
- Final= i;
- }
- absY = PDY - Hospitalcoor[i][1];
- floatabs(absY);
- if(absY <= FinalValue)
- {
- FinalValue = absY;
- Final= i;
- }
- absZ = PDX -ZHospitalcoor[i][2];
- floatabs(absZ);
- if(absZ <= FinalValue)
- {
- FinalValue = absZ;
- Final= i;
- }
- }
- /*
- //**** IMPORTANT **** : YOU NEED TO ADD CONDITION IF HAVE FUNCTION JAIL OR ANOTHER EXAMPLE :::::::
- if(PlayerInfo[playerid][Jail] != 0) // Player not got Jail then set spawn hospital
- {
- SetSpawnInfo(playerid,-1,-1,-1,Hospitalcoor[Final][0],Hospitalcoor[Final][1],Hospitalcoor[Final][2],Hispitalcoor[Final][3]); //will setspawn for play when player spawn its will automatically spawn at hospital
- }
- //------------------------------------------------------------------------------------------------
- */
- SetSpawnInfo(playerid,-1,-1,-1,Hospitalcoor[Final][0],Hospitalcoor[Final][1],Hospitalcoor[Final][2],Hispitalcoor[Final][3]); //will setspawn for play when player spawn its will automatically spawn at hospital
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement