An enum or a simple variable can do the trick. I'll give an example of both.
Enum
An enum; in laymens terms is basically a more efficient way of defining variables. Notice how the enum [Info]'s match?
pawn Код:
enum Info
{
pFaction,
}
new pInfo[MAX_PLAYERS][Info];
Variable
This is shorter, and is not recommended if you're planning on saving multiple RP stats.
pawn Код:
new pFaction[MAX_PLAYERS];
Note: Before checking out this next section. I strongly suggest you learn how to use ZCMD and sscanf.
Commands
Now once you have your variables. Let's make an example command.
pawn Код:
CMD:invite(playerid,params[])
{
new targetid;
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,0xC0C0C0FF,"USAGE: /invite [playerid]");
else
{
pInfo[playerid][pFaction] = 1;
return 1;
}
}
Explanation
This defines a new variable that will hold the id of the player that you want to invite.
This will check if the player who typed the command left the rest of the command empty and will return a message stating how to use the command.
pawn Код:
if(sscanf(params,"u",targetid)) return SendClientMessage(playerid,0xC0C0C0FF,"USAGE: /invite [playerid]");
This will initiate if the player types the rest of the command.
pawn Код:
else
{
pInfo[playerid][pFaction] = 1;
return 1;
}
This is the part that actually sets the target ids faction to 1 or the LSPD.
pawn Код:
pInfo[playerid][pFaction] = 1;
Conclusion
This was just a real basic touch of how to do it. My fault, because I know I didn't go in depth because I really don't have the time to write a whole tutorial. Just get creative. Learn sscanf and ZCMD, and educate yourself. Goodluck!