/invite for factions.
#21

Quote:
Originally Posted by ♦۞pкћп§-шŧųĄ۞♦
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(recruit, 7, cmdtext);
  return 0;
}
I think this is what you mean.
Thanks, i'll check that out now.
Reply
#22

does that dcmd(recruit,7,cmdtext); need to be defined or any of that at th top?
Reply
#23

pawn Код:
//After includes at top

#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

public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(recruit, 7, cmdtext);
  return 0;
}

//Your command goes at the bottom of your script. Nowhere else.

dcmd_recruit(playerid,params[])
{
  //rest of your code.
}
https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#24

That makes sense

I've worked it out and I'll just go and test it.
Reply
#25

So what is the code supposed to do

Код:
	new playername[24];
	GetPlayerName(playerid,playername,24);
	new file[128];
	format(file,128,"%s.txt",udb_encode(playername));
	if(gTeam[playerid]==TEAM_RIFAS)
	{
	  if(dini_Int(file,"Rifas") != 1)
	  {
	    ForceClassSelection(playerid);
	    dini_IntSet(file,"Rifas",0);
	    SendClientMessage(playerid,0xFFFFFFAA,"You're not an official Rifas Member!");
			return 0;
	  }
	  else if(dini_Int(file,"Rifas") == 1)
	  {
	  }
	}
that goes underneeath OnPlayerRequestSpawn

Then I've got the dcmd(recruit,7,cmdtext); under OnPlayerCommandText

then this at the bottom of the script

Код:
dcmd_recruit(playerid,params[])
{
if(!params[0])
	{
		SendClientMessage(playerid,0xFFFFFFAA,"USAGE : /recruit [playerid]");
		return SendClientMessage(playerid,0xFFFFFFAA,"Used to recruit players 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,"%s.txt",udb_encode(victimname));
	if(strcmp(playername,"Hector_Ramirez",false)==0)
	{
		dini_IntSet(string,"Rifas",1);
	 	format(string,128,"%s has recruited player %s into the Rifas!",playername,playerid,victimname,victimid);
	  print(string);
 		return SendClientMessageToAll(GetPlayerColor(playerid),string);
	}
return 1;
}
It compiles fine but i think there are a few bugs with the userfiles, like Ive already made a registration system. Would any of this code need to go in the registration script?
Reply
#26

* BUMP *
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)