igor_chupin
Компетентный
Проверка на гм на простых командах
На ZCMD+sscanf2
Как идет работа:
1. Вы водите команду.
2. Игрока тпшает к вам и выдает вам minigun.
3. Вы расстреливаете его.
PHP:
if(strcmp(cmd, "/gmcheck", true) == 0)
{
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "Вы не зашли на сервер.");
if (PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Вы не Администратор.");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD2, " Используйте /gmcheck [id Player]");
new Float:plocx,Float:plocy,Float:plocz;
new plo;
plo = ReturnUser(tmp);
if (!IsPlayerConnected(plo)) return SendClientMessage(playerid, COLOR_GRAD1"Данного игрока нету на сервере");
if(plo == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1"Не правильный id игока");
if (PlayerInfo[plo][pAdmin] > 4) return SendClientMessage(playerid, COLOR_GRAD1, "Администратора нельзя проверять.");
new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
GetPlayerPos(playerid, plocx, plocy, plocz);
if (GetPlayerState(plo) == 2)
{
TelePos[plo][0] = 0.0;
TelePos[plo][1] = 0.0;
new tmpcar = GetPlayerVehicleID(plo);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
SetVehicleZAngle(tmpcar, Angle+180);
}
else
{
SetPlayerFacingAngle( playerid, Angle+180 );
SetPlayerPos(plo,plocx+2,plocy, plocz);
GivePlayerWeapon(playerid, 38,200);
}
SetPlayerInterior(plo,GetPlayerInterior(playerid));
SetPlayerVirtualWorld(plo,GetPlayerVirtualWorld(playerid));
SendClientMessage(plo, COLOR_GRAD1, "");
return true;
}
PHP:
CMD:gmcheck(playerid, params[])
{
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, COLOR_GRAD1, "Вы не зашли на сервер.");
if (PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "Вы не Администратор.");
if(sscanf(params, "d", params[0])) return SendClientMessage(playerid, COLOR_GRAD2, " Используйте /gmcheck [id Player]");
new Float:plocx,Float:plocy,Float:plocz;
if (!IsPlayerConnected(params[0])) return SendClientMessage(playerid, COLOR_GRAD1"Данного игрока нету на сервере");
if(params[0] == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1"Не правильный id игока");
if (PlayerInfo[params[0]][pAdmin] > 4) return SendClientMessage(playerid, COLOR_GRAD1, "Администратора нельзя проверять.");
new Float:Angle;
GetPlayerFacingAngle(playerid, Angle);
GetPlayerPos(playerid, plocx, plocy, plocz);
if (GetPlayerState(params[0]) == 2)
{
TelePos[params[0]][0] = 0.0;
TelePos[params[0]][1] = 0.0;
new tmpcar = GetPlayerVehicleID(params[0]);
SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
SetVehicleZAngle(tmpcar, Angle+180);
}
else
{
SetPlayerFacingAngle( playerid, Angle+180 );
SetPlayerPos(params[0],plocx+2,plocy, plocz);
GivePlayerWeapon(playerid, 38,200);
}
SetPlayerInterior(params[0],GetPlayerInterior(playerid));
SetPlayerVirtualWorld(params[0],GetPlayerVirtualWorld(playerid));
SendClientMessage(params[0], COLOR_GRAD1, "");
return true;
}
1. Вы водите команду.
2. Игрока тпшает к вам и выдает вам minigun.
3. Вы расстреливаете его.
Последнее редактирование:
