Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(GetPVarInt(playerid, "Injured") == 1) return 1;
- if(newkeys & KEY_SECONDARY_ATTACK)
- {
- new string[128];
- if(!GetPVarType(playerid, "Tackling")) {
- if(GetPVarInt(playerid, "TackleMode") == 1 && GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID && PlayerCuffed[GetPlayerTargetPlayer(playerid)] == 0 && ProxDetectorS(4.0, playerid, GetPlayerTargetPlayer(playerid)) && !IsPlayerNPC(GetPlayerTargetPlayer(playerid)))
- {
- if(GetPVarInt(playerid, "CopTackleCooldown") != 0)
- {
- format(string, sizeof(string), "You are exhausted! It will be %d seconds before you can tackle again.", GetPVarInt(playerid, "CopTackleCooldown"));
- return SendClientMessageEx(playerid, COLOR_GRAD2, string);
- }
- if(PlayerInfo[GetPlayerTargetPlayer(playerid)][pAdmin] >= 2 && PlayerInfo[GetPlayerTargetPlayer(playerid)][pTogReports] != 1)
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, "Admins can not be tackled!");
- return 1;
- }
- #if defined zombiemode
- if(GetPVarInt(GetPlayerTargetPlayer(playerid), "pIsZombie"))
- {
- SendClientMessageEx(playerid, COLOR_GRAD2, "Zombies can not be tackled!");
- return 1;
- }
- #endif
- if(PlayerInfo[playerid][pFitness] >= PlayerInfo[GetPlayerTargetPlayer(playerid)][pFitness]) // Player is more fit or as fit as the player they are tackling
- {
- TacklePlayer(playerid, GetPlayerTargetPlayer(playerid));
- }
- else if(PlayerInfo[playerid][pFitness] < PlayerInfo[GetPlayerTargetPlayer(playerid)][pFitness])
- {
- new tacklechance = random(10);
- switch(tacklechance)
- {
- case 0..6: //success
- {
- TacklePlayer(playerid, GetPlayerTargetPlayer(playerid));
- }
- default: // fail
- {
- format(string, sizeof(string), "** %s leaps at %s attempting to tackle them but is not able.", GetPlayerNameEx(playerid), GetPlayerNameEx(GetPlayerTargetPlayer(playerid)));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- TogglePlayerControllable(playerid, 0);
- SetTimerEx("CopGetUp", 2500, 0, "i", playerid);
- ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.0, 1, 1, 1, 1, 0, 1);
- }
- }
- }
- }
- }
- }
- if((newkeys & KEY_YES) && !(oldkeys & KEY_YES))
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
- {
- new engine,lights,alarm,doors,bonnet,boot,objective,vehicleid;
- vehicleid = GetPlayerVehicleID(playerid);
- if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510 || DynVeh[vehicleid] != -1 && DynVehicleInfo[DynVeh[vehicleid]][gv_iType] == 1 && GetVehicleModel(vehicleid) == 592) return SendClientMessageEx(playerid,COLOR_WHITE,"This command can't be used in this vehicle.");
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- if(engine == VEHICLE_PARAMS_ON)
- {
- SetVehicleEngine(vehicleid, playerid);
- new string[128];
- format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine stops.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- }
- else if((engine == VEHICLE_PARAMS_OFF || engine == VEHICLE_PARAMS_UNSET))
- {
- if (GetPVarInt(playerid, "Refueling")) return SendClientMessageEx(playerid, COLOR_WHITE, "You can't do this while refueling.");
- new string[128];
- format(string, sizeof(string), "{FF8000}** {C2A2DA}%s turns the key in the ignition and the engine starts.", GetPlayerNameEx(playerid));
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- SendClientMessageEx(playerid, COLOR_WHITE, "Vehicle engine starting, please wait...");
- SetTimerEx("SetVehicleEngine", 1000, 0, "dd", vehicleid, playerid);
- }
- }
- }
- if(newkeys & KEY_NO)
- {
- if(InsideTradeToys[playerid] == 1)
- {
- if(IsPlayerConnected(GetPVarInt(playerid, "ttSeller")))
- {
- new string[128];
- format(string, sizeof(string), "%s has declined the toy offer.", GetPlayerNameEx(playerid));
- SendClientMessageEx(GetPVarInt(playerid, "ttSeller"), COLOR_LIGHTBLUE, string);
- SendClientMessageEx(playerid, COLOR_LIGHTRED, "You have declined the toy offer.");
- SetPVarInt(GetPVarInt(playerid, "ttSeller"), "ttBuyer", INVALID_PLAYER_ID);
- SetPVarInt(GetPVarInt(playerid, "ttSeller"), "ttCost", 0);
- SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
- HideTradeToysGUI(playerid);
- return 1;
- }
- else {
- SendClientMessageEx(playerid, COLOR_LIGHTRED, "The seller has disconnected from the server, therefore you cannot proceed the trade.");
- SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
- HideTradeToysGUI(playerid);
- }
- }
- }
- if(newkeys & KEY_YES)
- {
- if(InsideTradeToys[playerid] == 1)
- {
- if(IsPlayerConnected(GetPVarInt(playerid, "ttSeller")))
- {
- ShowPlayerDialog(playerid, CONFIRMSELLTOY, DIALOG_STYLE_MSGBOX, "Please confirm your choice", "Are you sure you want to purchase this toy for the amount specified?", "Yes", "No");
- }
- else {
- SendClientMessageEx(playerid, COLOR_LIGHTRED, "The seller has disconnected from the server, therefore you cannot proceed the trade.");
- SetPVarInt(playerid, "ttSeller", INVALID_PLAYER_ID);
- HideTradeToysGUI(playerid);
- }
- }
- if(InsideTut{playerid} > 0)
- {
- TutorialStep(playerid);
- TogglePlayerControllable(playerid, false);
- return 1;
- }
- if(GetPVarType(playerid, "Tackling")) {
- CopGetUp(playerid);
- ClearTackle(GetPVarInt(playerid, "Tackling"));
- return 1;
- }
- if(GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID && ProxDetectorS(5.0, playerid, GetPlayerTargetPlayer(playerid)) && !IsPlayerNPC(GetPlayerTargetPlayer(playerid)))
- {
- if(GetPVarInt(playerid, "TackleMode") == 1) {
- return 1;
- }
- new string[64];
- new name[MAX_PLAYER_NAME+8];
- format(name, sizeof(name), "{FF0000}%s", GetPlayerNameEx(GetPlayerTargetPlayer(playerid)));
- SetPVarString(playerid, "pInteractName", name);
- SetPVarInt(playerid, "pInteractID", GetPlayerTargetPlayer(playerid));
- format(string, sizeof(string), "Pay\nGive\n");
- /*if (PlayerInfo[playerid][pJob] == 9 || PlayerInfo[playerid][pJob2] == 9)
- {
- format(string, sizeof(string), "%sSell Gun\n", string);
- }
- if(PlayerInfo[playerid][pJob] == 9 || PlayerInfo[playerid][pJob2] == 9 || PlayerInfo[playerid][pJob] == 18 || PlayerInfo[playerid][pJob2] == 18)
- {
- format(string, sizeof(string), "%sSell Mats\n", string);
- }
- if(PlayerInfo[playerid][pJob] == 4 || PlayerInfo[playerid][pJob2] == 4)
- {
- format(string, sizeof(string), "%sSell Pot\nSell Crack\n", string);
- }
- if(PlayerInfo[playerid][pJob] == 8 || PlayerInfo[playerid][pJob2] == 8)
- {
- format(string, sizeof(string), "%sGuard\n", string);
- }
- if(PlayerInfo[playerid][pJob] == 19 || PlayerInfo[playerid][pJob2] == 19)
- {
- format(string, sizeof(string), "%sSell Drink\n", string);
- }*/
- ShowPlayerDialog(playerid, INTERACTMAIN, DIALOG_STYLE_LIST, name, string, "Select", "Cancel");
- }
- }
- // If the client clicked the fire key and is currently injured
- else if((newkeys && KEY_FIRE) && GetPVarInt(playerid, "Injured") == 1)
- {
- ClearAnimations(playerid);
- return 1;
- }
- else if((newkeys & KEY_FIRE) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerWeapon(playerid) == SPEEDGUN && GetPVarType(playerid, "SpeedRadar"))
- {
- if(GetPVarInt(playerid, "RadarTimeout") == 0)
- {
- new Float:x,Float:y,Float:z;
- foreach(new i: Player)
- {
- if(IsPlayerStreamedIn(i, playerid))
- {
- GetPlayerPos(i,x,y,z);
- if(IsPlayerAimingAt(playerid,x,y,z,10))
- {
- new string[68];
- format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~b~License Plate: ~w~%d~n~~b~Speed: ~w~%.0f MPH", GetPlayerVehicleID(i), fVehSpeed[i]);
- GameTextForPlayer(playerid, string,3500, 3);
- format(string, sizeof(string), "License Plate: %d. Speed: %.0f MPH", GetPlayerVehicleID(i), fVehSpeed[i]);
- SendClientMessageEx(playerid, COLOR_GRAD4, string);
- SetPVarInt(playerid, "RadarTimeout", 1);
- SetTimerEx("RadarCooldown", 3000, 0, "i", playerid);
- return 1;
- }
- }
- }
- }
- }
- else if((newkeys & 16) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && PlayerCuffed[playerid] == 0 && PlayerInfo[playerid][pBeingSentenced] == 0 && GetPVarType(playerid,"UsingAnim") && !GetPVarType(playerid, "IsFrozen"))
- {
- ClearAnimations(playerid);
- DeletePVar(playerid,"UsingAnim");
- }
- else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER && (newkeys & KEY_FIRE))
- {
- if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
- {
- new Float: cHealth;
- GetPlayerHealth(playerid, cHealth);
- if(cHealth < 100)
- {
- SetPlayerHealth(playerid, cHealth+5);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- }
- DeletePVar(playerid, "DrinkCooledDown");
- SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
- return 1;
- }
- }
- else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE && (newkeys & KEY_FIRE))
- {
- if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
- {
- new Float: cHealth;
- GetPlayerHealth(playerid, cHealth);
- if(cHealth < 100)
- {
- SetPlayerHealth(playerid, cHealth+8);
- }
- else
- {
- SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- }
- DeletePVar(playerid, "DrinkCooledDown");
- SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
- return 1;
- }
- }
- else if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK && (newkeys & KEY_FIRE))
- {
- if(GetPVarInt(playerid, "DrinkCooledDown") == 1 && GetPVarInt(playerid, "UsingSprunk") == 1)
- {
- new Float: cHealth;
- GetPlayerHealth(playerid, cHealth);
- if(cHealth < 100)
- {
- SetPlayerHealth(playerid, cHealth+2);
- }
- else
- {
- DeletePVar(playerid, "UsingSprunk");
- SendClientMessageEx(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- }
- DeletePVar(playerid, "DrinkCooledDown");
- SetTimerEx("DrinkCooldown", 2500, 0, "i", playerid);
- return 1;
- }
- }
- else if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
- {
- if(GetPVarInt(playerid, "NGPassenger") == 1)
- {
- TogglePlayerSpectating(playerid, 0);
- }
- if(GetPVarInt(playerid, "UsingSprunk"))
- {
- DeletePVar(playerid, "UsingSprunk");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- return 1;
- }
- }
- else if(!IsPlayerInAnyVehicle(playerid) && newkeys & KEY_CTRL_BACK)
- {
- new Float:pos[3];
- GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
- if(pos[1] < -1301.4 && pos[1] > -1303.2417 && pos[0] < 1786.2131 && pos[0] > 1784.1555)
- { // He is using the elevator button
- PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
- ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
- ShowElevatorDialog(playerid, 1);
- }
- else // Is he in a floor button?
- {
- if(pos[1] > -1301.4 && pos[1] < -1299.1447 && pos[0] < 1785.6147 && pos[0] > 1781.9902)
- {
- // He is most likely using it, check floor:
- new i=20;
- while(pos[2] < GetDoorsZCoordForFloor(i) + 3.5 && i > 0)
- i --;
- if(i == 0 && pos[2] < GetDoorsZCoordForFloor(0) + 2.0)
- i = -1;
- if(i <= 19)
- {
- PlayerPlaySound(playerid, 1083, 0.0, 0.0, 0.0);
- ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0);
- CallElevator(playerid, i + 1);
- GameTextForPlayer(playerid, "~r~Elevator called", 3500, 4);
- }
- }
- }
- }
- else if(IsKeyJustDown(128, newkeys, oldkeys))
- {
- if(ConfigEventCPs[playerid][1] == 1 && ConfigEventCPs[playerid][0] == 1) {
- SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled stage 1, you can't edit the checkpoint's position.");
- ConfigEventCPs[playerid][1] = 0;
- ConfigEventCPs[playerid][0] = 0;
- ConfigEventCPs[playerid][2] = 0;
- }
- else if(ConfigEventCPs[playerid][1] == 2 && ConfigEventCPs[playerid][0] == 1) {
- TogglePlayerControllable(playerid, true);
- SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled stage 2, please choose another position. If you want to cancel stage 1(Edit CP Position) press the AIM button again.");
- ConfigEventCPs[playerid][1] = 1;
- }
- if(GetPVarInt(playerid, "CreateGT") == 1)
- {
- DeletePVar(playerid, "CreateGT");
- SendClientMessageEx(playerid, COLOR_GREY, "You have stopped creating a new gang tag.");
- }
- if(GetPVarInt(playerid, "gt_Edit") == 1)
- {
- DeletePVar(playerid, "gt_ID");
- DeletePVar(playerid, "gt_Edit");
- SendClientMessageEx(playerid, COLOR_GREY, "You have stopped editing the position.");
- }
- }
- else if (IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
- {
- if(ConfigEventCPs[playerid][1] == 1 && ConfigEventCPs[playerid][0] == 1) {
- TogglePlayerControllable(playerid, false);
- new string[92], Float: x, Float: y, Float: z;
- GetPlayerPos(playerid, x, y, z);
- format(string, sizeof(string), "Position: X = %f.3 Y = %f.3 Z = %f.3", x, y, z);
- SendClientMessageEx(playerid, COLOR_WHITE, "Are you sure this is the correct position? Please press the fire button again to confirm this, you can cancel by simply pressing the AIM button.");
- SendClientMessageEx(playerid, COLOR_YELLOW, string);
- ConfigEventCPs[playerid][1] = 2;
- }
- else if(ConfigEventCPs[playerid][1] == 2 && ConfigEventCPs[playerid][0] == 1) {
- TogglePlayerControllable(playerid, true);
- new string[298];
- GetPlayerPos(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]]);
- format(string, sizeof(string), "You have successfuly created a race checkpoint. Position: X = %f.3 Y = %f.3 Z = %f.3 - ID:%d", EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], ConfigEventCPId[playerid]);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- if(ConfigEventCPs[playerid][2] == 1)
- {
- EventRCPU[ConfigEventCPId[playerid]] = 1;
- EventRCPS[ConfigEventCPId[playerid]] = 10.0;
- if(ConfigEventCPId[playerid] == 0) {
- EventRCPT[ConfigEventCPId[playerid]] = 1;
- SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
- }
- else {
- EventRCPT[ConfigEventCPId[playerid]] = 2;
- SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
- }
- ConfigEventCPs[playerid][1] = 3;
- format(string,sizeof(string),"Race Checkpoint %d Size", ConfigEventCPId[playerid]);
- ShowPlayerDialog(playerid,RCPSIZE,DIALOG_STYLE_INPUT,string,"You are now in stage 3, which means you will need to choose the size of the checkpoint\nYou now have a preview of the checkpoint(Step outside the checkpoint so you can see it)\nNote: Checkpoint is now made with the default settings,\nyou may choose not to continue checkpoint won't be affected.","Ok","Cancel");
- }
- else
- {
- if(EventRCPT[ConfigEventCPId[playerid]] == 1) {
- SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
- }
- else if(EventRCPT[ConfigEventCPId[playerid]] == 4) {
- SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
- }
- else {
- SetPlayerCheckpoint(playerid, EventRCPX[ConfigEventCPId[playerid]], EventRCPY[ConfigEventCPId[playerid]], EventRCPZ[ConfigEventCPId[playerid]], EventRCPS[ConfigEventCPId[playerid]]);
- }
- }
- }
- if( PlayerInfo[playerid][pC4Used] == 1 )
- {
- if(GoChase[playerid] != INVALID_PLAYER_ID)
- {
- if(IsPlayerInRangeOfPoint(GoChase[playerid], 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
- {
- if(PlayerInfo[GoChase[playerid]][pHeadValue] >= 1)
- {
- if (IsAHitman(playerid))
- {
- new string[128];
- new takemoney = (PlayerInfo[GoChase[playerid]][pHeadValue] / 4) * 2;
- GivePlayerCash(playerid, takemoney);
- GivePlayerCash(GoChase[playerid], -takemoney);
- format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d",GetPlayerNameEx(playerid),GetPlayerNameEx(GoChase[playerid]),takemoney);
- SendGroupMessage(2, COLOR_YELLOW, string);
- format(string,sizeof(string),"You have been critically injured by a Hitman and lost $%d!",takemoney);
- ResetPlayerWeaponsEx(GoChase[playerid]);
- // SpawnPlayer(GoChase[playerid]);
- SendClientMessageEx(GoChase[playerid], COLOR_YELLOW, string);
- PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
- PlayerInfo[playerid][pCHits] += 1;
- SetPlayerHealth(GoChase[playerid], 0.0);
- // KillEMSQueue(GoChase[playerid]);
- GotHit[GoChase[playerid]] = 0;
- GetChased[GoChase[playerid]] = INVALID_PLAYER_ID;
- GoChase[playerid] = INVALID_PLAYER_ID;
- }
- }
- }
- }
- PlayerInfo[playerid][pC4Used] = 0;
- CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
- PickUpC4(playerid);
- SendClientMessageEx(playerid, COLOR_YELLOW, " Bomb has been detonated!");
- PlayerInfo[playerid][pC4Used] = 0;
- return 1;
- }
- if(GetPVarInt(playerid, "MovingStretcher") != -1)
- {
- KillTimer(GetPVarInt(playerid, "TickEMSMove"));
- MoveEMS(playerid);
- return 1;
- }
- if(GetPVarInt(playerid, "editingfamhq") != INVALID_FAMILY_ID)
- {
- if(GetPVarInt(playerid, "editingfamhqaction") == 1)
- {
- DeletePVar(playerid, "editingfamhqaction");
- TogglePlayerControllable(playerid, false);
- ShowPlayerDialog(playerid,HQENTRANCE,DIALOG_STYLE_MSGBOX,"Warning:","Is this the entrance you want?","Ok","Cancel");
- }
- else if(GetPVarInt(playerid, "editingfamhqaction") == 2)
- {
- DeletePVar(playerid, "editingfamhqaction");
- TogglePlayerControllable(playerid, false);
- ShowPlayerDialog(playerid,HQEXIT,DIALOG_STYLE_MSGBOX,"Warning:","Is this the exit you want?","Ok","Cancel");
- }
- else if(GetPVarInt(playerid, "editingfamhqaction") == 5)
- {
- TogglePlayerControllable(playerid, false);
- ShowPlayerDialog(playerid,HQENTRANCE,DIALOG_STYLE_MSGBOX,"Warning:","Is this the entrance you want?","Ok","Cancel");
- }
- else if(GetPVarInt(playerid, "editingfamhqaction") == 6)
- {
- TogglePlayerControllable(playerid, false);
- ShowPlayerDialog(playerid,HQEXIT,DIALOG_STYLE_MSGBOX,"Warning:","Is this the exit you want?","Ok","Cancel");
- }
- }
- if(GetPVarInt(playerid, "DraggingPlayer") != INVALID_PLAYER_ID)
- {
- new Float:dX, Float:dY, Float:dZ, string[128];
- GetPlayerPos(playerid, dX, dY, dZ);
- floatsub(dX, 0.4);
- floatsub(dY, 0.4);
- SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragX", dX);
- SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragY", dY);
- SetPVarFloat(GetPVarInt(playerid, "DraggingPlayer"), "DragZ", dZ);
- SetPVarInt(GetPVarInt(playerid, "DraggingPlayer"), "DragWorld", GetPlayerVirtualWorld(playerid));
- SetPVarInt(GetPVarInt(playerid, "DraggingPlayer"), "DragInt", GetPlayerInterior(playerid));
- Streamer_UpdateEx(GetPVarInt(playerid, "DraggingPlayer"), dX, dY, dZ);
- SetPlayerPos(GetPVarInt(playerid, "DraggingPlayer"), dX, dY, dZ);
- SetPlayerInterior(GetPVarInt(playerid, "DraggingPlayer"), GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(GetPVarInt(playerid, "DraggingPlayer"), GetPlayerVirtualWorld(playerid));
- ClearAnimations(GetPVarInt(playerid, "DraggingPlayer"));
- ApplyAnimation(GetPVarInt(playerid, "DraggingPlayer"), "ped","cower",1,1,0,0,0,0,1);
- DeletePVar(GetPVarInt(playerid, "DraggingPlayer"), "BeingDragged");
- SetPVarInt(playerid, "DraggingPlayer", INVALID_PLAYER_ID);
- format(string, sizeof(string), "* You have stopped dragging %s.", GetPlayerNameEx(GetPVarInt(playerid, "DraggingPlayer")));
- SendClientMessage(playerid, COLOR_GRAD2, string);
- }
- if(GetPVarInt(playerid, "CreateGT") == 1)
- {
- if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pGangModerator] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action.");
- new gangtag = GetFreeGangTag();
- if(gangtag == -1)
- {
- DeletePVar(playerid, "CreateGT");
- SendClientMessageEx(playerid, COLOR_GREY, "There is no free gang tag to use!");
- return 1;
- }
- new Float:pPosX, Float:pPosY, Float:pPosZ, string[128];
- GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
- GangTags[gangtag][gt_PosX] = pPosX;
- GangTags[gangtag][gt_PosY] = pPosY;
- GangTags[gangtag][gt_PosZ] = pPosZ;
- GangTags[gangtag][gt_Used] = 1;
- GangTags[gangtag][gt_VW] = GetPlayerVirtualWorld(playerid);
- GangTags[gangtag][gt_Int] = GetPlayerInterior(playerid);
- DeletePVar(playerid, "CreateGT");
- CreateGangTag(gangtag);
- format(string, sizeof(string), "Gangtag %d has been created, use /gtedit to edit and optimize the position!", gangtag);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s has created gangtag %d.", GetPlayerNameEx(playerid), gangtag);
- Log("Logs/GangTags.log", string);
- SaveGangTag(gangtag);
- }
- if(GetPVarInt(playerid, "gt_Edit") == 1)
- {
- if(PlayerInfo[playerid][pAdmin] < 4 && PlayerInfo[playerid][pGangModerator] < 1) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to perform this action.");
- new gangtag = GetPVarInt(playerid, "gt_ID");
- new Float:pPosX, Float:pPosY, Float:pPosZ, string[128];
- GetPlayerPos(playerid, pPosX, pPosY, pPosZ);
- GangTags[gangtag][gt_PosX] = pPosX;
- GangTags[gangtag][gt_PosY] = pPosY;
- GangTags[gangtag][gt_PosZ] = pPosZ;
- GangTags[gangtag][gt_VW] = GetPlayerVirtualWorld(playerid);
- GangTags[gangtag][gt_Int] = GetPlayerInterior(playerid);
- DeletePVar(playerid, "gt_ID");
- DeletePVar(playerid, "gt_Edit");
- CreateGangTag(gangtag);
- format(string, sizeof(string), "You have changed the position of gangtag %d!", gangtag);
- SendClientMessageEx(playerid, COLOR_WHITE, string);
- format(string, sizeof(string), "%s has changed the position of gangtag %d.", GetPlayerNameEx(playerid), gangtag);
- Log("Logs/GangTags.log", string);
- SaveGangTag(gangtag);
- }
- if(GetPVarType(playerid, "gt_Spraying"))
- {
- new tagid = GetPVarInt(playerid, "gt_Spray");
- GangTags[tagid][gt_TimeLeft] = 0;
- KillTimer(GangTags[tagid][gt_Timer]);
- DeletePVar(playerid, "gt_Spraying");
- DeletePVar(playerid, "gt_Spray");
- SendClientMessageEx(playerid, COLOR_WHITE, "You have stopped spraying the wall.");
- ClearAnimations(playerid);
- }
- }
- else if((newkeys & KEY_SPRINT) && GetPlayerState(playerid) == 2)// Pressing the gas, detonates the bomb.
- {
- new string[128], vehicleid = GetPlayerVehicleID(playerid);
- if(GetChased[playerid] != INVALID_PLAYER_ID && VehicleBomb{vehicleid} == 1)
- {
- if(PlayerInfo[playerid][pHeadValue] >= 1)
- {
- if (IsAHitman(GetChased[playerid]))
- {
- new Float:boomx, Float:boomy, Float:boomz;
- GetPlayerPos(playerid,boomx, boomy, boomz);
- CreateExplosion(boomx, boomy , boomz, 7, 1);
- VehicleBomb{vehicleid} = 0;
- PlacedVehicleBomb[GetChased[playerid]] = INVALID_VEHICLE_ID;
- new takemoney = (PlayerInfo[playerid][pHeadValue] / 4) * 2;
- GivePlayerCash(GetChased[playerid], takemoney);
- GivePlayerCash(playerid, -takemoney);
- format(string,sizeof(string),"Hitman %s has fulfilled the contract on %s and collected $%d.",GetPlayerNameEx(GetChased[playerid]),GetPlayerNameEx(playerid),takemoney);
- SendGroupMessage(2, COLOR_YELLOW, string);
- format(string,sizeof(string),"You have been critically injured by a hitman and lost $%d!",takemoney);
- ResetPlayerWeaponsEx(playerid);
- SendClientMessageEx(playerid, COLOR_YELLOW, string);
- PlayerInfo[playerid][pHeadValue] = 0;
- PlayerInfo[GetChased[playerid]][pCHits] += 1;
- SetPlayerHealth(playerid, 0.0);
- GoChase[GetChased[playerid]] = INVALID_PLAYER_ID;
- PlayerInfo[GetChased[playerid]][pC4Used] = 0;
- PlayerInfo[GetChased[playerid]][pC4] = 0;
- GotHit[playerid] = 0;
- GetChased[playerid] = INVALID_PLAYER_ID;
- return 1;
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement