03.02.2014, 16:48
Hello everyone, i have a problem, i don't know how to do what muted player can know how much time he left in mute. I mean, how to do what mute time show in textdraw.
My code:
Thanks all for helping me. And apologise for my bad english.
My code:
PHP код:
dcmd_mute(playerid,params[])
{
if(pInfo[playerid][AdminLvl] >= Adm[mute])
{
new MuteID, MuteStr[128], MuteReason[128];
if (sscanf(params, "us",MuteID,MuteReason)) return SendClientMessage(playerid, red, "[SERVER]: Naudojimas: \"/mute [id] [priezastis\"");
if(IsPlayerConnected(MuteID))
{
if(pInfo[MuteID][Punished] == true)
return SendClientMessage(playerid,red,"[SERVER]: Zaidejas neseniai nubaustas...");
if(pInfo[playerid][AdminLvl] > pInfo[MuteID][AdminLvl] && MuteID != playerid)
{
if(pInfo[MuteID][Muted] == 0)
{
format(param,128,"/mute %s",params);
LogPlayerCmd(playerid, MuteID, param, true);
pInfo[MuteID][MutedTimes]++;
PunishPlayer(MuteID);
pInfo[MuteID][MutedInGame] = 1;
pInfo[MuteID][Muted] = 1;
format(MuteStr,sizeof(MuteStr),"[SERVER]: %s uztildytas uz: %s (Admin: %s)",pInfo[MuteID][pName],MuteReason,pInfo[playerid][pName]);
SendClientMessageToAll(green,MuteStr);
pInfo[MuteID][Mcolor] = GetPlayerColor(MuteID);
SetPlayerColor(MuteID,black);
MuteTimer[MuteID] = SetTimerEx("PlayerUnMute",MUTE_TIME,0,"d",MuteID);
} else { SendClientMessage(playerid,white,"[SERVER]: Zaidejas jau uztildytas"); }
} else { SendClientMessage(playerid,white,"[SERVER]: Didesnio lygio administratoriu si komanda neveikia"); }
} else { SendClientMessage(playerid,red,"[SERVER]: Zaidejas nerastas"); }
} else { SendClientMessage(playerid, balta, "SERVER: Unknown command."); }
return 1;
}
PHP код:
DmLaikas = TextDrawCreate(499.000000,110.000000,"00:00");
TextDrawAlignment(DmLaikas,0);
TextDrawBackgroundColor(DmLaikas,0x000000ff);
TextDrawFont(DmLaikas,2);
TextDrawLetterSize(DmLaikas,0.499999,2.000000);
TextDrawColor(DmLaikas,0xff000099);
TextDrawSetOutline(DmLaikas,1);
TextDrawSetProportional(DmLaikas,1);
TextDrawSetShadow(DmLaikas,1);
PHP код:
new DmLaikrodisStr[64];
format(DmLaikrodisStr,128,"%02d:%02d",DmMinutes,DmSekundes);
TextDrawSetString(Text:DmLaikas,DmLaikrodisStr);