PDA

View Full Version : Is it possible?


AustinJ
31/08/2011, 09:57 PM
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.
enum GroupInfo
{
(Just Some Shit)
Rank[10][32],
(More Shit)
}

IceCube!
31/08/2011, 10:00 PM
Just do this after it on a command

if(yourarrayhere[Rank] >= level);

AustinJ
31/08/2011, 10:11 PM
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]]

IceCube!
31/08/2011, 10:19 PM
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

Player[playerid][Rank] >= x); x being equal or higher than

or for a swich()


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...

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

AustinJ
31/08/2011, 10:33 PM
Alright so lets say I am making a faction chat command and before their name I want to display their rank.


#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;
}

IceCube!
31/08/2011, 10:38 PM
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..

AustinJ
31/08/2011, 10:43 PM
I want to store the rank names in the GroupInfo enum not the PlayerInfo enum

IceCube!
31/08/2011, 10:45 PM
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

AustinJ
31/08/2011, 10:50 PM
Well I guess I'll prove you wrong won't I? :)

IceCube!
31/08/2011, 10:51 PM
Well I guess I'll prove you wrong won't I? :)

I didnt say you were wrong I just got confused....

AustinJ
31/08/2011, 10:54 PM
LOL.. I figure it out.

IceCube!
31/08/2011, 10:56 PM
LOL.. I figure it out.

You clearly dont understand what im saying...

Also if you need an example of saving to the file just post your saving system here.

AustinJ
31/08/2011, 11:03 PM
I might just have to go new gRank[GROUP_MAX][10][32];

EDIT: btw saving is easy. Just save the string gRank[groupid][0].