samperonline
Умник
Привет, хочу сделать что то типа если админ открывает тп на мероприятие и игрок использует /gomp то смог вернутся обратно на свои кординаты но че то ваще не работает не разу
делаю так
открываю телепорт через /mp
игрок тпхается на мп
и возвращаем его обратно
делаю так
открываю телепорт через /mp
C++:
if(listitem == 0) {
if(Teleport == 0)
{
GetPlayerPos(playerid, TeleportFloat[0], TeleportFloat[1], TeleportFloat[2]); // Çàïèñûâàåì êîîðäèíàòû
TeleportInfo[0] = GetPlayerInterior(playerid); // Çàïèñûâàåì èíòåðüåð
TeleportInfo[1] = GetPlayerVirtualWorld(playerid); // Çàïèñûâàåì âèðòóàëüíûé ìèð
Teleport = 1;
format(stringer, sizeof(stringer), "Àäìèíèñòðàòîð %s[%d]: îòêðûë(-à) òåëåïîðò íà ìåðîïðèÿòèå èñïîëüçóéòå (/gomp)", PlayerInfo[playerid][pNames],playerid);
SendClientMessageToAll(0xFFCD00ff,stringer);
}
else
{
format(stringer, sizeof(stringer), "Àäìèíèñòðàòîð %s[%d]: çàêðûë(-à) òåëåïîðò íà ìåðîïðèÿòèå.", PlayerInfo[playerid][pNames],playerid);
SendClientMessageToAll(0xFFCD00ff,stringer);
Teleport = 0;
return 1;
}
}
C++:
CMD:gomp(playerid)
{
if(Teleport == 0)
return SendClientMessage(playerid, COLOR_GREY,"Îøèáêà: Íà äàííûé ìîìåíò ìåðîïðèÿòèé íåò.");
new
Float:Coordsss[3],
in = GetPlayerInterior(playerid),
vw = GetPlayerVirtualWorld(playerid)
;
GetPlayerPos(playerid,
Coordsss[0],
Coordsss[1],
Coordsss[2]);
SetPVarFloat(playerid, "BackX", Coordsss[0]), SetPVarFloat(playerid, "BackY", Coordsss[1]), SetPVarFloat(playerid, "BackZ", Coordsss[2]), SetPVarInt(playerid, "BackIn", in), SetPVarInt(playerid, "BackVw", vw);
SetPPos(playerid, TeleportFloat[0], TeleportFloat[1], TeleportFloat[2]);
SetPlayerInterior(playerid, TeleportInfo[0]);
SetPlayerVirtualWorld(playerid, TeleportInfo[1]);
return 1;
}
и возвращаем его обратно
C++:
CMD:exitmp(playerid)
{
if(Teleport == 1)
return SendClientMessage(playerid, COLOR_GREY,"Îøèáêà: Ìîæíî èñïîëüçîâàòü òîëüêî ïîñëå /gomp");
if(!GetPVarFloat(playerid, "BackX"))
return true;
SetPPos(playerid,
GetPVarFloat(playerid, "BackX"),
GetPVarFloat(playerid, "BackY"),
GetPVarFloat(playerid, "BackZ"));
SetPlayerInteriorEx(playerid, GetPVarInt(playerid, "BackIn"));
SetPlayerVirtualWorldEx(playerid, GetPVarInt(playerid, "BackVw"));
DeletePVar(playerid, "BackX"), DeletePVar(playerid, "BackY"), DeletePVar(playerid, "BackZ"), DeletePVar(playerid, "BackIn"), DeletePVar(playerid, "BackVw");
SendClientMessage(playerid, -1, "Âû îòêàçàëèñü îò ó÷àñòèå â Ìåðîïðèÿòèè (ÌÏ).");
return true;
}
