CMD problem
#1

Hello, I have some small problems ... if you can help me o.0

I want to appear the name of the faction, not faction id ..
I tried something but it did not work
I use YSI for save account
And sorry for my bad english...
Код:
CMD:fackick(playerid,params[])
{
	if(pInfo[playerid][AdminLevel] >= 3 || pInfo[playerid][pFacLeader] == 1)
	{
	    new targetid;
	    new string[128];
	    new sext[64];
	    
	    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "/fackick [id]");
	    if(targetid != INVALID_PLAYER_ID)
	    {
	        if(pInfo[targetid][pFacID] == 1) { sext = "Police Departament"; }
			pInfo[targetid][pFacID] = 0;
			pInfo[targetid][pFacPRank] = 0;
			format(string,sizeof(string),"Ai fost dat afara din factiunea %s",pInfo[playerid][pFacID]);
			SendClientMessage(playerid,0xFFFFFFAA,string);
	    }
	}
	else
	{
	    SendClientMessage(playerid, COLOR_RED, "Only certain levels of Administration have access to this command.");
	}
	return 1;
}
Reply
#2

The enumator probably has something like pFacName ?
Reply
#3

nope ,in "enum pInfo" i have only

pFacID << Faction id
pFacPRank <<player rank
pFacLeader <<faction leader
Reply
#4

Can you show me Factions enumator?
Reply
#5

I did the factions after this tutorial

https://sampforum.blast.hk/showthread.php?tid=548348
Reply
#6

Maybe add this to the script?

Код:
stock FactionIDtoName(playerid)
{
	new FactionName[144];
	switch(PlayerInfo[playerid][pFacID])
	{
		case 0: FactionName = "Police Departament";
		// case 1: FactionName = "other names";
	}
	return FactionName;
}
Код:
CMD:fackick(playerid,params[])
{
	if(pInfo[playerid][AdminLevel] >= 3 || pInfo[playerid][pFacLeader] == 1)
	{
	    new targetid;
	    new string[128];
	    new sext[64];
	    
	    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_RED, "/fackick [id]");
	    if(targetid != INVALID_PLAYER_ID)
	    {
	        if(pInfo[targetid][pFacID] == 1) { sext = "Police Departament"; }
			pInfo[targetid][pFacID] = 0;
			pInfo[targetid][pFacPRank] = 0;
			format(string,sizeof(string),"Ai fost dat afara din factiunea %s",FactionIDtoName(playerid));
			SendClientMessage(playerid,0xFFFFFFAA,string);
	    }
	}
	else
	{
	    SendClientMessage(playerid, COLOR_RED, "Only certain levels of Administration have access to this command.");
	}
	return 1;
}
Reply
#7

I have solved, thank you very much for help
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)