Problem with the tutorial
#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


Messages In This Thread
Problem with the tutorial - by darkhunter332 - 06.07.2016, 05:16
Re: Problem with the tutorial - by SickAttack - 06.07.2016, 05:59
Re: Problem with the tutorial - by Dayrion - 06.07.2016, 09:48
Re: Problem with the tutorial - by darkhunter332 - 06.07.2016, 13:38
Re: Problem with the tutorial - by gurmani11 - 06.07.2016, 14:11
Re: Problem with the tutorial - by darkhunter332 - 06.07.2016, 14:28
Re: Problem with the tutorial - by gurmani11 - 06.07.2016, 14:41
Re: Problem with the tutorial - by SickAttack - 06.07.2016, 15:14
Re: Problem with the tutorial - by darkhunter332 - 06.07.2016, 16:09

Forum Jump:


Users browsing this thread: 2 Guest(s)