[Include] [INC] Factions + Ranks System - compatible to ANY mode - 0.1
#1

What is it?

This is an include that holds a system to set ranks for a player.

This can be used for DM, TDM, RPG, FreeRoam, Stunt and most likely ANY other gamemode style.

How to use it?

You have these functions:

Code:
native SetPlayerRank(playerid, pfactionid, prankid);
native ResetPlayerFactionRankl(playerid);
native GetPlayerFaction(playerid);
native GetPlayerRank(playerid);
native RANKS_conncet(playerid);
Here is an explanation for each:

Function: SetPlayerRank

Used for setting the faction and rank of a player

Function: ResetPlayerFactionRank

Used for resetting a players faction and rank to NIL (NIL = -1)

Function: GetPlayerFaction

Used for returning a players faction

Function: GetPlayerRank

Used for returning a players Rank

Function: RANKS_connect

Used to set a players faction an rank to NIL on connection (Use at OnPlayerConnect(playerid))

How to make ranks?

This is a system that uses DEFINES for ID's like so:

pawn Code:
#define FACTION_COP 0
#define FACTION_FBI 1
#define RANK_COP_CADET 0
#define RANK_COP_OFFICER 1
#define RANK_FBI_AGENT 0
#define RANK_FBI_SAGENT 1 //special agent
The system is at your hands, see what you can do with it all.

Download:

Factions + Ranks System 0.1 (Mediafire)

Attached below is the file also if you don't want to download from MediaFire

Reply
#2

NIL? I think you mean NULL. And native SetPlayerFactionRankToNil(playerid); isnt this Reset?
Reply
#3

Quote:
Originally Posted by Dark_Kostas
NIL? I think you mean NULL. And native SetPlayerFactionRankToNil(playerid); isnt this Reset?
Nil means nothing, same as Null, zoocha, zilch. lol I am Aussie :P

And for that faction, yeh i changed it to ResetPlayerFactionRank in the include lol sorry ill edit that back :P
Reply
#4

nice
Reply
#5

Nice work!
Reply
#6

does this save in a file?
Reply
#7

Yeah does this save cause when I do in my gamemode

public OnPlayerDisconnect(playerid, reason)
{
if(logged[playerid] == 1)
{
GetPlayerName(playerid, playername, sizeof(playername));
money[playerid] = GetPlayerMoney(playerid);
Score[playerid] = GetPlayerScore(playerid);
dini_IntSet(udb_encode(playername), "license", license[playerid]);
dini_IntSet(udb_encode(playername), "factionid", factionid[playerid]);
dini_IntSet(udb_encode(playername), "rankid", rankid[playerid]);
dini_IntSet(udb_encode(playername), "money", money[playerid]);
dini_IntSet(udb_encode(playername), "Score", Score[playerid]);
dini_IntSet(udb_encode(playername), "Kills", Kills[playerid]);
dini_IntSet(udb_encode(playername), "Deaths", Deaths[playerid]);
dini_IntSet(udb_encode(playername), "adminlevel", adminlevel[playerid]);
dini_IntSet(udb_encode(playername), "viplevel", viplevel[playerid]);
dini_IntSet(udb_encode(playername), "exp", exp[playerid]);

This I get:
D:\joram server\gamemodes\Libertylife17.pwn(945) : error 028: invalid subscript (not an array or too many subscripts): "factionid"
D:\joram server\gamemodes\Libertylife17.pwn(945) : warning 215: expression has no effect
D:\joram server\gamemodes\Libertylife17.pwn(945) : error 001: expected token: ";", but found "]"
D:\joram server\gamemodes\Libertylife17.pwn(945) : error 029: invalid expression, assumed zero
D:\joram server\gamemodes\Libertylife17.pwn(945) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

and line 945 is that forum the factionid and when I get that away I get the same erros on rankid
Reply
#8

Thanks =)
Reply
#9

Someone who knows how to save this?
Reply
#10

Nice!
Thanks dude
Reply
#11

Guys? why no one answer my question? how do you save this?
Reply
#12

Quote:
Originally Posted by jorambo
View Post
Guys? why no one answer my question? how do you save this?
learn to script
Reply
#13

I am trying to learn! but when no one helps me....
I have looked to other scrips and tutorial but I ain't comming out of it.
Reply
#14

Someone
As you see I am only scripting for one month but I want to learn it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)