SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/07/2019, 11:25 AM   #1
Shayba
Little Clucker
 
Shayba's Avatar
 
Join Date: Aug 2015
Posts: 16
Reputation: 0
Default admin nickname

I have such a request for you, in general, I decided to do the following, but I dont 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 doesnt 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 dont imagine how it is done in the soul.
I hope I clearly explained everything, waiting for your help, dear scripters!
__________________
Code:
I'm Russian,I can write with mistakes,please do not pay attention!
Shayba is offline   Reply With Quote
Old 16/07/2019, 11:35 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,017
Reputation: 48
Default Re: admin nickname

1. create variable
PHP Code:
//for example, lets call it an AdminRank
new AdminRank[MAX_PLAYERS][32]; //at the top of the script 
2. make this variable changeable.
PHP Code:
//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.
PHP Code:
//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.
__________________
hang in there, help is on the way.
Mugala is offline   Reply With Quote
Old 16/07/2019, 11:36 AM   #3
GeorgeLimit
Big Clucker
 
GeorgeLimit's Avatar
 
Join Date: Mar 2018
Location: Anywhare
Posts: 91
Reputation: 0
Default Re: admin nickname

like this?

place at OnPlayerConnect
Code:
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;
__________________
GeorgeLimit is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[HELP] - tag in nickname JhefTFJ Scripting Help 2 05/01/2017 08:09 PM
Nickname eeek Русский/Russian 2 27/08/2013 06:11 PM
bad nickname TheGtaLover Client Support 3 29/01/2010 04:46 PM
Nickname bug Packer5 Server Support 5 18/04/2009 09:05 PM
my nickname ;'( morrowind3 Client Support 1 06/04/2009 08:06 AM


All times are GMT. The time now is 04:59 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.