PDA

View Full Version : admin nickname


Shayba
16/07/2019, 11:25 AM
I have such a request for you, in general, I decided to do the following, but I donít know where to even begin!
I want to fix one admin for the ghetto, another for the CRP, how to do that, when this admin would write in a simple chat, or / about the chat it doesnít matter where he would have the TEG [GETTO Main]
For example:
Ivan_Ivanov [The Chief of Ghetto] writes no matter what chat, and after his nickname there is a tag
Denis_Denisov [Chief of GOS] here is his speech
Vasya_Pupkin [Main by HELPER] here his speech
Etc
I approximately understand that it is possible to do a check on a nickname, but I donít imagine how it is done in the soul.
I hope I clearly explained everything, waiting for your help, dear scripters!

Mugala
16/07/2019, 11:35 AM
1. create variable
//for example, lets call it an AdminRank
new AdminRank[MAX_PLAYERS][32]; //at the top of the script
2. make this variable changeable.//we can make this changeable by many ways.
//lets try with dialog boxs (its simple)
ShowPlayerDialog(playerid,1330,DIALOG_STYLE_INPUT,"Admin Rank","Input your rank here","Confirm","Exit");

//at OnDialogResponse
if(dialogid == 1330) //our dialog
{
if(response)
{
if(strlen(inputtext) > 0)
{
format(AdminRank[playerid],sizeof(AdminRank[playerid]),"%s",inputtext);
SendClientMessage(playerid,-1,inputtext); //for checking
}
}
}

3. now lets use that AdminRank in formats.
//for example, lets change /admin or /a command (most in modes it's admin-chat)
new string[256],name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"[A] %s %s: %s",name,AdminRank[playerid],text);
//SendAdminMessage or something like that here..

4. you can save and load that AdminRank in a database.

GeorgeLimit
16/07/2019, 11:36 AM
like this?

place at OnPlayerConnect

if(PlayerInfo[playerid][pAdmin] == 1)
{
new pName[MAX_PLAYER_NAME],string[1000];
GetPlayerName(playerid,sizeof(pName),sizeof(pName) );
format(sizeof(string),"%s [ADMIN]", pName);
SetPlayerName(Playerid, string);
}
return 1;