Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //task
- new InsideTut[MAX_PLAYERS char];
- #if defined zombiemode
- new zombieevent;
- // task
- task EMSUpdate[5000]()
- {
- foreach(new i: Player)
- {
- if(InsideTut{i} > 0)
- {
- if(gettime() - GetPVarInt(i, "pTutTime") > 20)
- {
- GameTextForPlayer(i, "~n~~n~~n~~n~~n~~n~~n~~n~~w~Bam ~r~~k~~CONVERSATION_YES~~w~ de tiep tuc", 2000, 3);
- }
- }
- if(GetPVarType(i, "Injured"))
- {
- #if defined zombiemode
- if(zombieevent == 1 && GetPVarType(i, "pZombieBit"))
- {
- KillEMSQueue(i);
- ClearAnimations(i);
- MakeZombie(i);
- }
- #endif
- if(GetPVarInt(i, "EMSAttempt") != 0)
- {
- new Float:health;
- GetPlayerHealth(i,health);
- SetPlayerHealth(i, health-1);
- if(GetPVarInt(i, "EMSAttempt") == -1)
- {
- if(GetPlayerAnimationIndex(i) != 746) ClearAnimations(i), ApplyAnimation(i, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
- if(!GetPVarType(i, "StreamPrep") && !IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")) && !GetPVarInt(i, "OnStretcher"))
- {
- SendClientMessageEx(i, COLOR_WHITE, "Ban da bi bat tinh, ban se duoc dua ve benh vien de dieu tri.");
- KillEMSQueue(i);
- SpawnPlayer(i);
- }
- GameTextForPlayer(i, "~r~Bi thuong~n~~w~/chapnhan chet hoac /dichvu capcuu", 5000, 3);
- }
- if(GetPVarInt(i, "EMSAttempt") == 1)
- {
- if(GetPlayerAnimationIndex(i) != 746) ClearAnimations(i), ApplyAnimation(i, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
- if(!GetPVarType(i, "StreamPrep") && !IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")) && !GetPVarInt(i, "OnStretcher"))
- {
- SendClientMessageEx(i, COLOR_WHITE, "Ban lan ra bat tinh, ban duoc dua den benh vien da dieu tri.");
- KillEMSQueue(i);
- SpawnPlayer(i);
- }
- GameTextForPlayer(i, "~r~Bi thuong~n~~w~Dang doi EMS den...", 5000, 3);
- }
- if(GetPVarInt(i, "EMSAttempt") == 2)
- {
- if(!GetPVarType(i, "StreamPrep") && !IsPlayerInRangeOfPoint(i, 3.0, GetPVarFloat(i,"MedicX"), GetPVarFloat(i,"MedicY"), GetPVarFloat(i,"MedicZ")) && !GetPVarInt(i, "OnStretcher"))
- {
- SetPVarInt(i, "EMSWarns", GetPVarInt(i, "EMSWarns")+1);
- if(GetPVarInt(i, "EMSWarns") == 2)
- {
- SendClientMessageEx(i, COLOR_WHITE, "Ban lan ra bat tinh, ban ngay lap tuc duoc dua den benh vien de dieu tri.");
- KillEMSQueue(i);
- SpawnPlayer(i);
- DeletePVar(i, "EMSWarns");
- }
- }
- GameTextForPlayer(i, "~g~Dich vu~n~~w~Dang cho dieu tri...", 5000, 3);
- }
- if(GetPVarInt(i, "EMSAttempt") == 3)
- {
- if(IsPlayerInAnyVehicle(i))
- {
- new ambmodel = GetPlayerVehicleID(i);
- if(IsAnAmbulance(ambmodel))
- {
- GameTextForPlayer(i, "~g~Dich vu~n~~w~Dang cho EMS dua den benh vien...", 5000, 3);
- }
- else
- {
- SendClientMessageEx(i, COLOR_WHITE, "Ban bi bat tinh va khong duoc ho tro, ngay lap tuc duoc dua den nha xac de lay noi tang dem ban.");
- KillEMSQueue(i);
- SpawnPlayer(i);
- }
- }
- else
- {
- SetPVarInt(i, "EMSWarnst", GetPVarInt(i, "EMSWarnst")+1);
- if(GetPVarInt(i, "EMSWarnst") == 2)
- {
- SendClientMessageEx(i, COLOR_WHITE, "Ban roi ra khoi chiec xe, ngay lap tuc duoc dua den nha xac de lay noi tang dem ban.");
- KillEMSQueue(i);
- SpawnPlayer(i);
- DeletePVar(i, "EMSWarnst");
- }
- }
- }
- GetPlayerHealth(i, health);
- if(health <= 5)
- {
- SendClientMessageEx(i, COLOR_WHITE, "Ban lan ra bat tinh, ngay lap tuc duoc dua den benh vien de dieu tri.");
- KillEMSQueue(i);
- SpawnPlayer(i);
- }
- }
- }
- }
- }
- forward firstaidexpire(playerid);
- public firstaidexpire(playerid)
- {
- SendClientMessageEx(playerid, COLOR_GRAD1, "Bo dung cu so cuu cua ban khong con co tac dung.");
- KillTimer(GetPVarInt(playerid, "firstaid5"));
- SetPVarInt(playerid, "usingfirstaid", 0);
- foreach(new i: Player)
- {
- if(PlayerInfo[i][pAdmin] >= 2 && GetPVarType(i, "_dCheck") && GetPVarInt(i, "_dCheck") == playerid)
- {
- SendClientMessageEx(i, COLOR_ORANGE, "Note{ffffff}: First Aid effect has expired on the person you are damage checking.");
- }
- }
- }
- stock RemoveArmor(Player)
- {
- DeletePVar(Player, "ArmorWarning");
- CurrentArmor[Player] = 0.0;
- SetPlayerArmour(Player, 0.0);
- return 1;
- }
- stock IsAnAmbulance(carid)
- {
- if(DynVeh[carid] != -1)
- {
- new iDvSlotID = DynVeh[carid], iGroupID = DynVehicleInfo[iDvSlotID][gv_igID];
- if((0 <= iGroupID < MAX_GROUPS))
- {
- if(arrGroupData[iGroupID][g_iGroupType] == 3) return 1;
- }
- }
- return 0;
- }
- stock SpawnZombie(playerid)
- {
- new Float:maxdis, Float:dis, tpto;
- maxdis=9999.9;
- SetPlayerSkin(playerid, 134);
- SetPlayerHealth(playerid, 200);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- for(new x;x<sizeof(ZombieSpawns);x++)
- {
- dis = GetPointDistanceToPoint(ZombieSpawns[x][0], ZombieSpawns[x][1], ZombieSpawns[x][2], GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
- if((dis < maxdis) && (dis > 50.0))
- {
- tpto=x;
- maxdis=dis;
- }
- }
- SetPlayerPos(playerid, ZombieSpawns[tpto][0], ZombieSpawns[tpto][1], ZombieSpawns[tpto][2]);
- SetPlayerFacingAngle(playerid, ZombieSpawns[tpto][3]);
- ClearAnimations(playerid);
- return 1;
- }
- stock MakeZombie(playerid)
- {
- new Float:X, Float:Y, Float:Z, string[128];
- GetPlayerPos(playerid, X, Y, Z);
- if(IsPlayerConnected(GetPVarInt(playerid, "pZombieBiter")))
- {
- format(string, sizeof(string), "INSERT INTO zombiekills (id,num) VALUES (%d,1) ON DUPLICATE KEY UPDATE num = num + 1", GetPlayerSQLId(GetPVarInt(playerid, "pZombieBiter")));
- mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
- DeletePVar(playerid, "pZombieBiter");
- }
- SendClientMessageEx(playerid, COLOR_RED, "Ban dang la Zombie, su dung /bite de lay nhiem sang nguoi khac!");
- SetPVarInt(playerid, "pIsZombie", 1);
- DeletePVar(playerid, "pZombieBit");
- SetPlayerToTeamColor(playerid);
- SetPlayerHealth(playerid, 200);
- SetPlayerSkin(playerid, 134);
- ResetPlayerWeaponsEx(playerid);
- //SendAudioToRange(70, 100, X, Y, Z, 30); RESCRIPT NEW SOUND
- format(string, sizeof(string), "INSERT INTO `zombie` (`id`) VALUES ('%d')", GetPlayerSQLId(playerid));
- mysql_function_query(MainPipeline, string, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
- return 1;
- }
- stock UnZombie(playerid)
- {
- DeletePVar(playerid, "pIsZombie");
- DeletePVar(playerid, "pZombieBit");
- SetPlayerSkin(playerid, PlayerInfo[playerid][pModel]);
- SetPlayerToTeamColor(playerid);
- return 1;
- }
- #endif
- // EMS
- forward KillEMSQueue(playerid);
- public KillEMSQueue(playerid)
- {
- DeletePVar(playerid, "Injured");
- DeletePVar(playerid, "EMSAttempt");
- SetPVarInt(playerid, "MedicBill", 1);
- DeletePVar(playerid, "MedicCall");
- DeletePVar(playerid, "EMSWarns");
- return 1;
- }
- forward MoveEMS(playerid);
- public MoveEMS(playerid)
- {
- new Float:mX, Float:mY, Float:mZ;
- GetPlayerPos(playerid, mX, mY, mZ);
- SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicX", mX);
- SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicY", mY);
- SetPVarFloat(GetPVarInt(playerid, "MovingStretcher"), "MedicZ", mZ);
- SetPVarInt(GetPVarInt(playerid, "MovingStretcher"), "MedicVW", GetPlayerVirtualWorld(playerid));
- SetPVarInt(GetPVarInt(playerid, "MovingStretcher"), "MedicInt", GetPlayerInterior(playerid));
- Streamer_UpdateEx(GetPVarInt(playerid, "MovingStretcher"), mX, mY, mZ);
- SetPlayerPos(GetPVarInt(playerid, "MovingStretcher"), mX, mY, mZ);
- SetPlayerInterior(GetPVarInt(playerid, "MovingStretcher"), GetPlayerVirtualWorld(playerid));
- SetPlayerVirtualWorld(GetPVarInt(playerid, "MovingStretcher"), GetPlayerVirtualWorld(playerid));
- ClearAnimations(GetPVarInt(playerid, "MovingStretcher"));
- ApplyAnimation(GetPVarInt(playerid, "MovingStretcher"), "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
- DeletePVar(GetPVarInt(playerid, "MovingStretcher"), "OnStretcher");
- SetPVarInt(playerid, "MovingStretcher", -1);
- }
- forward SendEMSQueue(playerid,type);
- public SendEMSQueue(playerid,type)
- {
- #if defined zombiemode
- if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie"))
- {
- KillEMSQueue(playerid);
- SpawnPlayer(playerid);
- return 1;
- }
- if(zombieevent == 1 && GetPVarType(playerid, "pZombieBit"))
- {
- KillEMSQueue(playerid);
- ClearAnimations(playerid);
- MakeZombie(playerid);
- return 1;
- }
- #endif
- switch (type)
- {
- case 1:
- {
- Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
- SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
- SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
- SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
- SetPVarInt(playerid, "EMSAttempt", -1);
- if(GetPlayerInterior(playerid) > 0) Player_StreamPrep(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"), FREEZE_TIME);
- GameTextForPlayer(playerid, "~r~BI THUONG~n~~w~/chapnhan chet hoac /dichvu capcuu", 5000, 3);
- ClearAnimations(playerid);
- ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
- SetPlayerHealth(playerid, 100);
- RemoveArmor(playerid);
- if(GetPVarInt(playerid, "usingfirstaid") == 1)
- {
- firstaidexpire(playerid);
- }
- SetPVarInt(playerid,"MedicCall",1);
- }
- case 2:
- {
- SetPVarInt(playerid,"EMSAttempt", 2);
- ClearAnimations(playerid);
- ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
- SetPlayerHealth(playerid, 100);
- RemoveArmor(playerid);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement