20.11.2009, 18:35
Hey hey,
Can anyone teach me how to make an /admins command? I'm not a bad scripter, but I've got problems with this. I'm admin in-game, and typing ''/ban'' but it says: ''/ban : you're not an admin'' (from RCON). How do I disable that?
I'm not a bad scripter but got problems with the names and text colours...
Can someone tell me how to change the text colour? Default is red. And I want it in an other colour, where do I put the ''DEFINE_COLOUR'' ? Please explain.
Can anyone teach me how to make an /admins command? I'm not a bad scripter, but I've got problems with this. I'm admin in-game, and typing ''/ban'' but it says: ''/ban : you're not an admin'' (from RCON). How do I disable that?
I'm not a bad scripter but got problems with the names and text colours...
Код:
dcmd_banip(playerid, params[]) { new index = 0; tmp2 = strtok(params, index); if (pInfo[playerid][pAdmin] == 3) { SystemMessage(playerid, "You are not an Administrator."); return 1; } if(!strlen(tmp2)) { SystemMessage(playerid, "Correct usage: '/banip [playername] [reason]'"); return 1; } new string[MAX_STRING]; new second, minute, hour, day, month, year; giveplayerid = ReturnUser(tmp2); if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "You have been IP banned by Administrator %s. (Reason: '%s')", PlayerName(playerid), params); SendClientMessage(giveplayerid, COLOR_SYSTEM, string); format(string, sizeof(string), "Player %s has been IP banned by Administrator %s. (Reason: '%s')", PlayerName(giveplayerid), PlayerName(playerid), params); SendClientMessageToAll(COLOR_SYSTEM, string); format(string, sizeof(string), "%s has been IP banned by Administrator %s. (Reason: '%s')", PlayerName(giveplayerid), PlayerName(playerid), params); print(string); gettime(hour, minute, second); getdate(year, month, day); format(string,sizeof(string),"Player %s IP banned player %s on %d/%d/%d at %d:%d:%d. (Reason: '%s')", PlayerName(playerid), PlayerName(giveplayerid), month, day, year, hour, minute, second, params); ServerLog(string); BanPlayer(giveplayerid, ""); } else { SendClientMessage(playerid, COLOR_SYSTEM, "That player is not active."); } return 1; }