Darge
Умник
Ничем не примечательная команда. Суть этой команды - полное определение позиции, мира и прочего.
Работает с помощью ZCMD/DC_CMD + sscanf2.inc
Делал от нечего делать. Скучно в последнее время
.
PHP:
COMMAND:getinfo(playerid, params[])
{// Created by Darge \\ Pawno-Info.Ru
if(sscanf(params, "u", params[0]))
return SendClientMessage(playerid, -1, "/getinfo [playerid]");
if(params[0] > MAX_PLAYERS)
return SendClientMessage(playerid, -1, "Неверный id игрока!");
new
// В остальных случаях переменные не нужны
Float: get_pos_x,
Float: get_pos_y,
Float: get_pos_z,
Float: get_health,
Float: get_armour,
// Количество ячеек подсчитано!
cmd_sctring[250]
;
GetPlayerPos(params[0], get_pos_x, get_pos_y, get_pos_z);
GetPlayerHealth(params[0], get_health);
GetPlayerArmour(params[0], get_armour);
// Как способ сделать пробел,
// чтобы отделить старый результат от нового
SendClientMessage(playerid, -1, "");
format(cmd_sctring, sizeof(cmd_sctring), "- PLAYER : %d", params[0]);
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- POS : X %0.4f Y %0.4f Z %0.4f", get_pos_x, get_pos_y, get_pos_z);
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- V.WORLD : %d", GetPlayerVirtualWorld(params[0]));
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- INETRIOR : %d", GetPlayerInterior(params[0]));
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- HEALTH : %0.2f", get_health);
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- ARMOUR : %0.2f", get_armour);
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- AMMO : %d", GetPlayerAmmo(params[0]));
SendClientMessage(playerid, -1, cmd_sctring);
format(cmd_sctring, sizeof(cmd_sctring), "- SCORE : %d", GetPlayerScore(params[0]));
SendClientMessage(playerid, -1, cmd_sctring);
return 1;
}
