Shker
Умник
PHP:
new Float:PX,Float:PY,Float:PZ;
if(strcmp(cmd, "/otp", true) == 0)
{
new admin[256];
GetPlayerName(playerid,admin,sizeof(admin));
if (PlayerInfo[playerid][pAdmin] >= 2)
{
if (!tpadmin[playerid])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
tpadmin[i] = 1;
}
GetPlayerPos(playerid,PX,PY,PZ);
format(string,sizeof(string),">> %s[%d]: Телепорт к админу, введите /gotp <<",admin,playerid);
SendClientMessageToAll( COLOR_YELLOW,string);
}
else if (tpadmin[playerid])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
tpadmin[i] = 0;
}
format(string,sizeof(string),">> %s[%d]: Телепорт закрыт <<",admin,playerid);
SendClientMessageToAll( COLOR_YELLOW,string);
}
}
}
if(strcmp(cmd, "/gotp", true) == 0)
{
if(tpadmin[playerid] == 0)
{
SendClientMessage(playerid,COLOR_GREY,"Телепорт закрыт!");
return true;
}
SetPlayerPos(playerid,PX,PY,PZ+2);
SetPlayerInterior(playerid,0);
SendClientMessage(playerid, COLOR_WHITE, "Вы телепортировались");
}
