23.01.2013, 03:14
Bom Vim Aqui pedir ajuda de voces de um comando pra ver os admins online , exemplo o player digita /admins ai aparece os admins que estгo logados no rcon e em tudo alguem me ajuda porfavor .
CMD:admins(playerid,params[])
{
new Msg[128];
for (new i; i < MAX_PLAYERS; i++)
if (IsPlayerConnected(i))
{
GetPlayerName(i, Name, sizeof(Name));
if (IsPlayerAdmin(i))
{
format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
SendClientMessage(0x00FF00FF, Msg);
}
}
}
|
Nгo sei como й formado seu sistema de Admin, entгo nao tem como ajudar se vocк nгo posta.
Mas ta aqui o CMD em zcmd ( vocк nгo especificou o processador de comandos qe queria entao fiz ao meu gosto ). pawn Код:
|
if (strcmp("/admins", cmdtext, true, 7) == 0)
{
new Msg[128];
for (new i; i < MAX_PLAYERS; i++)
if (IsPlayerConnected(i))
{
GetPlayerName(i, Name, sizeof(Name));
if (IsPlayerAdmin(i))
{
format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
SendClientMessage(0x00FF00FF, Msg);
}
}
}
|
Ver se funciona, nгo sei se ta correto, pois nгo sei muito sobre strcmp.
pawn Код:
|
|
C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : error 017: undefined symbol "Name" C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : error 017: undefined symbol "Name" C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : error 029: invalid expression, assumed zero C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(96) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors. |
|
GetPlayerName(i, Name, sizeof(Name)); |
new Name[MAX_PLAYER_NAME];
|
acrecenta la
pawn Код:
|
|
C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(102) : error 035: argument type mismatch (argument 2) C:\Users\NILSON\Desktop\samp03e_svr_R2_win32\pawno \Yago.pwn(106) : warning 217: loose indentation Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
|
SendClientMessage(0x00FF00FF, Msg); |
if(strcmp(cmdtext, "/admins", true) == 0)
{
new Name[24], msg[120];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerAdmin(i))
{
GetPlayerName(i,Name,24);
format(msg,sizeof(msg),"Admins Online's: %s", Name);
SendClientMessage(playerid, 0x000FFFAA, msg);
}
}
return 1;
}
if (strcmp("/admins", cmdtext, true, 7) == 0)
{
new Name[24], Msg[128];
for (new i; i < MAX_PLAYERS; i++)
if (IsPlayerConnected(i))
{
GetPlayerName(i, Name, sizeof(Name));
if (IsPlayerAdmin(i))
{
format(Msg, 128, "Admin-RCON %s logado, ID: %i.", Name, i);
SendClientMessage(0x00FF00FF, Msg);
}
}
}