Tematy otagowane jako: powtarzające
1. powtarzające się logi
Witam, mam kod na czat frakcji i chcia?em doda? linijk? dzi?ki kt?rej b?d? widzia? w logach serwerowych kto co pisze. I tu le?y problem poniewa? gdy jest np. 2 administrator?w to czat w logach powtarza si? 2 razy. Jakie? propozycje?
Kod:
function globalMessage ( plr , cmd , ...)
local frakcja = getElementData ( plr , 'player:duty' )
if not frakcja then
return
end
local msg = table . concat ( { ... }, " " )
local admins = getElementsByType ( 'player' )
for i , v in pairs ( admins ) do
local pfrakcje = getElementData ( v , 'player:duty' )
if frakcja == pfrakcje then
outputChatBox ( "#0055B5[Frakcja] #FFFFFF(" .. getElementData ( plr , "id" ).. ") " .. getPlayerName ( plr ): gsub ( "#%x%x%x%x%x%x" , "" ).. ": " .. msg , v , 255 , 254 , 74 , true )
triggerClientEvent ( root , "admin:addText" , root , "Frakcja (" .. getElementData ( plr , "player:duty" ).. ")> " .. getPlayerName ( plr ).. "(" .. getElementData ( plr , "id" ).. "): " .. msg )
end
end
end
addCommandHandler ( "frakcja" , globalMessage )
2. [INNE] Powtarzające się dialogi w czacie
Witam, mam problem i g?owie si? jak go rozwi?za?, stworzy?em ID nicku w czacie ale mam problem, ot?? wyskakuj? mi podw?jne wiadomo?ci typu:
Jaro(ID 1):elo
Jaro:elo
to troche brzydzi gamemod, prosz? o pomoc
Tutaj da?em ca?y public OnPlayerText(playerid, text[])
Kod: public OnPlayerText(playerid, text[])
{
new str[128];
if(IsPlayerAdmin(playerid))
format(str, sizeof str, "(ID: %d) (Admin): %s", playerid, text);
else
format(str, sizeof str, "(ID: %d) (Gracz): %s", playerid, text);
SendPlayerMessageToAll(playerid, str);
switch(xTestBusy)
{
case true:
{
if(!strcmp(xChars, text, false))
{
new
string[128],
pName[MAX_PLAYER_NAME]
;
GetPlayerName(playerid, pName, sizeof(pName));
format(string, sizeof(string), "« %s" Wygra? test reakci!. »", pName);
SendClientMessageToAll(zielony, string);
format(string, sizeof(string), "« Zarobi?e? $%d + %d respektu »", xCash, xScore);
SendClientMessage(playerid, zielony, string);
GivePlayerMoney(playerid, xCash);
SetPlayerScore(playerid, GetPlayerScore(playerid) + xScore);
xReactionTimer = SetTimer("xReactionTest", TIME, 1);
xTestBusy = false;
}
}
}
return 1;
}