Is it possible? -
AustinJ - 31.08.2011
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)
}
Re: Is it possible? -
IceCube! - 31.08.2011
Just do this after it on a command
pawn Код:
if(yourarrayhere[Rank] >= level);
Re: Is it possible? -
AustinJ - 31.08.2011
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]]
Re: Is it possible? -
IceCube! - 31.08.2011
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
Re: Is it possible? -
AustinJ - 31.08.2011
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;
}
Re: Is it possible? -
IceCube! - 31.08.2011
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..
Re: Is it possible? -
AustinJ - 31.08.2011
I want to store the rank names in the GroupInfo enum not the PlayerInfo enum
Re: Is it possible? -
IceCube! - 31.08.2011
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
Re: Is it possible? -
AustinJ - 31.08.2011
Well I guess I'll prove you wrong won't I?
Re: Is it possible? -
IceCube! - 31.08.2011
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....