SA-MP Forums Archive
[FilterScript] [FS] Faction System (/checkfaction, /joinfaction) - 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)
+--- Thread: [FilterScript] [FS] Faction System (/checkfaction, /joinfaction) (/showthread.php?tid=113891)



[FS] Faction System (/checkfaction, /joinfaction) - Oxside - 16.12.2009

Faction System

What?
Many people want to make their own RolePlay Script but dont know how to make
a Faction System. So i created one. Its really easy, ive added a lot of comment in the script.
So just read and you know how to use it.

How does it works (For Expiernced Scripter)
Ive created one Variable (new Faction[MAX_PLAYERS]
Then save it with DUDB at OnPlayerConnect and OnPlayerDisConnect.
I create a command:
Код:
if (strcmp("/joinfaction", cmdtext, true, 10) == 0)
{
    // Copy this command as much as you want and edit it to create multiple join faction command
	    SendClientMessage(playerid, COLOR_RED, "* You joined faction 1");
	    Faction[playerid] = 1; // << With this we set Faction ID to 1, change 1 to any Faction ID									return 1;							
}
Download (PasteBin)
http://pastebin.com/f48f1c905

Oxside



Re: [FS] Faction System (/checkfaction, /joinfaction) - RyDeR` - 16.12.2009

Delete unused publics --'


Re: [FS] Faction System (/checkfaction, /joinfaction) - Lotusmp - 16.12.2009

yo nigga not bad


Re: [FS] Faction System (/checkfaction, /joinfaction) - Enerv - 16.12.2009

First script? No good.


Re: [FS] Faction System (/checkfaction, /joinfaction) - MenaceX^ - 16.12.2009

Erhm it doesn't have much features but variables but fine.
By the way:
pawn Код:
stock PlayerName(playerid) {
 new name[255];
 GetPlayerName(playerid, name, 255);
 return name;
}
Uh?
Why 255? The max string a name can fill is 24 (and even this is only when you set the name in-gamely.)


Re: [FS] Faction System (/checkfaction, /joinfaction) - Eazy_Efolife - 16.12.2009

/checkfaction is not located


Re: [FS] Faction System (/checkfaction, /joinfaction) - Correlli - 16.12.2009

Quote:
Originally Posted by MenaceX^
By the way:
pawn Код:
stock PlayerName(playerid) {
 new name[255];
 GetPlayerName(playerid, name, 255);
 return name;
}
Uh?
Why 255? The max string a name can fill is 24 (and even this is only when you set the name in-gamely.)
He probably took this function from some old script/include like dini/dudb/dutils which is using 255 cells for every array.


Re: [FS] Faction System (/checkfaction, /joinfaction) - MenaceX^ - 16.12.2009

Quote:
Originally Posted by Don Correlli
Quote:
Originally Posted by MenaceX^
By the way:
pawn Код:
stock PlayerName(playerid) {
 new name[255];
 GetPlayerName(playerid, name, 255);
 return name;
}
Uh?
Why 255? The max string a name can fill is 24 (and even this is only when you set the name in-gamely.)
He probably took this function from some old script/include like dini/dudb/dutils which is using 255 cells for every array.
Yeah, probably. I've seen a lot like this in the "Useful Functions" thread.


Re: [FS] Faction System (/checkfaction, /joinfaction) - Oxside - 17.12.2009

Sorry /checkfaction was little bit bugged.
And Sorry its so easy..

And why the string is filled with 255 and not 24 i dunno i copyed the stock Playername from a older script of me

Quote:
Originally Posted by Enerv
First script? No good.
Go learn english..
And its not my first script, just search for my name: Oxside
you will see many scripts


Re: [FS] Faction System (/checkfaction, /joinfaction) - dsao_triano - 19.03.2010

I get this problem...

D:\Spel\Rockstar Games\GTA San Andreas\TTC\filterscripts\Faction.pwn(3) : fatal error 100: cannot read from file: "color"
That means that the #include <color> doesnt work.

And I get it cuase I do not have any .inc file named color, I know that.
But if I make a color.inc file, What should be the script in it to get the pawno to work?