Some lines not working
#1

Hey guys i got a stock with some lines that dont work no errors ofc but the just dont function ingame so im wondering why if you have the solution Thanks

Код:
stock SetPlayerSpawn(playerid)
{
	LogCallback("SetPlayerSpawn");
	if(IsPlayerConnected(playerid))
	{
	    SetPlayerHealth(playerid, 50.0);
		if(MedicBill[playerid] == 1 && PlayerInfo[playerid][pJailed] == 0)
		{
			SetPlayerFacingAngle(playerid, 0);
			TogglePlayerControllable(playerid, 0);
			PlayerPlaySound(playerid, 1062, 0.0, 0.0, 0.0);
			if(DrugStage[playerid] >= 1)
			{
				if(OnCoke[playerid] == 1)
				{
					stop DoingDrugs[playerid];
					DrugStage[playerid] = 3;
					CocaineHigh(playerid);
				}
				if(OnCrack[playerid] == 1)
				{
					stop DoingDrugs[playerid];
					DrugStage[playerid] = 3;
					CrackEffects(playerid);
				}
				else
				{
					stop DoingDrugs[playerid];
					DrugStage[playerid] = 4;
					WeedEffects(playerid);
				}
			}
			switch(Farming[playerid])
			{
				case 21 .. 31:
				{
					Farming[playerid] = 21;
					ResetJobVehicle(playerid);
					SCM(playerid, COLOR_LIGHTRED, "You need /getduster and dust your crops again!!");
					SafeSetPlayerPos(playerid, JobIcons[8][0], JobIcons[8][1], JobIcons[8][2]);
					SafeGivePlayerMoney(playerid, 250);
					SetPlayerVirtualWorld(playerid, 0);
					SetPlayerInterior(playerid, 0);
				}
			}
			return 1;
		}
		switch(PlayerInfo[playerid][pJailed])
		{
			case 1:
			{
				SafeSetPlayerInterior(playerid, 6);
				SafeSetPlayerPos(playerid,264.6288,77.5742,1001.0391);
				SCM(playerid, COLOR_LIGHTRED, "Incomplete Jail Sentence, back to jail.");
				return 1;
			}
			case 2:
			{
				SafeSetPlayerInterior(playerid, 10);
				SafeSetPlayerPos(playerid,1870.66, -1672.40, 1993.18);
				SCM(playerid, COLOR_LIGHTRED, "Incomplete Jail Sentence, back to jail.");
				return 1;
			}
			case 3:
			{
				SafeSetPlayerInterior(playerid, 3);
				SafeSetPlayerPos(playerid,197.4628,174.9990,1003.0234);
				SCM(playerid, COLOR_LIGHTRED, "Incomplete Jail Sentence, back to jail.");
				return 1;
			}
			case 4:
			{
				SafeSetPlayerInterior(playerid, 10);
				SafeSetPlayerPos(playerid,215.3917,110.7503,999.0156);
				SCM(playerid, COLOR_LIGHTRED, "Incomplete Jail Sentence, back to jail.");
				return 1;
			}
			case 5:
			{
				SetPlayerVirtualWorld(playerid, 0);
				SafeSetPlayerPos(playerid,1810.0143,-1567.6458,5700.4287);
				SCM(playerid, COLOR_LIGHTRED, "Incomplete prison sentence, back to prison.");
				return 1;
			}
		}
		if(PlayerInfo[playerid][pSpawnArmour] >= 1)
		{
	 		SafeSetPlayerArmour(playerid, 50+PlayerInfo[playerid][pSpawnArmour]);
			return 1;
		}
		if(PlayerInfo[playerid][pSpawnHealth] >= 1)
		{
			SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSpawnHealth]);
			return 1;
		}
		if(RegistrationStep[playerid] == 0 && FirstSpawn[playerid] == 1)
		{

			SetPlayerVirtualWorld(playerid,PlayerInfo[playerid][pVirWorld]);
			SetPlayerInterior(playerid,PlayerInfo[playerid][pInt]);
			SafeSetPlayerPos(playerid, PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z] + 1);
			//SafeGivePlayerWeapon(playerid,46,8675);
			return 1;
		}
		animreset[playerid] = repeat ResetAnimation(playerid);
		TogglePlayerControllable(playerid, 1);
		PlayerTextDrawShow(playerid, Textdraw51[playerid]);
//		SetPlayerToTeamColor(playerid);
//		SafeSetPlayerPos(playerid,PlayerInfo[playerid][pPos_x],PlayerInfo[playerid][pPos_y],PlayerInfo[playerid][pPos_z]);
	}
	LogCallback("SetPlayerSpawn");
	return 1;
}
Its about the lines

Код:
		if(PlayerInfo[playerid][pSpawnArmour] >= 1)
		{
	 		SafeSetPlayerArmour(playerid, 50+PlayerInfo[playerid][pSpawnArmour]);
			return 1;
		}
		if(PlayerInfo[playerid][pSpawnHealth] >= 1)
		{
			SetPlayerHealth(playerid, 50.0+PlayerInfo[playerid][pSpawnHealth]);
			return 1;
		}
Reply
#2

SafeSetPlayerArmour?
Reply
#3

Its a define for the SetPlayerArmour basicly to prevent from being kicked by the anticheat.
Reply
#4

At the switch case where you check for his jail, Remove those return 1...

Also remove all the return 1 except the last one sibce return 1 breaks the code from continueing
Reply
#5

maybe this is because some "return 1;" above the code is being executed
remove all "return 1;" and keep only one at last
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)