[FilterScript] [FS] Faction System (/checkfaction, /joinfaction)
#1

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
Reply
#2

Delete unused publics --'
Reply
#3

yo nigga not bad
Reply
#4

First script? No good.
Reply
#5

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.)
Reply
#6

/checkfaction is not located
Reply
#7

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.
Reply
#8

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.
Reply
#9

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
Reply
#10

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?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)