i need a faction. - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: i need a faction. (
/showthread.php?tid=591993)
i need a faction. -
Rafaeloo - 19.10.2015
i need a mechanic faction , Filterscript.
and when the player go /badge , the colour change to lightblue.
anyone can help me ?
+rep if u help me
Re: i need a faction. -
Rafaeloo - 19.10.2015
anyone ?
Re: i need a faction. -
Sellize - 19.10.2015
PHP код:
CMD:badge(playerid, params[]){ SetPlayerColor(playerid, 0xA1CAF1FF); return 1; }
That's using ZCMD.
Re: i need a faction. -
Aerotactics - 19.10.2015
I was going to find a tutorial on how to make a faction, and there are none. Let's get started.
If I wanted to add factions to my game mode, I would start by defining a variable:
pawn Код:
new Faction[MAX_PLAYERS];
What this will do is make room for each player to have this variable. Adding a player to the faction is easy:
So our player is now in Faction 1. What is Faction 1? Well, since you wanted a Mechanic, let's make him a Mechanic:
pawn Код:
new FactionName[32];
if(Faction[playerid] == 1)
{
FactionName = "Mechanic";
}
Here we simply defined a string variable and gave it some text. What we do with that text is up to you. Detecting if the player is in a certain faction (IE if Faction is something other than 0) is the simplest concept behind factions.
You also stated you were looking for a /badge command. That will be another variable like above, only we're going to be using a boolean:
pawn Код:
//Example
new bool:Badge[MAX_PLAYERS];
A boolean is either true or false. So if their badge is already off (set to false):
pawn Код:
if(Badge[playerid] == false)
{
SetPlayerColor(playerid, COLOR_BLUE);
return 1;
}
else
{
SetPlayerColor(playerid, COLOR_WHITE);
return 1;
}
Otherwise, set their player color to White, since they are no longer on duty.
The above scripts are incomplete and are only for examples.
Source: Personal Knowledge.
Re: i need a faction. -
Rafaeloo - 19.10.2015
can u explain correctly for filterscript ? Include what ? :/ please