26.06.2009, 06:25
Thx!
And with the tutorials:
I am Hungarian I can speak english, but the tutorials with the pawno are hard a bit
But with the top, it's didn't work
And with the tutorials:
I am Hungarian I can speak english, but the tutorials with the pawno are hard a bit
pawn Код:
// top:
new OriginalSkin[MAX_PLAYERS];
new OriginalColor[MAX_PLAYERS];
new OnDuty[MAX_PLAYERS];
// on player connect:
OnDuty[playerid] = 0;
// on player disconnect:
OnDuty[playerid] = 0;
// on player spawn:
OriginalSkin[playerid] = GetPlayerSkin(playerid);
// on player command text:
if(strcmp(cmd, "/aduty", true) == 0)
{
if(Level[playerid] != ADMIN) return 0; // use this to check if there admin
if(OnDuty[playerid] == 0) {
SetPlayerSkin(playerid,295);
OnDuty[playerid] = 1;
SendClientMessage(playerid, 0xFF0000AA, "You Are Now On Duty As Admin.");
OriginalColor[playerid] = GetPlayerColor(playerid);
SetPlayerColor(playerid, 0xFF0000AA);
}
else if(OnDuty[playerid] == 1) {
SetPlayerSkin(playerid,OriginalSkin[playerid]);
OnDuty[playerid] = 0;
SendClientMessage(playerid, 0xFF0000AA, "You Are Now Off Duty As Admin.");
SetPlayerColor(playerid, OriginalColor[playerid]);
}
return 1;
}
if(strcmp(cmdtext, "/admins", true)==0)
{
new count = 0;
for(new i = 0; i <MAX_PLAYERS; i++)
{
if(Level[ i ] == ADMIN) {
count++;
}
}
if(count > 0) {
new string[50];
SendClientMessage(playerid, COLOR_TEAL, "Current Online Admins:");
for(new i = 0; i <MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && Level[ i ] == ADMIN) {
format(string, sizeof(string), "%s (%d)", ReturnPlayerName(i), i);
SendClientMessage(playerid,0xFF0000AA, string);
}
}
}
else {
SendClientMessage(playerid,0xFF0000AA, "There Are Currently No Admins Online.");
}
return 1;
}
and then put this function at the bottom :
stock ReturnPlayerName(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
return PlayerName;
}