Jump to content
  • 0

Problema Faction Punish


Raulik

Question

Salut, am si eu o promblema.

Recent, am bagat in mod "Faction Punish". In ce consta Faction Punish? Simplu, de exemplu: daca nu stai minim o saptamana intr-o factiune, liderul iti da uninvite cu Faction punish 30/30, iar pana nu iti trece aceste faction punish-uri nu poti intra in alta factiune. La fiecare payday scade cu 1 faction punish. Dar este o problema: dupa ce primesti faction punish 30/30 si dai relog, dupa relog ai dinou 0/30.

Stie cineva cum pot rezolva aceasta problema?

Aici am toate liniile legate de Faction Punish:

public OnPlayerConnect(playerid)

PlayerInfo[playerid][pPunish] = 0;
public PayDay()
if(PlayerInfo[i][pPunish] > 0)
					{
    					PlayerInfo[i][pPunish] -= 1;
					}
public OnPlayerRegister
ini_setInteger(File,"FPunish",PlayerInfo[playerid][pPunish]);
public OnPlayerUpdate_GF(playerid)
ini_setInteger(File,"FPunish",PlayerInfo[playerid][pPunish]);
public OnPlayerLogin
ini_setInteger(File,"FPunish",PlayerInfo[playerid][pPunish]);
"/invite"
if(PlayerInfo[para1][pPunish] > 0)
					        {
					            SendClientMessage(playerid, COLOR_GRAD2, "  Can't invite him, player have FactionPunish !");
					            return 1;
					        }
	if(strcmp(cmd, "/uninvite", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "COMANDA: /uninvite [1 with Fpunish/0 without Fpunish] [playerid/PartOfName]");
				return 1;
			}
			new x_nr;
			new para1;
			x_nr = strval(tmp);
			tmp = strtok(cmdtext, idx);
			para1 = ReturnUser(tmp);
   			if(x_nr == 0)
			{
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "Comanda: /uninvite 0 [playerid/PartOfName]");
					return 1;
				}
				if (PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pAdmin] >= 10 )
				{
				    if(IsPlayerConnected(para1))
				    {
				        if(para1 != INVALID_PLAYER_ID)
				        {
						    if (PlayerInfo[para1][pMember] > 0 && ((PlayerInfo[para1][pMember] == PlayerInfo[playerid][pLeader]) || (PlayerInfo[playerid][pAdmin] >= 5)))
						    {
								GetPlayerName(para1, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
								printf("AdmCmd: %s has uninvited %s.", sendername, giveplayer);
								format(string, sizeof(string), "* You have been kicked from a Family / Police Force, by Leader %s.", sendername);
								SendClientMessage(para1, COLOR_LIGHTRED, string);
								SendClientMessage(para1, COLOR_LIGHTBLUE, "* You are now a Civilian again.");
				                gTeam[para1] = 3;
								PlayerInfo[para1][pTeam] = 3;
								PlayerInfo[para1][pMember] = 0;
								PlayerInfo[para1][pRank] = 0;
								PlayerInfo[para1][pCWarn] = 0;
								PlayerInfo[para1][pChar] = 0;
								PlayerInfo[para1][pPunish] = 0;
								new rand = random(sizeof(CIV));
								SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
								PlayerInfo[para1][pModel] = CIV[rand];
								SpawnPlayer(para1);
								format(string, sizeof(string), "   You have kicked %s from his Family / Police Force.", giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTRED, string);
							}
							else
							{
							    format(string, sizeof(string), "%s isn't in your faction.You cannot uninvite him.", giveplayer);
								SendClientMessage(playerid, COLOR_GRAD1, string);
							}
						}
					}//not connected
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "You are not autorized to use this command!");
				}
			}
			if(x_nr == 1)
			{
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_WHITE, "Comanda: /uninvite 1 [playerid/PartOfName]");
					return 1;
				}
				if (PlayerInfo[playerid][pLeader] >= 1 || PlayerInfo[playerid][pAdmin] >= 10 )
				{
				    if(IsPlayerConnected(para1))
				    {
				        if(para1 != INVALID_PLAYER_ID)
				        {
						    if (PlayerInfo[para1][pMember] > 0)
						    {
								GetPlayerName(para1, giveplayer, sizeof(giveplayer));
								GetPlayerName(playerid, sendername, sizeof(sendername));
								printf("AdmCmd: %s has uninvited %s.", sendername, giveplayer);
								format(string, sizeof(string), "* You have been kicked from a Family / Police Force, by Leader %s.", sendername);
								SendClientMessage(para1, COLOR_LIGHTBLUE, string);
								SendClientMessage(para1, COLOR_LIGHTBLUE, "* You are now a Civilian again.");
				                gTeam[para1] = 3;
								PlayerInfo[para1][pTeam] = 3;
								PlayerInfo[para1][pMember] = 0;
								PlayerInfo[para1][pRank] = 0;
								PlayerInfo[para1][pCWarn] = 0;
								PlayerInfo[para1][pChar] = 0;
								PlayerInfo[para1][pPunish] = 30;
								new rand = random(sizeof(CIV));
								SetSpawnInfo(para1, gTeam[para1], CIV[rand],0.0,0.0,0.0,0,0,0,0,0,0,0);
								PlayerInfo[para1][pModel] = CIV[rand];
								SpawnPlayer(para1);
								format(string, sizeof(string), "   You have kicked %s from his Family cu Faction Punish.", giveplayer);
								SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
							}
						}
					}//not connected
				}
				else
				{
					SendClientMessage(playerid, COLOR_GRAD1, "You are not autorized to use this command!!");
				}
			}
		}
		return 1;
	}

P.S: La invite si la uninvite nu sunt probleme. Cum am precizat mai sus, problema este la relog.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.