/invite for factions.
#1

Ok, I'm completely un-sure on how to make a /invite command for faction leaders so they can invite players to their faction.

Could anyone be kind enough to give me a detailed tutorial on how I can do this?

It would be much appreciated if you could.

Thanks,

Cevarr.
Reply
#2

I bet this is a godfather question, Post in that thread please.
Reply
#3

Umm, no. It's not as a matter-of-fact.

I just want to make a /recruit OR a /invite (they're both the same thing) for faction leaders..
Reply
#4

Well the problem is, nobody here knows anything about what gm you're talking about, what variables deal with it, or how it is setup. So nobody can help you. Only give you advice.
Reply
#5

I started from scratch, I'm not editing a GM; simply making a new one of my own.
Reply
#6

what sistem do you use for teams ? gteam ?
Reply
#7

For teams, I usually use if (GetPlayerSkin(playerid) == SKIND-ID (Skins of the team).
Reply
#8

Quote:
Originally Posted by Cevarr
For teams, I usually use if (GetPlayerSkin(playerid) == SKIND-ID (Skins of the team).
Skins have nothing to do with the team issue . Unless you want a skin to invite a other skin to be part of the skin , which is very unlogical. So tell us again , how are your teams defined? ( if you dont have any , then tell that 2 -.- )
Reply
#9

I have got teams in my script, just don't use them. i prefer to use skins.

I have them like this:

Код:
#define TEAM_RIFAS 1
#define TEAM_RIFAS_2 2
#define TEAM_RIFAS_3 3
#define TEAM_SFPD 4
#define TEAM_SFPD_2 5
#define TEAM_SFPD_3 6
#define TEAM_SFPD_4 7
#define TEAM_SFPD_5 8
#define TEAM_SFPD_6 9
#define TEAM_SFPD_7 10
#define TEAM_CHIEF 11
#define TEAM_CIVILLIAN 12
#define TEAM_CIVILLIAN2 13
#define TEAM_CIVILLIAN3 14
#define TEAM_CIVILLIAN4 15
#define TEAM_CIVILLIAN5 16
#define TEAM_CIVILLIAN6 17
#define TEAM_CIVILLIAN7 18
#define TEAM_CIVILLIAN8 19
#define TEAM_CIVILLIAN9 20
As in classes, i dont really understand that part at all though with gTeam thats why I prefer to use GetPlayerSkin
Reply
#10

its easy, gTeam[playerid] = w/e team, the way your doing it is completely stupid
Reply
#11

Tell me how i should do it then..
Reply
#12

Quote:
Originally Posted by Cevarr
Tell me how i should do it then..
Well its very simple , when you use ''/invite'' check if a guy who is part of a team already by using;

Код:
if(gTeam[playerid] == YOUR_TEAM)
After that Get the players name and SetPlayerTeam.
Reply
#13

Ok, dont I need the dcmd stuff?
Reply
#14

Quote:
Originally Posted by Cevarr
Ok, dont I need the dcmd stuff?
Thats your own choice.
Reply
#15

I do want dcmd, I'm a noob at dcmd though

I want it to be saved in the players userfile (that he's a part of the faction)

hope u understand me
Reply
#16

I want it like this:

Код:
dcmd_recruit(playerid,params[])
{
	if(!params[0])
	{
		SendClientMessage(playerid,0xFFFFFFAA,"Usage: /invite [playerid]");
		return SendClientMessage(playerid,Purple,"Impact: Recruits a player into your faction.");
	}
	new victimid=strval(params);
	if(!IsPlayerConnected(victimid)) return SendClientMessage(playerid,0xFFFFFFAA,"Invalid Player ID!");
	new playername[24],victimname[24],string[128];
	GetPlayerName(playerid,playername,24);
	GetPlayerName(victimid,victimname,24);
	format(string,128,"/Users/%s.txt",udb_encode(victimname));
	if(strcmp(playername,"Samuel_Evans",false)==0)
	{
		dini_IntSet(string,"sfpd",1);
	 	format(string,128,"%s(%d) has recruited player %s(%d) in to the SFPD",playername,playerid,victimname,victimid);
	  print(string);
 		return SendClientMessageToAll(GetPlayerColor(playerid),string);
	}
	return 1;
}
public OnPlayerRequestSpawn(playerid)
{
	new playername[24];
	GetPlayerName(playerid,playername,24);
	new file[128];
	format(file,128,"/Users/%s.txt",udb_encode(playername));
	if(gTeam[playerid]==TEAM_SFPD)
	{
	  if(dini_Int(file,"SFPD") != 1)
	  {
	    dini_IntSet(file,"SFPD",0);
	    SendClientMessage(playerid,0xFFFFFFAA,"You are not a member of the SFPD!");
			printf("Player %s(%d) didn't spawn because the player is not a SFPD member.",playername,playerid);
			return 0;
	  }
	  else if(dini_Int(file,"SFPD") == 1)
	  {
	  }
	}
	return 1;
}
Don't I need a DCMD forward at the top or something? :S
Reply
#17

*Bump*

Any help? i really need this
Reply
#18

Quote:
Originally Posted by Cevarr
Don't I need a DCMD forward at the top or something? :S
pawn Код:
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2])))))return 1
Reply
#19

Yes, i knw that , I just need like uh, dcmd(recruit,5 ... bla bla - I dont remember what the code thingie was
Reply
#20

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(recruit, 7, cmdtext);
  return 0;
}
I think this is what you mean.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)