Problem with the tutorial
#1

I'm using Horizon RP edit to learn few things in the script, Also play a bit in my home-hosted server.

The problem is that when i finish registering it doesn't move me to the tutorial, It's like freezing and not doing anything.

I tried to fix it but had issues.

May i get help?

http://prntscr.com/bpd710
Reply
#2

Well, call Tut1(playerid) to take the tutorial?
Reply
#3

Can you show tut2 ? Where do you call tut1 ?
Reply
#4

This is the codes,
When players press yes, They don't get forced into the tutorial.

forward Tut1(playerid); - It may be the code that will force you to the tutorial,
But nothing happens

Код:
forward Tut1(playerid);
public Tut1(playerid)
{
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 94375);
    TogglePlayerControllable(playerid, 0);
    SetPlayerCameraPos( playerid, 1971.0290, -1779.7288, 77.8215 );
	SetPlayerCameraLookAt( playerid, 1963.4819, -1773.1683, 74.5658 );
    SetPlayerPos(playerid,1582.0026,-1274.0721,119.7132);
	SendClientMessage(playerid, COLOR_LIME, "_____| Evolution Roleplay Tutorial |_____");
	SendClientMessage(playerid, COLOR_WHITE, "Welcome to BRP, as this is your first time here you'll have to go through our tutorial");
	SendClientMessage(playerid, COLOR_WHITE, "so you get to know important things on our server.");
	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_RED, "Please concentrate because the tutorial will have lots of information about the gameplay.");
	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "");
	//SendClientMessage(playerid, COLOR_WHITE, "This server owned by RexerCloud, this Gamemode Script credits to Zhao/Calgon (HRP)");
	//SendClientMessage(playerid, COLOR_WHITE, "but all the New Changes of the Server Scripts scripted by the Owner(AkosiRaven)");
	SendClientMessage(playerid, COLOR_WHITE, "");
	Tut[playerid] = SetTimerEx("Tut2", 4000, false, "i", playerid);
	return 1;
}
forward Tut2(playerid);
public Tut2(playerid)
{
    InterpolateCameraPos(playerid, 1513.565429, -1615.603393, 35.681640, 1513.565429, -1615.603393, 35.681640, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1517.081054, -1618.825683, 34.179183, 1517.057495, -1618.851196, 34.179183, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,1506.6499,-1675.8396,41.2007);
	SetPlayerCameraLookAt(playerid, 1554.6344,-1675.5366,16.1953);
	SetPlayerPos(playerid,1554.6344,-1675.5366,16.1953-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 1 - Factions |_____");
    SendClientMessage(playerid, COLOR_WHITE, " At Evolution Roleplay we also have law enforcement agencies such as the LSPD and FBI, who enforce");
    SendClientMessage(playerid, COLOR_WHITE, " the law. They will arrest you if you break the law. If you cause a lot of trouble then");
    SendClientMessage(playerid, COLOR_WHITE, " you could be marked as one of the most wanted suspects. Which will mark you red");
    SendClientMessage(playerid, COLOR_WHITE, " on the radar/map. If you're caught as the most wanted suspect, then you will be");
    SendClientMessage(playerid, COLOR_WHITE, " sent to prison for 30 minutes. If you can't do the time, then don't do the crime..");
    SendClientMessage(playerid, COLOR_WHITE, " You can also join these factions by applying on our website, www.evolution-roleplay.com.");
	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "");
	Tut[playerid] = SetTimerEx("Tut3", 12000, false, "i", playerid);
	return 1;
}
forward Tut3(playerid);
public Tut3(playerid)
{
    InterpolateCameraPos(playerid, 1993.177612, -1465.029296, 35.134315, 1993.177612, -1465.029296, 35.134315, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1995.919921, -1461.151611, 33.571128, 1996.122558, -1461.257812, 33.684108, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,1444.9666,-1709.8527,42.3163);
	SetPlayerCameraLookAt(playerid, 1483.7808,-1762.6996,18.7958);
	SetPlayerPos(playerid,1483.7808,-1762.6996,18.7958-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 2 - Hospitality |_____");
    SendClientMessage(playerid, COLOR_WHITE, " If you get injured then you can either /accept death or you can /service ems and wait");
    SendClientMessage(playerid, COLOR_WHITE, " for an ambulance of the LSFMD to arrive. This will allow you to keep your weapons.");
    SendClientMessage(playerid, COLOR_WHITE, " You can also join the LSFMD faction by applying on our website, www.evolution-roleplay.com");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "You can also visit one of the hospitals to /heal if you get a disease.");
//	SendClientMessage(playerid, COLOR_WHITE, "");
//	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "");
	Tut[playerid] = SetTimerEx("Tut4", 14000, false, "i", playerid);
	return 1;
}
forward Tut4(playerid);
public Tut4(playerid)
{
    InterpolateCameraPos(playerid, 2460.571289, -1653.040527, 25.918851, 2460.571289, -1653.040527, 25.918851, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 2465.023681, -1654.918701, 24.635215, 2465.023681, -1654.918701, 24.635215, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,2441.1738,-1698.3149,31.4247);
	SetPlayerCameraLookAt(playerid, 2507.3250,-1648.5522,13.8510);
	SetPlayerPos(playerid,2507.3250,-1648.5522,13.8510-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 3 - Gangs |_____");
    SendClientMessage(playerid, COLOR_WHITE, "(There are 10 gang slots in BRP)");
    SendClientMessage(playerid, COLOR_WHITE, "There are also /gangs which are basically criminal groups.");
    SendClientMessage(playerid, COLOR_WHITE, "We recommend that you're careful around them as they are meant to be dangerous.");
    SendClientMessage(playerid, COLOR_WHITE, "They also fight over several territories known as /points.");
    SendClientMessage(playerid, COLOR_WHITE, "You can join a gang by approaching them in-game. They can usually be found at their");
	SendClientMessage(playerid, COLOR_WHITE, "respective headquarters (fronts).");
	SendClientMessage(playerid, COLOR_WHITE, "");
	Tut[playerid] = SetTimerEx("Tut5", 14000, false, "i", playerid);
	return 1;
}
forward Tut5(playerid);
public Tut5(playerid)
{
    InterpolateCameraPos(playerid, 1946.401245, -1791.976074, 13.903589, 1946.401245, -1791.976074, 13.903589, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid,1943.074707, -1788.254150, 13.617287, 1943.074707, -1788.254150, 13.617287, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,1733.3695,2300.4736,28.1169);
	SetPlayerCameraLookAt(playerid, 1677.3669,2340.1497,9.8972);
	SetPlayerPos(playerid,1677.3669,2340.1497,9.8972-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 4 - Businesses |_____");
    SendClientMessage(playerid, COLOR_WHITE, "BRP has 4 different types of businesses.");
    SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "24/7 Market: Sells general things any player would need like Phones, Portable Radios, Vehicle Locks, etc.");
    SendClientMessage(playerid, COLOR_WHITE, "Clothes Shop: This is where you can change your skin, buy toys and more");
    SendClientMessage(playerid, COLOR_WHITE, "Ammunation: This shop you can buy weapons and armor for your protection");
	SendClientMessage(playerid, COLOR_WHITE, "Restaurant: You can get meals to recover health from Restaurant");
	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "To purchase items from a business use /buy.");
	Tut[playerid] = SetTimerEx("Tut6", 15000, false, "i", playerid);
	return 1;
}
forward Tut6(playerid);
public Tut6(playerid)
{
    InterpolateCameraPos(playerid, 2240.916503, -2635.225341, 25.850421, 2240.916503, -2635.225341, 25.850421, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 2237.417236, -2638.461425, 24.339271, 2237.417236, -2638.461425, 24.339271, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,979.7817,-1468.0079,41.3712);
	SetPlayerCameraLookAt(playerid, 1030.9037,-1441.5906,13.5546);
	SetPlayerPos(playerid,1030.9037,-1441.5906,13.5546-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 5 - Jobs |_____");
    SendClientMessage(playerid, COLOR_WHITE, "Here at BRP we have 12 different types of jobs.");
    SendClientMessage(playerid, COLOR_WHITE, "Each job has 5 different levels, every time you level up in a job it allows you to access more features.");
    SendClientMessage(playerid, COLOR_WHITE, "We recommend you try the drug smuggling job to earn some money, beware it is illegal and you may get busted by the Law Enforcement.");
    SendClientMessage(playerid, COLOR_WHITE, "To locate a job use /findjob.");
   	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "For more information regarding jobs please use /jobhelp.");
	SendClientMessage(playerid, COLOR_WHITE, "");
	Tut[playerid] = SetTimerEx("Tut7", 12000, false, "i", playerid);
	return 1;
}
forward Tut7(playerid);
public Tut7(playerid)
{
    InterpolateCameraPos(playerid, 513.857971, -1287.690795, 27.234487, 513.857971, -1287.690795, 27.234487, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 518.505981, -1286.368652, 25.950845, 518.505981, -1286.368652, 25.950845, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,1111.8488,-1202.7986,52.5143);
	SetPlayerCameraLookAt(playerid, 1153.9945,-1180.8960,32.8187);
	SetPlayerPos(playerid,1153.9945,-1180.8960,32.8187-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 6 - Car Dealership |_____");
    SendClientMessage(playerid, COLOR_WHITE, "This is a car dealership. There are several throughout the city where you can purchase");
	SendClientMessage(playerid, COLOR_WHITE, "your own personal vehicle. You can own up to 5 vehicles as a regular player");
	SendClientMessage(playerid, COLOR_WHITE, "and have one spawned at a time. The modifications on a personal vehicles will automatically be save.");
	SendClientMessage(playerid, COLOR_WHITE, "You may also purchase a car lock at any 24/7.");
	SendClientMessage(playerid, COLOR_WHITE, "For more information regarding the vehicle system please use /carhelp.");
 	SendClientMessage(playerid, COLOR_WHITE, "");
	SendClientMessage(playerid, COLOR_WHITE, "");
 	SendClientMessage(playerid, COLOR_WHITE, "");
	Tut[playerid] = SetTimerEx("Tut8", 12000, false, "i", playerid);
	return 1;
}
forward Tut8(playerid);
public Tut8(playerid)
{
    InterpolateCameraPos(playerid, 1646.381225, -1675.224243, 27.237483, 1646.381225, -1675.224243, 27.237483, 3000, CAMERA_MOVE);
    InterpolateCameraLookAt(playerid, 1648.188720, -1670.727783, 26.006774, 1648.188720, -1670.727783, 26.006774, 3000, CAMERA_MOVE);
	SetPlayerCameraPos(playerid,1111.8488,-1202.7986,52.5143);
	SetPlayerCameraLookAt(playerid, 1153.9945,-1180.8960,32.8187);
	SetPlayerPos(playerid,1153.9945,-1180.8960,32.8187-3);
    SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 8 - Donator VIP |_____");
    SendClientMessage(playerid, COLOR_WHITE, "Here at Evolution Roleplay, we have a very unique donator system,");
	SendClientMessage(playerid, COLOR_WHITE, "It consists of 3 different donator levels, Daisy, Rose and Ivy.");
	SendClientMessage(playerid, COLOR_WHITE, "Donators have access to special perks which normal people do not.");
	SendClientMessage(playerid, COLOR_WHITE, "These special perks are known to be very usefull, such as crafting a combat shotgun or even spawning up to 5 cars at once!");
	SendClientMessage(playerid, COLOR_WHITE, "We usaully give these perks in exchange of a price (server donations, contribution, and winning events)");
	SendClientMessage(playerid, COLOR_WHITE, "");
    SendClientMessage(playerid, COLOR_WHITE, "That is the end of tutorial, Thank you for taking your time and watching this.");
	Tut[playerid] = SetTimerEx("TutFinal", 11000, false, "i", playerid);
	return 1;
}
forward TutFinal(playerid);
public TutFinal(playerid)
{
    /*SendClientMessage(playerid, COLOR_LIME, "_____| Tutorial: Part 9 - The End |_____");
    SendClientMessage(playerid, COLOR_WHITE, "That was the end of our tutorial, If you have questions about anything feel free to");
	SendClientMessage(playerid, COLOR_WHITE, "ask over /newb chat,If you need an admininstrator help kindly use /report");
	SendClientMessage(playerid, COLOR_WHITE, "*Note* Never abuse /report or /newb this will lead you to ban");
	SendClientMessage(playerid, COLOR_WHITE, "");*/
	new string[128];
	format(string, sizeof(string), "Welcome to Evolution Roleplay, %s.", GetPlayerNameEx(playerid));
	SendClientMessage(playerid, COLOR_NEWS, string);

	//format(string, sizeof(string), "You haven been wired $10,000 in your bank account by the state as you are new.");
	//SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

	format(string, sizeof(string), "~w~Welcome~n~~y~%s", GetPlayerNameEx(playerid));
	GameTextForPlayer(playerid, string, 5000, 1);

	new motdstring[128];
format(motdstring, sizeof(motdstring), "> {33CCFF}News: %s", GlobalMOTD);
	SendClientMessage(playerid, COLOR_YELLOW, motdstring);

	format(string, sizeof(string), "> {33CCFF} %s has just spawned on Evolution Roleplay for the first time!", GetPlayerNameEx(playerid));
	foreach(Player, i)
	{
	    if(PlayerInfo[i][pAdmin] >= 1 || PlayerInfo[i][pHelper] >= 1)
	    {
			SendClientMessageEx(i, COLOR_YELLOW, string);
		}
	}
	DeletePVar(playerid, "IsFrozen");
	SetPlayerInterior(playerid, 0);
	SetPlayerVirtualWorld(playerid, 0);
	SetPlayerPos(playerid, 1773.459350, -1942.273437, 13.569922);
	SetPlayerFacingAngle(playerid, 329.64);
	SetCameraBehindPlayer(playerid);
	InsideTut[playerid] = 0;
	DeletePVar(playerid, "MedicBill");
	SetPlayerColor(playerid,TEAM_HIT_COLOR);
	PlayerInfo[playerid][pTut] = 1;
	PlayerInfo[playerid][pLevel] = 1;
	PlayerInfo[playerid][pBank] = 10000;
	GivePlayerCash(playerid, 250);
	if(PlayerInfo[playerid][pSex] == 1) {
 		PlayerInfo[playerid][pSkin] = 299;
	} else {
   	PlayerInfo[playerid][pSkin] = 192;
    }
	SetPlayerSkin(playerid, 299);
	Refund(playerid);

	TogglePlayerControllable(playerid, true);
	return 1;
}
Here's the code of the buttons (YES/NO)

Код:
    ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{00FF00}Evolution Roleplay - Registration", "{FFFFFF}What is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
	    }
  	    else
  	    {
			//HideMainMenuGUI(playerid);
			//TogglePlayerControllable(playerid, true);
			//SetPVarInt(playerid, "IsFrozen", 1);

			//SetTimerEx("Tut1", 1000, false, "i", playerid);
			ShowPlayerDialogEx(playerid, WATCHTUT, DIALOG_STYLE_MSGBOX, "{00FF00}Evolution Roleplay - Tutorial", "Would you like to watch a small tutorial about the server basics?", "Yes", "No");
		}
	}
	else if(dialogid == REGISTRATION_MENU_FOUR)
  	{
        if(response) {
            if(IsNumeric(inputtext)) {
                ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{00FF00}Evolution Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: The entry can't be a number.\n\nWhat is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
                return 1;
            }
            for(new i = 0; i < strlen(inputtext); i++) {
                if(inputtext[i] == ' ') {
                    ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{00FF00}Evolution Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: Please use the '_'(underscore) instead of the ' '(space)\n\nWhat is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
                    return 1;
                }
            }
            if(strfind(inputtext, "_", true) == -1) {
                ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{00FF00}Evolution Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: Please choose a name in the correct format: Firstname_Lastname.\n\nWhat is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
                return 1;
            }
            if(strlen(inputtext) > 20) {
                ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{00FF00}Evolution Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: You can't select a name that's above 20 characters.\n\nWhat is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
                return 1;
            }
            if(!doesAccountExist(inputtext)) {
                ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{00FF00}Evolution Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: There is no player registered by that name.\n\nWhat is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
                return 1;
            }

            format(PlayerInfo[playerid][pReferredBy], MAX_PLAYER_NAME, "%s", inputtext);

            format(string, sizeof(string), "{FFFFFF}Are you sure you were referred by %s?", inputtext);
            ShowPlayerDialogEx(playerid, REGISTRATION_MENU_FIVE, DIALOG_STYLE_MSGBOX, "{00FF00}Evolution Roleplay - Registration", string, "Yes", "No");
        }
        else
        {
            strcpy(PlayerInfo[playerid][pReferredBy], "0", 32);
			//HideMainMenuGUI(playerid);
            //SetPVarInt(playerid, "IsFrozen", 1);
			//SetTimerEx("Tut1", 1000, false, "i", playerid);
			ShowPlayerDialogEx(playerid, WATCHTUT, DIALOG_STYLE_MSGBOX, "{00FF00}Evolution Roleplay - Tutorial", "Would you like to watch a small tutorial about the server basics?", "Yes", "No");
        }
  	}
  	else if(dialogid == REGISTRATION_MENU_FIVE)
  	{
   		if(response)
	    {
  			//HideMainMenuGUI(playerid);
            //SetPVarInt(playerid, "IsFrozen", 1);
			//SetTimerEx("Tut1", 1000, false, "i", playerid);
			ShowPlayerDialogEx(playerid, WATCHTUT, DIALOG_STYLE_MSGBOX, "{00FF00}Evolution Roleplay - Tutorial", "Would you like to watch a small tutorial about the server basics?", "Yes", "No");

	    }
I will appreciate any help.
Reply
#5

Show the code of
Код:
OnPlayerKeyStateChange
Reply
#6

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    if(IsPlayerNPC(playerid))
		return 1;

	if((newkeys & KEY_FIRE) && GetPVarInt(playerid, "SpeedRadar") == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
	{
	    if(GetPVarInt(playerid, "RadarTimeout") == 0)
	    {
			if(GetPlayerWeapon(playerid) == 43)
			{
			    new Float:x,Float:y,Float:z;
				foreach(Player, i)
				{
				    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]);
							SendClientMessage(playerid, COLOR_GRAD4, string);
							SetPVarInt(playerid, "RadarTimeout", 1);
							SetTimerEx("RadarCooldown", 3000, 0, "i", playerid);
							return 1;
						}
					}
			    }
			}
		}
	}
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER && (newkeys & KEY_FIRE))
	{
	    if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
	    {
			new Float: cHealth;
			GetPlayerHealth(playerid, cHealth);
		    if((cHealth + 5) >= 100) {
				SetPlayerHealth(playerid, 100);
		        SendClientMessage(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
		        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
		    }
		    else if(cHealth <= 95) {
                SetPlayerHealth(playerid, cHealth+5);
			}
		    else {
		        SendClientMessage(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;
		}
	}
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE && (newkeys & KEY_FIRE))
	{
	    if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
	    {
			new Float: cHealth;
			GetPlayerHealth(playerid, cHealth);
		    if((cHealth + 8) >= 100) {
				SetPlayerHealth(playerid, 100);
		        SendClientMessage(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
		        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
		    } else if(cHealth <= 92) {
				SetPlayerHealth(playerid, cHealth+8);
		    } else {
		        SendClientMessage(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;
		}
	}

	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK && (newkeys & KEY_FIRE))
	{
	    if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
	    {
			new Float: cHealth;
			GetPlayerHealth(playerid, cHealth);
			if((cHealth + 2) >= 100) {
				SetPlayerHealth(playerid, 100);
		        SendClientMessage(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
		        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
		    } else if(cHealth <= 98) {
				SetPlayerHealth(playerid, cHealth+2);
		    } else {
		        SendClientMessage(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;
		}
	}
	if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
	{
		if(GetPVarInt(playerid, "UsingSprunk"))
		{
			DeletePVar(playerid, "UsingSprunk");
			SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
			return 1;
		}
	}
	if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
 	{
  		/*if(PlayerInfo[playerid][pC4Used] == 1)
 	    {
			if(GoChase[playerid] < 999)
			{
			    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(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
						{
							new
								string[128],
								name2[MAX_PLAYER_NAME],
								name[MAX_PLAYER_NAME];

							new takemoney = PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2;
							name = GetPlayerNameEx(GoChase[playerid]);
							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]),PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2);
							SendFamilyMessage(4, 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]);
							SendClientMessage(GoChase[playerid], COLOR_YELLOW, string);

							foreach(Player, i) {
				    			name2 = GetPlayerNameEx(i);
			    				if(!strcmp(PlayerInfo[GoChase[playerid]][pContractBy], name2, true)) {
    								if(!IsPlayerStreamedIn(i, GoChase[playerid])) {
     									format(string, sizeof(string), "SMS: The deed (on %s) has been done, Sender: MOLE (555)", name);
										SendClientMessage(i, COLOR_YELLOW, string);
									}
				    			}
							}

							PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
							strcpy(PlayerInfo[GoChase[playerid]][pContractBy], "Nobody", 64);
							strcpy(PlayerInfo[GoChase[playerid]][pContractDetail], "None", 64);
							PlayerInfo[playerid][pCHits] += 1;
							SetPlayerHealth(GoChase[playerid], 0.0);
							// KillEMSQueue(GoChase[playerid]);
							GotHit[GoChase[playerid]] = 0;
							GetChased[GoChase[playerid]] = 999;
							GoChase[playerid] = 999;
						}
					}
			    }
			}
 	        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);
			SendClientMessage(playerid, COLOR_YELLOW, "Bomb has been detonated!");
			PlayerInfo[playerid][pC4Used] = 0;
			return 1;
 	    }*/
 	    if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
 	    {
 	        if(BombStage[playerid] == 2)
 	        {
   				CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
 	        	foreach(Player, i)
 	        	{
		    		if(IsPlayerInRangeOfPoint(i, 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
		    		{
						SetPlayerHealth(i, 0.0);
					}
				}
 				BombStage[playerid] = 0;
				PickUpC4(playerid);
   				RemovePlayerWeapon(playerid, 40);
				SendClientMessage(playerid, COLOR_YELLOW, "Bomb has been detonated!");
				return 1;
			}
		 }
 	    if(GetPVarInt(playerid, "MovingStretcher") != -1)
 	    {
 	        KillTimer(GetPVarInt(playerid, "TickEMSMove"));
		    MoveEMS(playerid);
			return 1;
 	    }
		if(GetPVarInt(playerid, "editingcdvehpos"))
		{
			TogglePlayerControllable(playerid, false);
		    ShowPlayerDialogEx(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:","Is this the new position you want?","Ok","Cancel");
		}
		if(GetPVarInt(playerid, "editingcdvehnew"))
		{
            TogglePlayerControllable(playerid, false);
	        ShowPlayerDialogEx(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:","Is this the new position you want?","Ok","Cancel");
		}

		new Float:health;
 		GetPlayerHealth(playerid, health);
		if(GetPVarInt(playerid, "UsingSprunk"))
		{
		    new hpint = floatround(health, floatround_round);
		    if(hpint >= 100)
			{
  				SendClientMessage(playerid, COLOR_GREY, " You already have full health.");
	 			return 1;
	   		}
	   		else
	   		{
				GetPlayerHealth(playerid, health);
				SetPlayerHealth(playerid, health+1.0);
			}
		}
	}
    if(IsKeyJustDown(KEY_YES, newkeys, oldkeys)) {
        if(GetPVarInt(playerid, "PBM") > 0) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
            return 1;
        }
        if(PlayerCuffed[playerid] >= 1) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
            return 1;
        }
        if(PlayerInfo[playerid][pJailed] > 0) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
            return 1;
        }

        new string[128];
        for(new i = 0; i < sizeof(DDoorsInfo); i++) {
            if(IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddExteriorX], DDoorsInfo[i][ddExteriorY], DDoorsInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddExteriorVW]) {
                if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonator] < DDoorsInfo[i][ddVIP]) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, you're not a high enough Donator level.");
                    return 1;
                }

                if(DDoorsInfo[i][ddGang] > 0) {
                    if(PlayerInfo[playerid][pGang] != DDoorsInfo[i][ddGang]) {
                        SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, this door is gang restricted.");
                        return 1;
                    }
                }

                if(DDoorsInfo[i][ddFaction] > 0)
				{
    				if(PlayerInfo[playerid][pFaction] != DDoorsInfo[i][ddFaction] && !IsGovAgent(playerid))
        			{
           				SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, this door is faction restricted.");
           				return 1;
       				}
                }

                if(DDoorsInfo[i][ddAdmin] > 0 && PlayerInfo[playerid][pAdmin] < DDoorsInfo[i][ddAdmin])
				{
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, you're not a high enough admin level.");
                    return 1;
                }

                if(DDoorsInfo[i][ddWanted] > 0 && PlayerInfo[playerid][pWantedLevel] != 0) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, this door restricts those with wanted levels.");
                    return 1;
                }

                if(DDoorsInfo[i][ddLocked] == 1) {
                    return SendClientMessage(playerid, COLOR_GRAD2, "This door is currently locked.");
                }

                format(string, sizeof(string), "* %s has entered %s.", GetPlayerNameEx(playerid), DDoorsInfo[i][ddDescription]);
                ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

                SetPlayerInterior(playerid,DDoorsInfo[i][ddInteriorInt]);
                PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddInteriorInt];
                PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddInteriorVW];
                SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddInteriorVW]);
                if(DDoorsInfo[i][ddCustomInterior]) {
                    TogglePlayerControllable(playerid, 0);
                    for(new o = 0; o < 6; o++) {
                        TextDrawShowForPlayer(playerid, ObjectsLoadingTD[o]);
                    }
                    SetPVarInt(playerid, "LoadingObjects", 1);
                    SetTimerEx("SafeLoadObjects", 3000, 0, "d", playerid);
                }
                if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
                    SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
                    SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorA]);
                    SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorVW]);
                    LinkVehicleToInterior(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorInt]);
                }
                else {
                    SetPlayerPos(playerid,DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
                    SetPlayerFacingAngle(playerid,DDoorsInfo[i][ddInteriorA]);
                    SetCameraBehindPlayer(playerid);
                }
				/*foreach(Player, x)
				{
                	if(IsABoomboxNearby(DDoorsInfo[i][ddInteriorX] ,DDoorsInfo[i][ddInteriorY], DDoorsInfo[i][ddInteriorZ], x) < 150.0 && DDoorsInfo[i][ddInteriorVW] == BoomboxInfo[x][bbVW] && DDoorsInfo[i][ddInteriorInt] == BoomboxInfo[x][bbInt])
					{
						PlayAudioStreamForPlayer(playerid, VehicleRadioListing[BoomboxInfo[x][bbStation]-1][radiourl], BoomboxInfo[x][bbPosX], BoomboxInfo[x][bbPosY], BoomboxInfo[x][bbPosZ], 50.0, 1);
					}
				}*/
                return Streamer_UpdateEx(playerid, DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
            }
        }
    	for(new i = 0; i < sizeof(HouseInfo); i++)
		{
        	if(IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]))
			{
            	if(PlayerInfo[playerid][pHouse] == i || PlayerInfo[playerid][pHouse2] == i || HouseInfo[i][hLock] == 0 || PlayerInfo[playerid][pRenting] == i)
				{
			    	if(PlayerInfo[playerid][pHouse] == i || PlayerInfo[playerid][pHouse2] == i)
			    	{
			        	if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered their house."); }
			    	    else { format(string, sizeof(string), "* %s has entered their house.", GetPlayerNameEx(playerid)); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			    	}
			    	else
			    	{
       					if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger has entered %s's house.", HouseInfo[i][hOwner]); }
						else { format(string, sizeof(string), "* %s has entered %s's house.", GetPlayerNameEx(playerid), HouseInfo[i][hOwner]); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}

                	SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
                	PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
                	PlayerInfo[playerid][pVW] = i+6000;
					SetPlayerVirtualWorld(playerid, i+6000);
                	if(HouseInfo[i][hCustomInterior] == 1)
					{
                	    LoadObjectsForPlayer(playerid);
                	}
                	SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                	SetPlayerFacingAngle(playerid,HouseInfo[i][hInteriorA]);
                	SetCameraBehindPlayer(playerid);
                	if(PlayerInfo[playerid][pHouse] == i || PlayerInfo[playerid][pHouse2] == i)
                	{
                		GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
					}
					Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
            	}
            	else
				{
                	GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
            	}
   				return 1;
	  		}
    	}
    	for(new i=1; i<MAX_BUSINESS; i++)
		{
			if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[i][bX], BizInfo[i][bY], BizInfo[i][bZ]))
			{
            	if(PlayerInfo[playerid][pBusiness1] == i || BizInfo[i][bStatus] >= 0)
				{
					GivePlayerCash(playerid, - BizInfo[i][bBizFee]);
 					BizInfo[i][bMoney] += BizInfo[i][bBizFee];
	    			if(PlayerInfo[playerid][pBusiness1] == i)
		    		{
			        	if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered their business."); }
			        	else { format(string, sizeof(string), "* %s has entered their business.", GetPlayerNameEx(playerid)); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	    			}
			    	else
			    	{
       					if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered %s's business.", BizInfo[i][bOwner]); }
			        	else { format(string, sizeof(string), "* %s has entered the business.", GetPlayerNameEx(playerid), BizInfo[i][bOwner]); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
    				SetPlayerInterior(playerid,BizInfo[i][bBInteriorWorld]);
       				PlayerInfo[playerid][pInt] = BizInfo[i][bBInteriorWorld];
          			PlayerInfo[playerid][pVW] = i+100;
            		SetPlayerVirtualWorld(playerid, i+100);
            		PlayerInfo[playerid][InBusiness] = i;
   					if(BizInfo[i][bCustomInterior] == 1)
					{
	                   	LoadObjectsForPlayer(playerid);
    				}
       				SetPlayerPos(playerid,BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
          			SetPlayerFacingAngle(playerid,BizInfo[i][bInteriorA]);
          			SetCameraBehindPlayer(playerid);
	               	if(PlayerInfo[playerid][pBusiness1] == i)
            		{
                		GameTextForPlayer(playerid, "~w~Welcome to your business!", 5000, 1);
		 			}
			 		if(BizInfo[i][bType] > 2 && BizInfo[i][bType] != 5)
					{
	   					SendClientMessage(playerid,COLOR_WHITE,"   Use /buy to purchase something from this business !");
					}
					Streamer_UpdateEx(playerid, BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
            	}
Reply
#7

Changes i made are in this line
Код:
if(IsKeyJustDown(KEY_YES, newkeys, oldkeys))
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
    if(IsPlayerNPC(playerid))
		return 1;

	if((newkeys & KEY_FIRE) && GetPVarInt(playerid, "SpeedRadar") == 1 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
	{
	    if(GetPVarInt(playerid, "RadarTimeout") == 0)
	    {
			if(GetPlayerWeapon(playerid) == 43)
			{
			    new Float:x,Float:y,Float:z;
				foreach(Player, i)
				{
				    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]);
							SendClientMessage(playerid, COLOR_GRAD4, string);
							SetPVarInt(playerid, "RadarTimeout", 1);
							SetTimerEx("RadarCooldown", 3000, 0, "i", playerid);
							return 1;
						}
					}
			    }
			}
		}
	}
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_BEER && (newkeys & KEY_FIRE))
	{
	    if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
	    {
			new Float: cHealth;
			GetPlayerHealth(playerid, cHealth);
		    if((cHealth + 5) >= 100) {
				SetPlayerHealth(playerid, 100);
		        SendClientMessage(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
		        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
		    }
		    else if(cHealth <= 95) {
                SetPlayerHealth(playerid, cHealth+5);
			}
		    else {
		        SendClientMessage(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;
		}
	}
	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_WINE && (newkeys & KEY_FIRE))
	{
	    if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
	    {
			new Float: cHealth;
			GetPlayerHealth(playerid, cHealth);
		    if((cHealth + 8) >= 100) {
				SetPlayerHealth(playerid, 100);
		        SendClientMessage(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
		        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
		    } else if(cHealth <= 92) {
				SetPlayerHealth(playerid, cHealth+8);
		    } else {
		        SendClientMessage(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;
		}
	}

	if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DRINK_SPRUNK && (newkeys & KEY_FIRE))
	{
	    if(GetPVarInt(playerid, "DrinkCooledDown") == 1)
	    {
			new Float: cHealth;
			GetPlayerHealth(playerid, cHealth);
			if((cHealth + 2) >= 100) {
				SetPlayerHealth(playerid, 100);
		        SendClientMessage(playerid, COLOR_GREY, "* You finish up the drink and throw it away.");
		        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
		    } else if(cHealth <= 98) {
				SetPlayerHealth(playerid, cHealth+2);
		    } else {
		        SendClientMessage(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;
		}
	}
	if(IsKeyJustDown(KEY_SECONDARY_ATTACK, newkeys, oldkeys))
	{
		if(GetPVarInt(playerid, "UsingSprunk"))
		{
			DeletePVar(playerid, "UsingSprunk");
			SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
			return 1;
		}
	}
	if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
 	{
  		/*if(PlayerInfo[playerid][pC4Used] == 1)
 	    {
			if(GoChase[playerid] < 999)
			{
			    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(PlayerInfo[playerid][pFaction] == 4 || PlayerInfo[playerid][pLeader] == 4)
						{
							new
								string[128],
								name2[MAX_PLAYER_NAME],
								name[MAX_PLAYER_NAME];

							new takemoney = PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2;
							name = GetPlayerNameEx(GoChase[playerid]);
							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]),PlayerInfo[GoChase[playerid]][pHeadValue] / 4 * 2);
							SendFamilyMessage(4, 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]);
							SendClientMessage(GoChase[playerid], COLOR_YELLOW, string);

							foreach(Player, i) {
				    			name2 = GetPlayerNameEx(i);
			    				if(!strcmp(PlayerInfo[GoChase[playerid]][pContractBy], name2, true)) {
    								if(!IsPlayerStreamedIn(i, GoChase[playerid])) {
     									format(string, sizeof(string), "SMS: The deed (on %s) has been done, Sender: MOLE (555)", name);
										SendClientMessage(i, COLOR_YELLOW, string);
									}
				    			}
							}

							PlayerInfo[GoChase[playerid]][pHeadValue] = 0;
							strcpy(PlayerInfo[GoChase[playerid]][pContractBy], "Nobody", 64);
							strcpy(PlayerInfo[GoChase[playerid]][pContractDetail], "None", 64);
							PlayerInfo[playerid][pCHits] += 1;
							SetPlayerHealth(GoChase[playerid], 0.0);
							// KillEMSQueue(GoChase[playerid]);
							GotHit[GoChase[playerid]] = 0;
							GetChased[GoChase[playerid]] = 999;
							GoChase[playerid] = 999;
						}
					}
			    }
			}
 	        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);
			SendClientMessage(playerid, COLOR_YELLOW, "Bomb has been detonated!");
			PlayerInfo[playerid][pC4Used] = 0;
			return 1;
 	    }*/
 	    if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
 	    {
 	        if(BombStage[playerid] == 2)
 	        {
   				CreateExplosion(GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z"), 7, 8);
 	        	foreach(Player, i)
 	        	{
		    		if(IsPlayerInRangeOfPoint(i, 12.0, GetPVarFloat(playerid, "DYN_C4_FLOAT_X"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Y"), GetPVarFloat(playerid, "DYN_C4_FLOAT_Z")))
		    		{
						SetPlayerHealth(i, 0.0);
					}
				}
 				BombStage[playerid] = 0;
				PickUpC4(playerid);
   				RemovePlayerWeapon(playerid, 40);
				SendClientMessage(playerid, COLOR_YELLOW, "Bomb has been detonated!");
				return 1;
			}
		 }
 	    if(GetPVarInt(playerid, "MovingStretcher") != -1)
 	    {
 	        KillTimer(GetPVarInt(playerid, "TickEMSMove"));
		    MoveEMS(playerid);
			return 1;
 	    }
		if(GetPVarInt(playerid, "editingcdvehpos"))
		{
			TogglePlayerControllable(playerid, false);
		    ShowPlayerDialogEx(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:","Is this the new position you want?","Ok","Cancel");
		}
		if(GetPVarInt(playerid, "editingcdvehnew"))
		{
            TogglePlayerControllable(playerid, false);
	        ShowPlayerDialogEx(playerid,DIALOG_CDEDITPARK,DIALOG_STYLE_MSGBOX,"Warning:","Is this the new position you want?","Ok","Cancel");
		}

		new Float:health;
 		GetPlayerHealth(playerid, health);
		if(GetPVarInt(playerid, "UsingSprunk"))
		{
		    new hpint = floatround(health, floatround_round);
		    if(hpint >= 100)
			{
  				SendClientMessage(playerid, COLOR_GREY, " You already have full health.");
	 			return 1;
	   		}
	   		else
	   		{
				GetPlayerHealth(playerid, health);
				SetPlayerHealth(playerid, health+1.0);
			}
		}
	}
    if(IsKeyJustDown(KEY_YES, newkeys, oldkeys)) {
//*************************************This line
            ShowPlayerDialogEx(playerid, WATCHTUT, DIALOG_STYLE_MSGBOX, "{00FF00}Evolution Roleplay - Tutorial", "Would you like to watch a small tutorial about the server basics?", "Yes", "No");
//please add a check something link that
/*        if(JustRegistered[playerid] == true)
{
            ShowPlayerDialogEx(playerid, WATCHTUT, DIALOG_STYLE_MSGBOX, "{00FF00}Evolution Roleplay - Tutorial", "Would you like to watch a small tutorial about the server basics?", "Yes", "No");
}
*/
//*************************************This line
        if(GetPVarInt(playerid, "PBM") > 0) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this while being in a arena!");
            return 1;
        }
        if(PlayerCuffed[playerid] >= 1) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
            return 1;
        }
        if(PlayerInfo[playerid][pJailed] > 0) {
            SendClientMessage(playerid, COLOR_WHITE, "You can't do this right now.");
            return 1;
        }

        new string[128];
        for(new i = 0; i < sizeof(DDoorsInfo); i++) {
            if(IsPlayerInRangeOfPoint(playerid,3.0,DDoorsInfo[i][ddExteriorX], DDoorsInfo[i][ddExteriorY], DDoorsInfo[i][ddExteriorZ]) && PlayerInfo[playerid][pVW] == DDoorsInfo[i][ddExteriorVW]) {
                if(DDoorsInfo[i][ddVIP] > 0 && PlayerInfo[playerid][pDonator] < DDoorsInfo[i][ddVIP]) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, you're not a high enough Donator level.");
                    return 1;
                }

                if(DDoorsInfo[i][ddGang] > 0) {
                    if(PlayerInfo[playerid][pGang] != DDoorsInfo[i][ddGang]) {
                        SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, this door is gang restricted.");
                        return 1;
                    }
                }

                if(DDoorsInfo[i][ddFaction] > 0)
				{
    				if(PlayerInfo[playerid][pFaction] != DDoorsInfo[i][ddFaction] && !IsGovAgent(playerid))
        			{
           				SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, this door is faction restricted.");
           				return 1;
       				}
                }

                if(DDoorsInfo[i][ddAdmin] > 0 && PlayerInfo[playerid][pAdmin] < DDoorsInfo[i][ddAdmin])
				{
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, you're not a high enough admin level.");
                    return 1;
                }

                if(DDoorsInfo[i][ddWanted] > 0 && PlayerInfo[playerid][pWantedLevel] != 0) {
                    SendClientMessage(playerid, COLOR_GRAD2, "You can't enter, this door restricts those with wanted levels.");
                    return 1;
                }

                if(DDoorsInfo[i][ddLocked] == 1) {
                    return SendClientMessage(playerid, COLOR_GRAD2, "This door is currently locked.");
                }

                format(string, sizeof(string), "* %s has entered %s.", GetPlayerNameEx(playerid), DDoorsInfo[i][ddDescription]);
                ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);

                SetPlayerInterior(playerid,DDoorsInfo[i][ddInteriorInt]);
                PlayerInfo[playerid][pInt] = DDoorsInfo[i][ddInteriorInt];
                PlayerInfo[playerid][pVW] = DDoorsInfo[i][ddInteriorVW];
                SetPlayerVirtualWorld(playerid, DDoorsInfo[i][ddInteriorVW]);
                if(DDoorsInfo[i][ddCustomInterior]) {
                    TogglePlayerControllable(playerid, 0);
                    for(new o = 0; o < 6; o++) {
                        TextDrawShowForPlayer(playerid, ObjectsLoadingTD[o]);
                    }
                    SetPVarInt(playerid, "LoadingObjects", 1);
                    SetTimerEx("SafeLoadObjects", 3000, 0, "d", playerid);
                }
                if(DDoorsInfo[i][ddVehicleAble] > 0 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {
                    SetVehiclePos(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
                    SetVehicleZAngle(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorA]);
                    SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorVW]);
                    LinkVehicleToInterior(GetPlayerVehicleID(playerid), DDoorsInfo[i][ddInteriorInt]);
                }
                else {
                    SetPlayerPos(playerid,DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
                    SetPlayerFacingAngle(playerid,DDoorsInfo[i][ddInteriorA]);
                    SetCameraBehindPlayer(playerid);
                }
				/*foreach(Player, x)
				{
                	if(IsABoomboxNearby(DDoorsInfo[i][ddInteriorX] ,DDoorsInfo[i][ddInteriorY], DDoorsInfo[i][ddInteriorZ], x) < 150.0 && DDoorsInfo[i][ddInteriorVW] == BoomboxInfo[x][bbVW] && DDoorsInfo[i][ddInteriorInt] == BoomboxInfo[x][bbInt])
					{
						PlayAudioStreamForPlayer(playerid, VehicleRadioListing[BoomboxInfo[x][bbStation]-1][radiourl], BoomboxInfo[x][bbPosX], BoomboxInfo[x][bbPosY], BoomboxInfo[x][bbPosZ], 50.0, 1);
					}
				}*/
                return Streamer_UpdateEx(playerid, DDoorsInfo[i][ddInteriorX],DDoorsInfo[i][ddInteriorY],DDoorsInfo[i][ddInteriorZ]);
            }
        }
    	for(new i = 0; i < sizeof(HouseInfo); i++)
		{
        	if(IsPlayerInRangeOfPoint(playerid,3,HouseInfo[i][hExteriorX], HouseInfo[i][hExteriorY], HouseInfo[i][hExteriorZ]))
			{
            	if(PlayerInfo[playerid][pHouse] == i || PlayerInfo[playerid][pHouse2] == i || HouseInfo[i][hLock] == 0 || PlayerInfo[playerid][pRenting] == i)
				{
			    	if(PlayerInfo[playerid][pHouse] == i || PlayerInfo[playerid][pHouse2] == i)
			    	{
			        	if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered their house."); }
			    	    else { format(string, sizeof(string), "* %s has entered their house.", GetPlayerNameEx(playerid)); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
			    	}
			    	else
			    	{
       					if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger has entered %s's house.", HouseInfo[i][hOwner]); }
						else { format(string, sizeof(string), "* %s has entered %s's house.", GetPlayerNameEx(playerid), HouseInfo[i][hOwner]); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}

                	SetPlayerInterior(playerid,HouseInfo[i][hHInteriorWorld]);
                	PlayerInfo[playerid][pInt] = HouseInfo[i][hHInteriorWorld];
                	PlayerInfo[playerid][pVW] = i+6000;
					SetPlayerVirtualWorld(playerid, i+6000);
                	if(HouseInfo[i][hCustomInterior] == 1)
					{
                	    LoadObjectsForPlayer(playerid);
                	}
                	SetPlayerPos(playerid,HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
                	SetPlayerFacingAngle(playerid,HouseInfo[i][hInteriorA]);
                	SetCameraBehindPlayer(playerid);
                	if(PlayerInfo[playerid][pHouse] == i || PlayerInfo[playerid][pHouse2] == i)
                	{
                		GameTextForPlayer(playerid, "~w~Welcome Home", 5000, 1);
					}
					Streamer_UpdateEx(playerid, HouseInfo[i][hInteriorX],HouseInfo[i][hInteriorY],HouseInfo[i][hInteriorZ]);
            	}
            	else
				{
                	GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
            	}
   				return 1;
	  		}
    	}
    	for(new i=1; i<MAX_BUSINESS; i++)
		{
			if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[i][bX], BizInfo[i][bY], BizInfo[i][bZ]))
			{
            	if(PlayerInfo[playerid][pBusiness1] == i || BizInfo[i][bStatus] >= 0)
				{
					GivePlayerCash(playerid, - BizInfo[i][bBizFee]);
 					BizInfo[i][bMoney] += BizInfo[i][bBizFee];
	    			if(PlayerInfo[playerid][pBusiness1] == i)
		    		{
			        	if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered their business."); }
			        	else { format(string, sizeof(string), "* %s has entered their business.", GetPlayerNameEx(playerid)); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
	    			}
			    	else
			    	{
       					if(PlayerInfo[playerid][pMask] == 1) { format(string,sizeof(string), "* Stranger entered %s's business.", BizInfo[i][bOwner]); }
			        	else { format(string, sizeof(string), "* %s has entered the business.", GetPlayerNameEx(playerid), BizInfo[i][bOwner]); }
						ProxDetector(25.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
    				SetPlayerInterior(playerid,BizInfo[i][bBInteriorWorld]);
       				PlayerInfo[playerid][pInt] = BizInfo[i][bBInteriorWorld];
          			PlayerInfo[playerid][pVW] = i+100;
            		SetPlayerVirtualWorld(playerid, i+100);
            		PlayerInfo[playerid][InBusiness] = i;
   					if(BizInfo[i][bCustomInterior] == 1)
					{
	                   	LoadObjectsForPlayer(playerid);
    				}
       				SetPlayerPos(playerid,BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
          			SetPlayerFacingAngle(playerid,BizInfo[i][bInteriorA]);
          			SetCameraBehindPlayer(playerid);
	               	if(PlayerInfo[playerid][pBusiness1] == i)
            		{
                		GameTextForPlayer(playerid, "~w~Welcome to your business!", 5000, 1);
		 			}
			 		if(BizInfo[i][bType] > 2 && BizInfo[i][bType] != 5)
					{
	   					SendClientMessage(playerid,COLOR_WHITE,"   Use /buy to purchase something from this business !");
					}
					Streamer_UpdateEx(playerid, BizInfo[i][bInteriorX],BizInfo[i][bInteriorY],BizInfo[i][bInteriorZ]);
            	}
Reply
#8

Well, you have commented out "//SetTimerEx("Tut1", 1000, false, "i", playerid);". How do you expect it to send you to the tutorial?
Reply
#9

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Well, you have commented out "//SetTimerEx("Tut1", 1000, false, "i", playerid);". How do you expect it to send you to the tutorial?
Ah, I didn't know it should fix it,
Thank you SickAttack.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)