SA-MP Forums Archive
[Include] [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] [INC] Factions + Ranks System - compatible to ANY mode - 0.1 (/showthread.php?tid=116041)



[INC] Factions + Ranks System - compatible to ANY mode - 0.1 - pagie1111 - 27.12.2009

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




Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - Dark_Kostas - 27.12.2009

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


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - pagie1111 - 27.12.2009

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


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - Lavion - 27.12.2009

nice


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - Cypress - 27.12.2009

Nice work!


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - luigifan9 - 29.05.2010

does this save in a file?


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - jorambo - 07.07.2010

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


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - nuriel8833 - 07.07.2010

Thanks =)


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - jorambo - 07.07.2010

Someone who knows how to save this?


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - hab2ever - 08.07.2010

Nice!
Thanks dude


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - jorambo - 08.07.2010

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


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - WillyP - 08.07.2010

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


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - jorambo - 08.07.2010

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.


Re: [INC] Factions + Ranks System - compatible to ANY mode - 0.1 - jorambo - 09.07.2010

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