Jump to content
  • 0

Respawn punctul 0 al jocului.


official

Question

Problema intalnita (descriere): Cateodata ma spawneaza in punctul 0 al jocului si sub pamant mai exact la acea ferma din ls, precizez ca toate coordonatele pentru spawn sunt puse corect.
Ero(area / rile) / warning-(ul / urile): Nu stiu ce sa va dau lasati reply de orice linie aveti nevoie.
Liniile de cod / sursa / script-ul(obligatoriu):
Imagini / Video (optional):
Ati incercat sa rezolvati singur?: Am incercat , dar degeaba.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

In primul rand, fa o variabila.

new FirstSpawn[MAX_PLAYERS];

In al 2-lea rand, urmeaza pasii acestia:

public OnPlayerConnect(playerid)
{
    FirstSpawn[playerid] = 1; //Adaugam in OnPlayerConnect
    return 1;
}
public OnPlayerSpawn(playerid)
{
    if(FirstSpawn[playerid] == 1)
    {
        SetPlayerPos(playerid, Float:X, Float:Y, Float:Z);
    }
    FirstSpawn[playerid] = 0;
    return 1;
}

public OnPlayerDisconnect(playerid, reasonid)
{
    FirstSpawn[playerid] = 0;
    return 1;
}

242086.png

Link to comment
Share on other sites

  • 0

Oriunde pun

{

FirstSpawn[playerid] = 0;
return 1;
}
 
Imi da acest warning vx-rp.pwn(9072) : warning 225: unreachable code la urmatoarea linie.
 
 
Am sters return 1; si nu imi mai da acea eroare deoarece acel return 1; nu ii mai dadea voie sa citeasca scriptul in continuare..
 
Nu ma connecteaza la srv acm. Ramane asa http://imgur.com/32yedAf
Edited by official
Link to comment
Share on other sites

  • 0
  • 0

Arata-ne OnPlayerSpawn.

public OnPlayerSpawn(playerid) 
{
	#if defined DEBUG
	    printf("[debug] OnPlayerSpawn(%d)", playerid);
	#endif
	
	PreloadAnimLib(playerid,"BOMBER");
	PreloadAnimLib(playerid,"RAPPING");
	PreloadAnimLib(playerid,"SHOP");
	PreloadAnimLib(playerid,"BEACH");
	PreloadAnimLib(playerid,"SMOKING");
	PreloadAnimLib(playerid,"ON_LOOKERS");
	PreloadAnimLib(playerid,"DEALER");
	PreloadAnimLib(playerid,"CRACK");
	PreloadAnimLib(playerid,"CARRY");
	PreloadAnimLib(playerid,"COP_AMBIENT");
	PreloadAnimLib(playerid,"PARK");
	PreloadAnimLib(playerid,"INT_HOUSE");
	PreloadAnimLib(playerid,"FOOD");
	PreloadAnimLib(playerid,"GANGS");
	PreloadAnimLib(playerid,"PED");
	PreloadAnimLib(playerid,"FAT");
	playerVariables[playerid][pWeapons][0] = 0;
	playerVariables[playerid][pWeapons][1] = 0;
	playerVariables[playerid][pWeapons][2] = 0;
	playerVariables[playerid][pWeapons][3] = 0;
	playerVariables[playerid][pWeapons][4] = 0;
	playerVariables[playerid][pWeapons][5] = 0;
	playerVariables[playerid][pWeapons][6] = 0;
	playerVariables[playerid][pWeapons][7] = 0;
	playerVariables[playerid][pWeapons][8] = 0;
	playerVariables[playerid][pWeapons][9] = 0;
	playerVariables[playerid][pWeapons][10] = 0;
	playerVariables[playerid][pWeapons][11] = 0;
	playerVariables[playerid][pWeapons][12] = 0;
	validResetPlayerWeapons(playerid);

	SetPlayerColor(playerid, COLOR_WHITE);
	SetPlayerFightingStyle(playerid, playerVariables[playerid][pFightStyle]);


	if(TurfsDisp[playerid] == 0)
	{
		HideNumbers(playerid);
	}
	
	DamageLog[playerid] = -1;

    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 998);

	if(playerVariables[playerid][pPrisonTime] >= 1) 
	{
	    switch(playerVariables[playerid][pPrisonID]) 
		{
			case 1: {
			    SetPlayerPos(playerid, -26.8721, 2320.9290, 24.3034);
				SetPlayerInterior(playerid, 0);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 2: {
				SetPlayerPos(playerid, 264.58, 77.38, 1001.04);
				SetPlayerInterior(playerid, 6);
				SetPlayerVirtualWorld(playerid, 0);
			}
			case 3: {

				SetPlayerInterior(playerid, 10);
				SetPlayerVirtualWorld(playerid, GROUP_VIRTUAL_WORLD+1);

				new spawn = random(sizeof(JailSpawns));

				SetPlayerPos(playerid, JailSpawns[spawn][0], JailSpawns[spawn][1], JailSpawns[spawn][2]);
				SetPlayerFacingAngle(playerid, 0);
			}
		}
		return 1;
	}

	if(PlayerPaintballing[playerid] != 0)
	{
    	givePlayerValidWeapon(playerid, 24);
		givePlayerValidWeapon(playerid, 31);
		new rand = random(sizeof(gPaintPoints));
		SetPlayerInterior(playerid, 10);
		SetPlayerPos(playerid, gPaintPoints[rand][0], gPaintPoints[rand][1], gPaintPoints[rand][2]);
   		if(pTeam[playerid] == 1)
		{
			SetPlayerSkin(playerid, 285);
		}
		else if(pTeam[playerid] == 2)
		{
			SetPlayerSkin(playerid, 181);
		}
		foreach(Player, x)
		{
			if(PlayerPaintballing[playerid] != 0 && PlayerPaintballing[x] != 0)
			{
				if(pTeam[playerid] == 1)
				{
					SetPlayerMarkerForPlayer(playerid, x, COLOR_PD);
				}
				else if(pTeam[playerid] == 2)
				{
					SetPlayerMarkerForPlayer(playerid, x, COLOR_REPORT);
				}
			}
		}
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 0);
		return 1;
	}
	if((playerVariables[playerid][pPoliceDuty] == 1) && (playerVariables[playerid][pGroup] == 1) && PlayerPaintballing[playerid] == 0)
	{
		givePlayerValidWeapon(playerid, 24);
		givePlayerValidWeapon(playerid, 31);
		givePlayerValidWeapon(playerid, 29);
		givePlayerValidWeapon(playerid, 41);
		SetPlayerHealth(playerid, 100);
		SetPlayerArmour(playerid, 100);
	}	
	if(playerVariables[playerid][pSpawnChange] == 1)
	{
		new houseID = getPlayerHouseID(playerid);
		new houserented = playerVariables[playerid][pRentedHouse];
		if(houseID >= 1)
		{
			SetPlayerInterior(playerid, houseVariables[houseID][hHouseInteriorID]);
			SetPlayerVirtualWorld(playerid, HOUSE_VIRTUAL_WORLD+houseID);
			SetPlayerPos(playerid, houseVariables[houseID][hHouseInteriorPos][0], houseVariables[houseID][hHouseInteriorPos][1], houseVariables[houseID][hHouseInteriorPos][2]);
			InHouse[playerid] = houseID;
			/*if(houseVariables[houseID][hStreamType] == 2)
			{
				YoutubeStreamForPlayer(playerid, houseVariables[houseID][hStream]);
			}
			else if(houseVariables[houseID][hStreamType] == 1)
			{
				PlayAudioStreamForPlayer(playerid, houseVariables[houseID][hStream]);
			}*/
		}
		else
		{
			if(houserented >= 1)
			{
				SetPlayerInterior(playerid, houseVariables[houserented][hHouseInteriorID]);
				SetPlayerVirtualWorld(playerid, HOUSE_VIRTUAL_WORLD+houserented);
				SetPlayerPos(playerid, houseVariables[houserented][hHouseInteriorPos][0], houseVariables[houserented][hHouseInteriorPos][1], houseVariables[houserented][hHouseInteriorPos][2]);
				InHouse[playerid] = houserented;
			}
			else
			{
				playerVariables[playerid][pSpawnChange] = 0;
			}
		}
	}
	if(playerVariables[playerid][pSpawnChange] == 0)
	{
		if(playerVariables[playerid][pGroup] == 0)
		{
			SetPlayerInterior(playerid, 0);
			SetPlayerVirtualWorld(playerid, 0);
			
			SetPlayerPos(playerid, 1153.8890,-1770.9694,16.5992);
		}
		else
		{
			new group;
			group = playerVariables[playerid][pGroup];
			SetPlayerInterior(playerid, groupVariables[group][gGroupHQInteriorID]);
			SetPlayerVirtualWorld(playerid, 20000+group);
			SetPlayerPos(playerid, groupVariables[group][gGroupInteriorPos][0], groupVariables[group][gGroupInteriorPos][1], groupVariables[group][gGroupInteriorPos][2]);
		}
	}
	SetPlayerToTeamColor(playerid);

	playerVariables[playerid][pSkinSet] = 1;

	ResetPlayerWeapons(playerid);
	givePlayerWeapons(playerid);

	if(playerVariables[playerid][pEvent] >= 1)
		playerVariables[playerid][pEvent] = 0;

	if(playerVariables[playerid][pAdminDuty] == 1) {
		SetPlayerHealth(playerid, 900000.0);
	}
	else 
	{
		playerVariables[playerid][pHealth] = 100.0;
		if(playerVariables[playerid][pPoliceDuty] == 1 && PlayerPaintballing[playerid] == 0)
		{
			playerVariables[playerid][pArmour] = 100.0;
			givePlayerValidWeapon(playerid, 24);
			givePlayerValidWeapon(playerid, 31);
			givePlayerValidWeapon(playerid, 29);
			givePlayerValidWeapon(playerid, 41);
		}
		else
		{
			playerVariables[playerid][pArmour] = 0.0;
		}
		SetPlayerHealth(playerid, playerVariables[playerid][pHealth]);
		SetPlayerArmour(playerid, playerVariables[playerid][pArmour]);
	}

	if(!GetPlayerInterior(playerid)) {
		SetPlayerWeather(playerid, weatherVariables[0]);
	}
	else {
		SetPlayerWeather(playerid, INTERIOR_WEATHER_ID);
	}
	SetPlayerSkin(playerid, playerVariables[playerid][pSkin]);
	
	/*if(groupVariables[playerVariables[playerid][pGroup]][gInWar] == 0)
	{
		foreach(Player, i)
		{
			SetPlayerMarkerForPlayer( playerid, i, ( GetPlayerColor( i ) & 0xFFFFFF00 ) );
			SetPlayerMarkerForPlayer( i, playerid, ( GetPlayerColor( playerid ) & 0xFFFFFF00 ) );
		}
	}*/

	syncPlayerTime(playerid);
	TogglePlayerControllable(playerid, true);

	return 1;
}

Vezi de la pOrigin modifica-i

widuaik nu am porigin in gm.

Link to comment
Share on other sites

  • 0
  • 0

am asa

SetSpawnInfo(playerid, 0, playerVariables[playerid][pSkin], 1153.8890,-1770.9694,16.5992, 0, 0, 0, 0, 0, 0, 0);
	SpawnPlayer(playerid);

	SetSpawnInfo(playerid, 0, 0, 1153.8890, -1770.9694, 16.5992, 0, 0, 0, 0, 0, 0, 0);
	SpawnPlayer(playerid);
	SetPlayerPos(playerid, 220.4862, 1822.8994, 7.5387);
	SetPlayerFacingAngle(playerid, 268.3423);
	TogglePlayerControllable(playerid, false);

        SetSpawnInfo(extraid, 0, playerVariables[extraid][pSkin], playerVariables[extraid][pPos][0], playerVariables[extraid][pPos][1], playerVariables[extraid][pPos][2], 0, 0, 0, 0, 0, 0, 0);
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.