Help Ppc Admin system scripts
#1

Heres some screen shot how to add admin rank name in chat

https://imgur.com/a/4etnsXY
Reply
#2

ANYONE PLEASE?
Reply
#3

What are you trying to do? Are you trying to add an admin rank next to one's name if he's an admin on duty?
Reply
#4

no /duty and no off duty directly that and i want that admin if you chat your level admin rank pop up in chat
Reply
#5

Then, you format the text being sent in OnPlayerText callback:

Код:
public OnPlayerText(playerid, text[])
{
   if(PlayerInfo[playerid][pAdmin] > 0 ) // I'll assume you have player data regarding admin rank;
   {
      new str[512]; //I am not sure which length you need here; you might want to search about that yourself.
      format(str, sizeof(str), "[%s] %s: %s", GetAdminRankName(playerid), GetPlayerName(playerid), text); //Where GetAdminRankName(playerid) is a stock that returns you your rank name depending on your admin rank
      //Send your message here whichever way you usually do it
      return 0; //we prevent the usual message from being sent
    }
    return 1;//In other case, we just send the text as usual
}

...

stock GetAdminRankName(playerid)
{
   new str[32];
   switch(PlayerInfo[playerid][pAdmin])
   {
      case 1: str = "Admin rank name 1"
      ...
   }
   return str;
}
You get the general idea I guess.
Reply
#6

D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1465) : error 029: invalid expression, assumed zero
D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1465) : error 017: undefined symbol "text"
D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1467) : error 017: undefined symbol "PlayerInfo"
D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1467) : warning 215: expression has no effect
D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1467) : error 001: expected token: ";", but found "]"
D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1467) : error 029: invalid expression, assumed zero
D:\ROOT FOLDER WAG DELETE\gamemodes\PPC_Trucking.pwn(1467) : fatal error 107: too many error messages on one line
Reply
#7

ANYONE HELP ME? PLEASE
Reply
#8

Quote:
Originally Posted by BanSilog
Посмотреть сообщение
ANYONE HELP ME? PLEASE
@Maxandmov already told you how to do it. Solve that errors, are not that hard to solve.
These errors are too common, you should have known how to solve them.

Quote:
Originally Posted by Maxandmov
Посмотреть сообщение
You get the general idea I guess.
He doesn't :]].
Reply
#9

Quote:
Originally Posted by FaLLenGirL
Посмотреть сообщение
@Maxandmov already told you how to do it. Solve that errors, are not that hard to solve.
These errors are too common, you should have known how to solve them.


He doesn't :]].
I do not know why you're just so selfish that I know I need to learn but that's not what I'm supposed to want to be with you and of course I'm starting to know you do not know how to understand me for yourself take you

sorry if I said that's why it's bad for me to ask for bad help? I feel better when you help me than I'm right and I know that I have to learn but I try hard to learn
Reply
#10

Quote:
Originally Posted by BanSilog
Посмотреть сообщение
I do not know why you're just so selfish that I know I need to learn but that's not what I'm supposed to want to be with you and of course I'm starting to know you do not know how to understand me for yourself take you

sorry if I said that's why it's bad for me to ask for bad help? I feel better when you help me than I'm right and I know that I have to learn but I try hard to learn
I am not selfish. I'm too kind sometimes with some people from here, and they don't really deserve help, because they use a ugly lang with us and they think that we'll do their job and they will just copy it. So if i seemed to be selfish or rude with you, I am sorry, I am just tired of people like them. I edited a little bit @Maxandmov code, i hope this will help you to get it right:

PHP код:
public OnPlayerTextplayeridtext[ ] )
{
    
SetPlayerChatBubbleplayeridtext0xFFFFFFFF100.010000 );
    if( 
PlayerInfoplayerid ][ pAdmin ] > )
    {
        new 
str512 ];
        
formatstrsizeofstr ), "[%s] %s: %s"GetAdminRankNameplayerid ), GetPlayerNameplayerid ), text );
        return 
0;
    }
    return 
1;
}
stock GetAdminRankNameplayerid )
{
   new 
str32 ];
   switch( 
PlayerInfoplayerid ][ pAdmin ] )
   {
      case 
1str "Rank 1";
      case 
2str "Rank 2";
      case 
3str "Rank 3";
      case 
4str "Rank 4";
      case 
5str "Rank 5";
      case 
6str "Rank 6";
      
      
//you can add more if you want
   
}
   return 
str;

* Also: "PlayerInfo" doesn't exist because this enum in your GM/FS is named different. Maybe "pInfo" or etc, this
enum is used to save player variables, put in the code above your enum name.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)