shape1
shape2
shape3
shape4
shape7
shape8

Команда /goto


Статус
Закрыто для дальнейших ответов.

Rwmont2000

Новичок
Пользователь
18.12.2014
304
14
0
23
Здравствуйте! В Уфе баг с кмд /goto. Когда тп к игроку, то везде пустота (нет текстур). В чём ошибка? Вот кмд:

Код:
 	if(strcmp(cmd, "/goto", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "Подсказка: /goto [playerid/PartOfName]");
				return 1;
			}
			new Float:plocx,Float:plocy,Float:plocz;
			new plo;
			plo = strval(tmp);
			if (IsPlayerConnected(plo))
			{
			    if(plo != INVALID_PLAYER_ID)
			    {
					if (PlayerInfo[playerid][pAdmin] >= 1)
					{
						if(Spectate[playerid] != 255)
						{
							Spectate[playerid] = 256;
						}
						GetPlayerPos(plo, plocx, plocy, plocz);
						if(PlayerInfo[plo][pInt] > 0)
						{
							SetPlayerInterior(playerid,PlayerInfo[plo][pInt]);
							PlayerInfo[playerid][pInt] = PlayerInfo[plo][pInt];
							PlayerInfo[playerid][pLocal] = PlayerInfo[plo][pLocal];
						}
						if(PlayerInfo[playerid][pInt] == 0)
						{
							SetPlayerInterior(playerid,0);
						}
						if(plocz > 530.0 && PlayerInfo[plo][pInt] == 0) //the highest land point in sa = 526.8
						{
							SetPlayerInterior(playerid,1);
							PlayerInfo[playerid][pInt] = 1;
						}
						if (GetPlayerState(playerid) == 2)
						{
							new tmpcar = GetPlayerVehicleID(playerid);
							SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
							TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
						}
						else
						{
							SetPlayerPos(playerid,plocx,plocy+2, plocz);
						}
						SendClientMessage(playerid, COLOR_GRAD1, "  Вы были телепортированы");
					}
					else
					{
						SendClientMessage(playerid, COLOR_GRAD1, "   У вас нет прав на использование этой команды!");
					}
				}
			}
			else
			{
				format(string, sizeof(string), "   %d этот игрок оффлайн.", plo);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
 
Последнее редактирование модератором:

Kostyaev

Магистр
Пользователь
19.07.2014
1 123
274
0
26
Попробуй так:

Код:
if(!strcmp(cmd,"/goto", true))
	{
	new Float:POS[3], player;
        if(PlayerInfo[playerid][pAdmin] >= 3) return 1;
	{
	player = strval(tmp);
	if (IsPlayerConnected(player))
	{
	if(player != INVALID_PLAYER_ID)
	{
	GetPlayerPos(player,POS[0],POS[1],POS[2]);
	if (GetPlayerState(playerid) == 2)
	{
	new tmpcar = GetPlayerVehicleID(playerid);
	SetVehiclePos(tmpcar, POS[0], POS[1]+4, POS[2]);
	TelePos[playerid][0] = 0.0; TelePos[playerid][1] = 0.0;
	}
	else SetPlayerPos(playerid,POS[0],POS[1]+2, POS[2]);
	SetPlayerInterior(playerid,GetPlayerInterior(player));
	SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player));
	SendClientMessage(playerid,COLOR_RED, "Вы были телепортированы!");
	}
	else SendClientMessage(playerid,COLOR_RED, "Вы не уполномочены использовать эту команду!!");
	}
	}
	return 1;
	}
 

Kostyaev

Магистр
Пользователь
19.07.2014
1 123
274
0
26
Или же командой /setint 0,то есть мировой мир ставим на 0. 

 
Статус
Закрыто для дальнейших ответов.