PDA

Просмотр полной версии : [Вопрос] Кто знает?



Dimon_Fanat
20.01.2015, 12:00
Как сделать в команде /gethere проверку чтоб если прописать /gethere id игрока а он афк чтоб писало что этот игрок афк вы не можете его тп.

Chak
20.01.2015, 12:24
if(PlayerEx[plo][VarEx] > 1) return SendClientMessage(playerid, COLOR_GREY, "- Данный игрок AFK");

Shayba
20.01.2015, 12:29
Как сделать в команде /gethere проверку чтоб если прописать /gethere id игрока а он афк чтоб писало что этот игрок афк вы не можете его тп.

Попробуй просто заменить свою команду на эту.


if(strcmp(cmd, "/gethere", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "Введите: /gethere [id]");
new Float:plocx,Float:plocy,Float:plocz;
new plo;
new inter = GetPlayerInterior(playerid);
new worldd = GetPlayerVirtualWorld(playerid);
plo = ReturnUser(tmp);
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(GetPlayerState(plo) != 1 && GetPlayerState(plo) != 2 && GetPlayerState(plo) != 3) return SendClientMessage(playerid, COLOR_GRAD1, "Игрок не вступил в игру!");
if(PlayerEx[plo][VarEx] > 1) return SendClientMessage(playerid, COLOR_GREY, "Данный игрок AFK");
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,inter);
PlayerInfo[plo][pInt] = inter;
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
SetPlayerVirtualWorld(plo,worldd);
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
SetPlayerInterior(plo,inter);
SetPlayerVirtualWorld(plo,worldd);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,inter);
PlayerInfo[plo][pInt] = inter;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
SetPlayerInterior(plo,inter);
new tmpcar = GetPlayerVehicleID(plo);
SetPlayerVirtualWorld(plo,worldd);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
SetPlayerInterior(plo,inter);
SetPlayerVirtualWorld(plo,worldd);
}
SendClientMessage(plo, COLOR_WHITE, "Вас телепортировал администратор Название вашего проекта");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Вы не опалномочены использовать данную команду!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Игрок не найден!");
}
return true;
}

Помогло,не жалей +

Dimon_Fanat
20.01.2015, 13:35
Попробуй просто заменить свою команду на эту.


if(strcmp(cmd, "/gethere", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) && PlayerInfo[playerid][pAdmin] >= 3) return SendClientMessage(playerid, COLOR_WHITE, "Введите: /gethere [id]");
new Float:plocx,Float:plocy,Float:plocz;
new plo;
new inter = GetPlayerInterior(playerid);
new worldd = GetPlayerVirtualWorld(playerid);
plo = ReturnUser(tmp);
if(IsPlayerConnected(plo))
{
if(plo != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 3)
{
if(GetPlayerState(plo) != 1 && GetPlayerState(plo) != 2 && GetPlayerState(plo) != 3) return SendClientMessage(playerid, COLOR_GRAD1, "Игрок не вступил в игру!");
if(PlayerEx[plo][VarEx] > 1) return SendClientMessage(playerid, COLOR_GREY, "Данный игрок AFK");
GetPlayerPos(playerid, plocx, plocy, plocz);
if(PlayerInfo[playerid][pInt] > 0)
{
SetPlayerInterior(plo,inter);
PlayerInfo[plo][pInt] = inter;
PlayerInfo[plo][pLocal] = PlayerInfo[playerid][pLocal];
SetPlayerVirtualWorld(plo,worldd);
}
if(PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,PlayerInfo[playerid][pInt]);
SetPlayerInterior(plo,inter);
SetPlayerVirtualWorld(plo,worldd);
}
if(plocz > 930.0 && PlayerInfo[playerid][pInt] == 0)
{
SetPlayerInterior(plo,inter);
PlayerInfo[plo][pInt] = inter;
}
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
SetPlayerInterior(plo,inter);
new tmpcar = GetPlayerVehicleID(plo);
SetPlayerVirtualWorld(plo,worldd);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
}
else
{
SetPlayerPos(plo,plocx,plocy+2, plocz);
SetPlayerInterior(plo,inter);
SetPlayerVirtualWorld(plo,worldd);
}
SendClientMessage(plo, COLOR_WHITE, "Вас телепортировал администратор Название вашего проекта");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Вы не опалномочены использовать данную команду!");
}
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "[Ошибка] Игрок не найден!");
}
return true;
}

Помогло,не жалей +

У меня команда в 2 раза меньше зачем мне такая большая?

- - - Добавлено - - -



if(PlayerEx[plo][VarEx] > 1) return SendClientMessage(playerid, COLOR_GREY, "- Данный игрок AFK");


C:\Users\1\Desktop\ImmortaL.pwn(14550) : error 017: undefined symbol "PlayerEx"
C:\Users\1\Desktop\ImmortaL.pwn(14550) : warning 215: expression has no effect
C:\Users\1\Desktop\ImmortaL.pwn(14550) : error 001: expected token: ";", but found "]"
C:\Users\1\Desktop\ImmortaL.pwn(14550) : error 029: invalid expression, assumed zero
C:\Users\1\Desktop\ImmortaL.pwn(14550) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Shayba
20.01.2015, 13:38
[Dimon_Fanat]У меня команда в 2 раза меньше зачем мне такая большая?

Она просто тут кажется большой,текст в поле не помещается.
Да и какая разница в размерах,тебе нужна рабочая команда,вот она.
А размер как известно,значения не имеет!!!

Dimon_Fanat
20.01.2015, 13:50
[Dimon_Fanat]У меня команда в 2 раза меньше зачем мне такая большая?

Она просто тут кажется большой,текст в поле не помещается.
Да и какая разница в размерах,тебе нужна рабочая команда,вот она.
А размер как известно,значения не имеет!!!


C:\Users\1\Desktop\ImmortaL.pwn(14564) : warning 217: loose indentation
C:\Users\1\Desktop\ImmortaL.pwn(14568) : warning 217: loose indentation
C:\Users\1\Desktop\ImmortaL.pwn(14569) : warning 217: loose indentation
C:\Users\1\Desktop\ImmortaL.pwn(14580) : error 017: undefined symbol "PlayerEx"
C:\Users\1\Desktop\ImmortaL.pwn(14580) : warning 215: expression has no effect
C:\Users\1\Desktop\ImmortaL.pwn(14580) : error 001: expected token: ";", but found "]"
C:\Users\1\Desktop\ImmortaL.pwn(14580) : error 029: invalid expression, assumed zero
C:\Users\1\Desktop\ImmortaL.pwn(14580) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.


Варнинги еще ладно исправлю а вот error.

Chak
20.01.2015, 14:05
if(PlayerInfo[plo][VarEx] > 1) { SendClientMessage(playerid, COLOR_GREY, " Данный игрок AFK"); }

Dimon_Fanat
20.01.2015, 14:24
if(PlayerInfo[plo][VarEx] > 1) { SendClientMessage(playerid, COLOR_GREY, " Данный игрок AFK"); }


C:\Users\1\Desktop\ImmortaL.pwn(14551) : error 033: array must be indexed (variable "VarEx")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

L0ndl3m
20.01.2015, 16:07
Вот здесь (http://pro-pawn.ru/showthread.php?11293-Anti-GM-%28GodMode%29&p=56215&viewfull=1#post56215) я показывал, как создать систему AFK.

Chak
20.01.2015, 17:13
C:\Users\1\Desktop\ImmortaL.pwn(14551) : error 033: array must be indexed (variable "VarEx")
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Вместо VarEx вставь свою переменную которая отвечает за AFK