Is it possible?
#1

I am making a group system. And for my enum to make things easier I want to put the ranks into and array.

Here is how it would look.
PHP код:
enum GroupInfo
{
     (
Just Some Shit)
     
Rank[10][32],
     (
More Shit)

Reply
#2

Just do this after it on a command

pawn Код:
if(yourarrayhere[Rank] >= level);
Reply
#3

Can you explain in greater detail of how to to do this. So lets say the array is defined "new Group[GROUP_MAX][GroupInfo];" and the players group id is obtained by "Player[playerid][Group]" and their rank id is obtained by "Player[playerid][Rank]" explain how I would send a client message saying their rank.

EDIT: like so... Group[Player[playerid][Group]][Rank[Player[playerid][Rank]]
Reply
#4

Quote:
Originally Posted by AustinJ
Посмотреть сообщение
Can you explain in greater detail of how to to do this. So lets say the array is defined "new Group[GROUP_MAX][GroupInfo];" and the players group id is obtained by "Player[playerid][Group]" and their rank id is obtained by "Player[playerid][Rank]" explain how I would send a client message saying their rank.
Sorry to say WRONG! it would bee

new Player[MAX_PLAYERS][GroupInfo];

also I man for example a command locked to that group you'd do

pawn Код:
Player[playerid][Rank] >= x); x being equal or higher than
or for a swich()

pawn Код:
if(Playe[playerid][Rank] >= x);
{
        switch(listitem)
        {
              case....
or do you mean set the players text above his name to his rank?

EDIT:nothing better to do so...
pawn Код:
if(Player[playerid][Rank] >= x);
{
        label[playerid] = Create3DTextLabel("Gangsta", 0xFFFFFFFF, //info here);
        Attach3DTextLabelToPlayer(label[playerid], playerid,// info here);
}
explain more what do you want it for
Reply
#5

Alright so lets say I am making a faction chat command and before their name I want to display their rank.

pawn Код:
#define GROUP_MAX 10

enum PlayerInfo
{
     ...
     Name[24],
     Group,
     Rank,
     ...
}

new Player[MAX_PLAYERS][PlayerInfo];

enum GroupInfo
{
     ...
     Rank[10][32] // 10 = Max Ranks, 32 Max Rank Size
     ...
}

new Group[GROUP_MAX][GroupInfo];

command(f, playerid, params)
{
     new message[256], string[256];
     if(sscanf(playerid, "s[256]", message))
     {
          SendClientMessage(playerid, SOME_COLOR, "Usage: /f [message]");
     }
     else
     {
          format(string, 256, "%s %s: %s", RANK_STRING, PlayerInfo[playerid][Name], message);
          // ... Send Message In "string" to all factions ... //
     }
     return 1;
}
Reply
#6

pawn Код:
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "[%s] %s: %s", Player[playerid][Rank], pName, Message);
EDIT: Also its best if you store this info in the main player enum...

Then say if hes rank 1 call him this..
Reply
#7

I want to store the rank names in the GroupInfo enum not the PlayerInfo enum
Reply
#8

Quote:
Originally Posted by AustinJ
Посмотреть сообщение
I want to store the rank names in the GroupInfo enum not the PlayerInfo enum
Ok.. I see how your going to save it its just me being stupid
Reply
#9

Well I guess I'll prove you wrong won't I?
Reply
#10

Quote:
Originally Posted by AustinJ
Посмотреть сообщение
Well I guess I'll prove you wrong won't I?
I didnt say you were wrong I just got confused....
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)