Advokat48
Умник
Вообще такая тема. Создаю текстдрав, ставлю таймер на 1 секунду, создаю паблик. Мне нужно что бы текстдрав обновлялся каждую секунду, но когда текстдрав появляется, исчезает практически вся информация, кроме пинга. Пинг обновляется, а вот остальное нет...
Вот коды:
сама команда:
Ну и сам паблик, где должно обновляться все:
Подскажите что неправильно сделал, щас скрин выложу.
Так же просьба помочь тут: Кликни
Всем кто поможет или попытается помочь огромная спасибка.
Вот коды:
PHP:
new retimer;
PHP:
if(strcmp(cmd, "/recon", true) == 0 || strcmp(cmd, "/re", true) == 0 || strcmp(cmd, "/ку", true) == 0)
{
if (PlayerInfo[playerid][pAdmin] >= 1)
{
if(IsPlayerConnected(playerid))
{
//new tmp[256];
new specid;
new name[24];
new Float:health;
new Float:armour;
new money = PlayerInfo[specid][pCash];
new ip[256];
new ping = GetPlayerPing(specid);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "Введите: /re(con) [id]");
specid = ReturnUser(tmp);
GetPlayerName(specid,name,sizeof(name));
GetPlayerHealth(specid,health);
GetPlayerArmour(specid,armour);
GetPlayerIp(specid,ip,sizeof(ip));
if(specid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Игрок не найден!");
if(IsPlayerConnected(specid))
{
ShowMenuForPlayer(adminmenu,playerid);
if(GetPlayerState(specid) == PLAYER_STATE_SPECTATING && gSpectateID[specid] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD1, "Админ в режиме наблюдения");
if(GetPlayerState(specid) != 1 && GetPlayerState(specid) != 2 && GetPlayerState(specid) != 3) return SendClientMessage(playerid, COLOR_GRAD1, "Игрок не вступил в игру!");
for(new i=0; i<GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] >= 2)
{
new weap2, ammo2, weap3, ammo3, weap4, ammo4, weap5, ammo5, weap6, ammo6, weap7, ammo7;
GetPlayerWeaponData(playerid,2,weap2,ammo2);
GetPlayerWeaponData(playerid,3,weap3,ammo3);
GetPlayerWeaponData(playerid,4,weap4,ammo4);
GetPlayerWeaponData(playerid,5,weap5,ammo5);
GetPlayerWeaponData(playerid,6,weap6,ammo6);
GetPlayerWeaponData(playerid,7,weap7,ammo7);
GetPlayerWeaponData(playerid,2,PlayerInfo[playerid][pSlot2],PlayerInfo[playerid][pSlotammo2]);
GetPlayerWeaponData(playerid,3,PlayerInfo[playerid][pSlot3],PlayerInfo[playerid][pSlotammo3]);
GetPlayerWeaponData(playerid,4,PlayerInfo[playerid][pSlot4],PlayerInfo[playerid][pSlotammo4]);
GetPlayerWeaponData(playerid,5,PlayerInfo[playerid][pSlot5],PlayerInfo[playerid][pSlotammo5]);
GetPlayerWeaponData(playerid,6,PlayerInfo[playerid][pSlot6],PlayerInfo[playerid][pSlotammo6]);
GetPlayerWeaponData(playerid,7,PlayerInfo[playerid][pSlot7],PlayerInfo[playerid][pSlotammo7]);
GetPlayerWeaponData(playerid,8,PlayerInfo[playerid][pSlot8],PlayerInfo[playerid][pSlotammo8]);
StartSpectate(playerid, specid);
}
format(string, sizeof(string), "~w~%s~n~ID: %d~n~~n~~w~Armour: ~g~%.1f~n~~w~Health: ~g~%.1f~n~~w~Money: ~g~%d~n~~w~IP: ~g~%s~n~~w~PING: ~g~%d",
name, specid, armour, health, money, ip, ping);
retimer = SetTimer("ReAdmin", 1000, 1);
TvTextDraw[playerid] = TextDrawCreate(500.000000,120.000000, string);
TextDrawAlignment(TvTextDraw[playerid],1);
TextDrawFont(TvTextDraw[playerid],2);
TextDrawLetterSize(TvTextDraw[playerid],0.35,1.25);
TextDrawSetOutline(TvTextDraw[playerid],1);
TextDrawBackgroundColor(TvTextDraw[playerid],0x000000ff);
TextDrawColor(TvTextDraw[playerid],0xffffffff);
TextDrawSetProportional(TvTextDraw[playerid],1);
TextDrawSetShadow(TvTextDraw[playerid],1);
TextDrawShowForPlayer(playerid, TvTextDraw[playerid]);
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "Вы не уполномочены использовать данную команду!");
}
}
return 1;
}
PHP:
forward ReAdmin(playerid);
public ReAdmin(playerid)
{
new string[256];
new specid;
new name[24];
new Float:health;
new Float:armour;
new money = PlayerInfo[specid][pCash];
new ip[256];
new ping = GetPlayerPing(specid);
PlayerSpectatePlayer(playerid, specid);
gSpectateID[playerid] = specid;
TextDrawHideForPlayer(playerid, TvTextDraw[playerid]);
format(string, sizeof(string), "~w~%s~n~ID: %d~n~~n~~w~Armour: ~g~%.1f~n~~w~Health: ~g~%.1f~n~~w~Money: ~g~%d~n~~w~IP: ~g~%s~n~~w~PING: ~g~%d",
name, specid, armour, health, money, ip, ping);
TextDrawSetString(TvTextDraw[playerid], string);
TextDrawShowForPlayer(playerid, TvTextDraw[playerid]);
}
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Чтобы видеть скрытое содержание Зарегистрируйтесь на форуме!
Так же просьба помочь тут: Кликни
Всем кто поможет или попытается помочь огромная спасибка.
Последнее редактирование:
