Tematy otagowane jako: adminów
1. Handling tylko dla adminów
Czy wie kto? jak mog? przerobi? skrypt hedit (skrypt na ustawianie handlingu) tak aby m?g? z niego korzysta? tylko gracz dodany do grupy admin w acl?
2. Komenda dla adminów
Witam, ot?? chcia?bym ?eby komenda: /dajreputacje by?a tylko dla admin?w
oto kod:
[lua]
addEventHandler('onResourceStart',getResourceRootElement(),
function()
call(getResourceFromName("scoreboard"), "addScoreboardColumn", "Reputacja")
for theKey,thePlayer in ipairs(getElementsByType ( "player" )) do
setElementData(thePlayer,"Reputacja",0)
setElementData(thePlayer,"Kasa",0)
end
end)
addEventHandler('onPlayerJoin',getRootElement(),
function()
setElementData(source,"Reputacja",0)
setElementData(source,"Kasa",0)
end)
function addScore(points)
setElementData(source, "points", getElementData(source, "points") + points)
setElementData(source, "money", getPlayerMoney(getLocalPlayer()))
end
addEvent("addScore", true)
addEventHandler("addScore", getRootElement(), addScore)
---------dawanie score
addCommandHandler ( "dajreputacje",
function ( player, cmd, nick, kwota )
if nick and kwota then
local aplayer = getPlayerFromName ( nick )
if aplayer then
kwota = tonumber(kwota)
setElementData(aplayer,"Reputacja",kwota)
--givePlayerMoney ( aplayer, kwota )
outputDebugString ( "[POINTS]Points dodane." )
else
outputChatBox( "[POINT...
3. Teleportowanie się adminów
Witam mam problem , dosta?em od kolegi kod na komendy i bajery admina , ale mam problem z teleportacj?.
addCommandHandler ( "test" , function( el , md )
local gracz = el
if isPedInVehicle ( el ) then gracz = getPedOccupiedVehicle ( el ) end
setElementPosition ( gracz , 2500.5952 , - 1669.4454 , 13.3532 )
outputChatBox ( "test." , el , 255 , 255 , 0 )
end )
ten kod dzia?a tylko ?e mo?e tepa? si? tam normalny gracz.
wi?c prosz? o pomoc jak zrobi? aby m?g? tepa? si? tam Moderator,Admin,Rcon
za pomoc
4. [INNE] Chat adminów - /a.
Witam, mam komend? na chat admin?w, lecz ona dzia?a tylko na id 0. Prosz? o pomoc.
Oto kod:
Pawn CMD : a ( playerid , p [])
{
new Ranga = RangaAdmina [ playerid ];
if( Ranga >= 2 )
{
new wiadomosc [ 200 ];
new Gname [ MAX_PLAYER_NAME ];
GetPlayerName ( playerid , Gname , sizeof ( Gname ));
if( sscanf ( p , "s" , wiadomosc ))
{
SendClientMessage ( playerid , 0xFFFFFF , "U?yj: /a [TEXT]" );
return 1 ;
}
else
{
for(new i ; i < MAX_PLAYERS ; i ++)
{
if( RangaAdmina [ i ] >= 2 )
{
format ( wiadomosc , sizeof ( wiadomosc ), "{FFFFFF}[{801818}AdminChat{FFFFFF}] {FFC800}%s{FFFFFF}» {FFFFFF}%s" , Gname , wiadomosc );
SendClientMessage ( i , 0xFFFFFF , wiadomosc );
}
}
}
}
else
{
SendClientMessage ( playerid , 0xFFFFFFFF , "{CC0000}Nie masz uprawnie?!" );
}
return 1 ;
}
Pozdrawiam.
5. [INNE] Lista adminów online w GUI
Witam. Zacz??em przerabia? mapk? Honest'a i chcia?bym przerobi? komend? /admins. G??wnie to chodzi mi o zmian? wy?wietlania admin?w, ?eby si? w gui wy?wietla?o. Tutaj macie kod pawno:
Kod:
CMD:admins(playerid, cmdtext[])
{
if(!ToAdminLevel(playerid,1)) return 0;
foreach(Player,i)
{
if(Zalogowany[i]&&PlayerInfo[i][pAdmin]>=1)
{
format(String, sizeof(String),"[%d] Admin %s (%s), ranga: %d",i,PlayerInfo[i][pNickOOC],Nick[i],PlayerInfo[i][pAdmin]);
SendClientMessage(playerid,KOLOR_ADMIN,String);
}
}
return 1;
}
Bardzo prosz? o pomoc
6. [GF] Wbijanie na konta adminów
Ot?? wbijaj? mi na konta admin?w i robi? rozrub? na serwerze np admin ma nick Domino a ta osoba wbija na DomInO i ma panel admina
Kod: public OnPlayerConnect(playerid)
{
rakspam[playerid] = SetTimerEx("raksampik", 2000, false, "d", playerid);
PlayerAdmin[playerid] = 0;
SendClientMessage(playerid, ZIELONY,"Na serverze jest zainstalowany skrypt AS-Edited w wersji "wersja".");
SendClientMessage(playerid, ZIELONY,"By ujrze? liste komend wpisz /acmd (tylko admin).");
format(String128, sizeof(String128), "SELECT `Admin` FROM `Uzytkownicy` WHERE `Nick` = '%s'", PlayerName(playerid));
PlayerAdmin[playerid] = dini_Int("ADMINI.ini", PlayerName(playerid));
KontrolowanyGracz[playerid] = 0;
SetPVarInt(playerid, "uciszony", 0);
JailStatus[playerid] = 0;
SetPVarInt(playerid, "specuje", 0);
return 1;
}
problem pewno le?y po tej stronie no ale jak to zabezpieczy?